feat: convert `template-formula` to `unbound-formula`

BREAKING CHANGE: changed all state names and ids
This commit is contained in:
Alexander Weidinger 2021-03-31 10:10:44 +02:00
parent 86f4ebdd7b
commit ab5d798c84
94 changed files with 254 additions and 3952 deletions

View File

@ -117,35 +117,6 @@ rubocop:
script:
# Alternative value to consider: `${CI_JOB_NAME}`
- 'bin/kitchen verify "${DOCKER_ENV_CI_JOB_NAME}"'
# <REMOVEME
###############################################################################
# Define `test_conversion` template
###############################################################################
.test_conversion:
stage: *stage_test
image: *image_dindrubybionic
services: *services_docker_dind
variables: *variables_bundler
cache: *cache_bundler
before_script:
- 'export CONVERTED=test-the-use_this_template-button'
- 'git clone . tmp/"${CONVERTED}"-formula'
- 'cd tmp/"${CONVERTED}"-formula'
# Install `pre-commit` hooks
- 'bin/install-hooks'
# Run the conversion script with debug output
- 'DEBUG=true bin/convert-formula.sh "${CONVERTED}"'
- '[ $(git rev-list HEAD --count) -eq 2 ]'
# Quick visual check that correct files have been updated
- 'git show --pretty="" --name-status'
# TODO: This should work from the env vars above automatically
- 'bundle config set path "${BUNDLE_CACHE_PATH}"'
- 'bundle config set without "${BUNDLE_WITHOUT}"'
- 'bundle install'
script:
- 'bin/kitchen verify default-debian-10-tiamat-py3'
# REMOVEME>
###############################################################################
# `test` stage: each instance below uses the `test` template above
@ -153,20 +124,6 @@ rubocop:
## Define the rest of the matrix based on Kitchen testing
# Make sure the instances listed below match up with
# the `platforms` defined in `kitchen.yml`
# <REMOVEME
# NOTE: Please try to select up to six instances that add some meaningful
# testing of the formula's behaviour. If possible, try to refrain from
# the classical "chosing all the instances because I want to test on
# another/all distro/s" trap: it will just add time to the testing (see
# the discussion on #121). As an example, the set chosen below covers
# the most used distros families, systemd and non-systemd and the latest
# three supported Saltstack versions with python2 and 3.
# As for `kitchen.yml`, that should still contain all of the platforms,
# to allow for comprehensive local testing
# Ref: https://github.com/saltstack-formulas/template-formula/issues/118
# Ref: https://github.com/saltstack-formulas/template-formula/issues/121
test-formula-conversion: {extends: '.test_conversion'}
# REMOVEME>
# default-debian-10-tiamat-py3: {extends: '.test_instance'}
# default-debian-9-tiamat-py3: {extends: '.test_instance'}
# default-ubuntu-2004-tiamat-py3: {extends: '.test_instance'}

View File

@ -169,25 +169,6 @@ jobs:
# - env: INSTANCE=default-ubuntu-1804-3000-8-py2
# - env: INSTANCE=default-ubuntu-1604-3000-8-py2
# - env: INSTANCE=default-arch-base-latest-3000-8-py2
# <REMOVEME
# Test the conversion of `template-formula` into another formula
# ready for development
- env: 'Conversion'
name: 'Test: bin/convert-formula.sh'
script:
- export CONVERTED=test-the-use_this_template-button
- git clone . tmp/"$CONVERTED"-formula
- cd tmp/"$CONVERTED"-formula
- pyenv global 3.8
- pip install pre-commit==2.7.1
- bin/install-hooks
- DEBUG=true bin/convert-formula.sh "$CONVERTED"
- '[ $(git rev-list HEAD --count) -eq 2 ]'
# Quick visual check that correct files have been updated
- git show --pretty="" --name-status
- bin/kitchen verify default-debian-10-tiamat-py3
# REMOVEME>
## Define the release stage that runs `semantic-release`
- stage: 'release'
@ -214,17 +195,3 @@ jobs:
edge: true
# Run `semantic-release`
script: 'npx semantic-release@15.14'
# <REMOVEME
# Notification options: `always`, `never` or `change`
notifications:
webhooks:
if: 'repo = saltstack-formulas/template-formula'
urls:
- https://saltstack-formulas.zulipchat.com/api/v1/external/travis?api_key=HsIq3o5QmLxdnVCKF9is0FUIpkpAY79P&stream=CI&topic=saltstack-formulas%2Ftemplate-formula&ignore_pull_requests=true
on_success: always # default: always
on_failure: always # default: always
on_start: always # default: never
on_cancel: always # default: always
on_error: always # default: always
# REMOVEME>

View File

@ -1,34 +0,0 @@
# Authors
This list is sorted by the number of commits per contributor in _descending_ order.
Avatar|Contributor|Contributions
:-:|---|:-:
<img class='float-left rounded-1' src='https://avatars.githubusercontent.com/u/10231489?v=4' width='36' height='36' alt='@myii'>|[@myii](https://github.com/myii)|316
<img class='float-left rounded-1' src='https://avatars.githubusercontent.com/u/1233212?v=4' width='36' height='36' alt='@baby-gnu'>|[@baby-gnu](https://github.com/baby-gnu)|37
<img class='float-left rounded-1' src='https://avatars.githubusercontent.com/u/4195158?v=4' width='36' height='36' alt='@dafyddj'>|[@dafyddj](https://github.com/dafyddj)|31
<img class='float-left rounded-1' src='https://avatars.githubusercontent.com/u/1800660?v=4' width='36' height='36' alt='@aboe76'>|[@aboe76](https://github.com/aboe76)|27
<img class='float-left rounded-1' src='https://avatars.githubusercontent.com/u/242396?v=4' width='36' height='36' alt='@javierbertoli'>|[@javierbertoli](https://github.com/javierbertoli)|18
<img class='float-left rounded-1' src='https://avatars.githubusercontent.com/u/13322818?v=4' width='36' height='36' alt='@noelmcloughlin'>|[@noelmcloughlin](https://github.com/noelmcloughlin)|15
<img class='float-left rounded-1' src='https://avatars.githubusercontent.com/u/3433835?v=4' width='36' height='36' alt='@n-rodriguez'>|[@n-rodriguez](https://github.com/n-rodriguez)|8
<img class='float-left rounded-1' src='https://avatars.githubusercontent.com/u/52996?v=4' width='36' height='36' alt='@daks'>|[@daks](https://github.com/daks)|8
<img class='float-left rounded-1' src='https://avatars.githubusercontent.com/u/1396878?v=4' width='36' height='36' alt='@gravyboat'>|[@gravyboat](https://github.com/gravyboat)|6
<img class='float-left rounded-1' src='https://avatars.githubusercontent.com/u/1920805?v=4' width='36' height='36' alt='@alxwr'>|[@alxwr](https://github.com/alxwr)|5
<img class='float-left rounded-1' src='https://avatars.githubusercontent.com/u/4542588?v=4' width='36' height='36' alt='@evvers'>|[@evvers](https://github.com/evvers)|4
<img class='float-left rounded-1' src='https://avatars.githubusercontent.com/u/3374962?v=4' width='36' height='36' alt='@nmadhok'>|[@nmadhok](https://github.com/nmadhok)|3
<img class='float-left rounded-1' src='https://avatars.githubusercontent.com/u/16338056?v=4' width='36' height='36' alt='@vutny'>|[@vutny](https://github.com/vutny)|2
<img class='float-left rounded-1' src='https://avatars.githubusercontent.com/u/29522418?v=4' width='36' height='36' alt='@k-hamza'>|[@k-hamza](https://github.com/k-hamza)|2
<img class='float-left rounded-1' src='https://avatars.githubusercontent.com/u/528061?v=4' width='36' height='36' alt='@puneetk'>|[@puneetk](https://github.com/puneetk)|2
<img class='float-left rounded-1' src='https://avatars.githubusercontent.com/u/3536289?v=4' width='36' height='36' alt='@andygabby'>|[@andygabby](https://github.com/andygabby)|1
<img class='float-left rounded-1' src='https://avatars.githubusercontent.com/u/1269218?v=4' width='36' height='36' alt='@Jokipii'>|[@Jokipii](https://github.com/Jokipii)|1
<img class='float-left rounded-1' src='https://avatars.githubusercontent.com/u/5306980?v=4' width='36' height='36' alt='@johnkeates'>|[@johnkeates](https://github.com/johnkeates)|1
<img class='float-left rounded-1' src='https://avatars.githubusercontent.com/u/611471?v=4' width='36' height='36' alt='@duk3luk3'>|[@duk3luk3](https://github.com/duk3luk3)|1
<img class='float-left rounded-1' src='https://avatars.githubusercontent.com/u/3075069?v=4' width='36' height='36' alt='@marco-m'>|[@marco-m](https://github.com/marco-m)|1
<img class='float-left rounded-1' src='https://avatars.githubusercontent.com/u/91293?v=4' width='36' height='36' alt='@whiteinge'>|[@whiteinge](https://github.com/whiteinge)|1
<img class='float-left rounded-1' src='https://avatars.githubusercontent.com/u/22272?v=4' width='36' height='36' alt='@sroegner'>|[@sroegner](https://github.com/sroegner)|1
<img class='float-left rounded-1' src='https://avatars.githubusercontent.com/u/117961?v=4' width='36' height='36' alt='@babilen5'>|[@babilen5](https://github.com/babilen5)|1
<img class='float-left rounded-1' src='https://avatars.githubusercontent.com/u/2205993?v=4' width='36' height='36' alt='@GMAzrael'>|[@GMAzrael](https://github.com/GMAzrael)|1
---
Auto-generated by a [forked version](https://github.com/myii/maintainer) of [gaocegege/maintainer](https://github.com/gaocegege/maintainer) on 2021-03-09.

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,7 @@
# SECTION: Owner(s) for everything in the repo, unless a later match takes precedence
# FILE PATTERN OWNER(S)
* @saltstack-formulas/wg
* @NONE
# SECTION: Owner(s) for specific directories
# FILE PATTERN OWNER(S)

View File

@ -1,9 +1,9 @@
name: TEMPLATE
name: unbound
os: Debian, Ubuntu, Raspbian, RedHat, Fedora, CentOS, Amazon, Oracle, Suse, openSUSE, Gentoo, Funtoo, Arch, Manjaro, Alpine, FreeBSD, OpenBSD, Solaris, SmartOS, Windows, MacOS
os_family: Debian, RedHat, Suse, Gentoo, Arch, Alpine, FreeBSD, OpenBSD, Solaris, Windows, MacOS
version: 5.0.1
version: 1.0.0
release: 1
minimum_version: 2019.2
summary: TEMPLATE formula
summary: unbound formula
description: Formula to use as a template for other formulas
top_level_dir: TEMPLATE
top_level_dir: unbound

View File

@ -1,10 +0,0 @@
# -*- coding: utf-8 -*-
# vim: ft=sls
{#- Get the `tplroot` from `tpldir` #}
{%- set tplroot = tpldir.split('/')[0] %}
{%- from tplroot ~ "/map.jinja" import mapdata as TEMPLATE with context %}
TEMPLATE-package-install-pkg-installed:
pkg.installed:
- name: {{ TEMPLATE.pkg.name }}

View File

@ -1,114 +0,0 @@
#!/usr/bin/env sh
set -o nounset # Treat unset variables as an error and immediately exit
set -o errexit # If a command fails exit the whole script
if [ "${DEBUG:-false}" = "true" ]; then
set -x # Run the entire script in debug mode
fi
usage() {
echo "usage: $(basename "$0") <new-formula-name>" 1>&2
echo 1>&2
echo "Convert template-formula to <new-formula-name>-formula." 1>&2
echo "<new-formula-name> should be a string of lowercase characters, numbers or '-',\
'_' only." 1>&2
echo "<new-formula-name> should not be any of 'bin' 'docs' 'test'." 1>&2
}
sedi() {
# Run different sed -i arguments based on GNU vs BSD sed
# See https://stackoverflow.com/a/38595160
if sed --version >/dev/null 2>&1 ; then
sed -i"" "$@"
else
sed -i "" "$@"
fi
}
args() {
if [ $# -ne 1 ]; then
usage
exit 1
fi
NEW_NAME=$1
NEW_NAME_PYSAFE=$(echo "$NEW_NAME" | sed 's/-/__/g')
if echo "$NEW_NAME" | grep -E --quiet --invert-match '^[a-z0-9_-]+$'; then
usage
exit 1
fi
if echo bin docs test | grep --quiet --word-regexp "$NEW_NAME"; then
usage
exit 1
fi
}
convert_formula() {
# Empty history and make commit message `semantic-release`-compliant
# Works for forks of `template-formula` as well as GitHub "Use this template"
# See https://stackoverflow.com/a/15572071/5009408
git reset \
"$(echo 'feat: initial commit' \
| git commit-tree 'HEAD^{tree}')"
git rm --quiet bin/convert-formula.sh AUTHORS.md CHANGELOG.md \
docs/_static/css/custom.css docs/AUTHORS.rst docs/CHANGELOG.rst \
docs/conf.py docs/CONTRIBUTING_DOCS.rst docs/index.rst
tag_out=$(git tag --list | xargs git tag --delete)
if [ "${DEBUG:-false}" = "true" ]; then
echo "$tag_out"
fi
git mv TEMPLATE "$NEW_NAME"
# Replace TEMPLATE within sls and jinja files with py-safe formula name
# due to python limitations on identifier names (no hyphen)
# including when specifying jinja context variables
git ls-files -- '*.sls' '*.jinja' \
| while read -r filename; do
sedi "s/\({[{%#].*\)TEMPLATE/\1${NEW_NAME_PYSAFE}/" "$filename"
sedi "s/\([[:space:]]\{1,\}\)TEMPLATE:/\1${NEW_NAME_PYSAFE}:/" "$filename"
done
# Temporarily, until the v5 `map.jinja` is implemented for this formula, this
# specific py-safe replacement is also required (`map.jinja` import variable)
sedi "s/TEMPLATE/${NEW_NAME_PYSAFE}/g" "${NEW_NAME}/_mapdata/init.sls"
# However, this section will probably be needed even for the v5 `map.jinja`
# All of the YAML comparison files need the py-safe `map.jinja` import variable
git ls-files -- 'test/integration/*.yaml' \
| while read -r filename; do
sedi "/^\( \)TEMPLATE\(:\)$/s//\1${NEW_NAME_PYSAFE}\2/" "$filename"
done
# Replace all other instances of TEMPLATE with the regular new formula name
grep --recursive --files-with-matches --exclude-dir=.git TEMPLATE . \
| while read -r filename; do
sedi "s/TEMPLATE/${NEW_NAME}/g" "$filename"
done
# Miscellaneous other replacements
sedi 's/^\(version:\).*/\1 1.0.0/' FORMULA
sedi 's/^\(*[[:space:]]\{1,\}\)@saltstack-formulas\/wg/\1@NONE/' CODEOWNERS
# Deleting lines between two patterns
git ls-files -- '.gitlab-ci.yml' '.travis.yml' '.rubocop.yml' '*/map.jinja' \
| while read -r filename; do
sedi '/<REMOVEME/,/REMOVEME>/d' "$filename"
done
# shellcheck disable=SC1004 # This backslash+linefeed is literal (sed: replace text)
sedi '/<REMOVEME/,/REMOVEME>/c \
None
' docs/README.rst
# Produce a commitlint-safe commit message (line length)
if [ "${#NEW_NAME}" -gt 25 ]; then
NEW_NAME_SHORT=$(echo "$NEW_NAME" | cut -c 1-23)'..'
else
NEW_NAME_SHORT="$NEW_NAME"
fi
# shellcheck disable=SC2016 # Expressions don't expand in single quotes
git commit --quiet --all \
--message 'feat: convert `template-formula` to `'"$NEW_NAME_SHORT"'-formula`' \
--message 'BREAKING CHANGE: changed all state names and ids'
}
args "$@"
convert_formula

View File

@ -1,92 +0,0 @@
.. role:: raw-html-m2r(raw)
:format: html
Authors
=======
This list is sorted by the number of commits per contributor in *descending* order.
.. list-table::
:header-rows: 1
* - Avatar
- Contributor
- Contributions
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars.githubusercontent.com/u/10231489?v=4' width='36' height='36' alt='@myii'>`
- `@myii <https://github.com/myii>`_
- 316
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars.githubusercontent.com/u/1233212?v=4' width='36' height='36' alt='@baby-gnu'>`
- `@baby-gnu <https://github.com/baby-gnu>`_
- 37
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars.githubusercontent.com/u/4195158?v=4' width='36' height='36' alt='@dafyddj'>`
- `@dafyddj <https://github.com/dafyddj>`_
- 31
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars.githubusercontent.com/u/1800660?v=4' width='36' height='36' alt='@aboe76'>`
- `@aboe76 <https://github.com/aboe76>`_
- 27
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars.githubusercontent.com/u/242396?v=4' width='36' height='36' alt='@javierbertoli'>`
- `@javierbertoli <https://github.com/javierbertoli>`_
- 18
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars.githubusercontent.com/u/13322818?v=4' width='36' height='36' alt='@noelmcloughlin'>`
- `@noelmcloughlin <https://github.com/noelmcloughlin>`_
- 15
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars.githubusercontent.com/u/3433835?v=4' width='36' height='36' alt='@n-rodriguez'>`
- `@n-rodriguez <https://github.com/n-rodriguez>`_
- 8
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars.githubusercontent.com/u/52996?v=4' width='36' height='36' alt='@daks'>`
- `@daks <https://github.com/daks>`_
- 8
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars.githubusercontent.com/u/1396878?v=4' width='36' height='36' alt='@gravyboat'>`
- `@gravyboat <https://github.com/gravyboat>`_
- 6
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars.githubusercontent.com/u/1920805?v=4' width='36' height='36' alt='@alxwr'>`
- `@alxwr <https://github.com/alxwr>`_
- 5
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars.githubusercontent.com/u/4542588?v=4' width='36' height='36' alt='@evvers'>`
- `@evvers <https://github.com/evvers>`_
- 4
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars.githubusercontent.com/u/3374962?v=4' width='36' height='36' alt='@nmadhok'>`
- `@nmadhok <https://github.com/nmadhok>`_
- 3
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars.githubusercontent.com/u/16338056?v=4' width='36' height='36' alt='@vutny'>`
- `@vutny <https://github.com/vutny>`_
- 2
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars.githubusercontent.com/u/29522418?v=4' width='36' height='36' alt='@k-hamza'>`
- `@k-hamza <https://github.com/k-hamza>`_
- 2
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars.githubusercontent.com/u/528061?v=4' width='36' height='36' alt='@puneetk'>`
- `@puneetk <https://github.com/puneetk>`_
- 2
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars.githubusercontent.com/u/3536289?v=4' width='36' height='36' alt='@andygabby'>`
- `@andygabby <https://github.com/andygabby>`_
- 1
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars.githubusercontent.com/u/1269218?v=4' width='36' height='36' alt='@Jokipii'>`
- `@Jokipii <https://github.com/Jokipii>`_
- 1
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars.githubusercontent.com/u/5306980?v=4' width='36' height='36' alt='@johnkeates'>`
- `@johnkeates <https://github.com/johnkeates>`_
- 1
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars.githubusercontent.com/u/611471?v=4' width='36' height='36' alt='@duk3luk3'>`
- `@duk3luk3 <https://github.com/duk3luk3>`_
- 1
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars.githubusercontent.com/u/3075069?v=4' width='36' height='36' alt='@marco-m'>`
- `@marco-m <https://github.com/marco-m>`_
- 1
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars.githubusercontent.com/u/91293?v=4' width='36' height='36' alt='@whiteinge'>`
- `@whiteinge <https://github.com/whiteinge>`_
- 1
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars.githubusercontent.com/u/22272?v=4' width='36' height='36' alt='@sroegner'>`
- `@sroegner <https://github.com/sroegner>`_
- 1
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars.githubusercontent.com/u/117961?v=4' width='36' height='36' alt='@babilen5'>`
- `@babilen5 <https://github.com/babilen5>`_
- 1
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars.githubusercontent.com/u/2205993?v=4' width='36' height='36' alt='@GMAzrael'>`
- `@GMAzrael <https://github.com/GMAzrael>`_
- 1
----
Auto-generated by a `forked version <https://github.com/myii/maintainer>`_ of `gaocegege/maintainer <https://github.com/gaocegege/maintainer>`_ on 2021-03-09.

File diff suppressed because it is too large Load Diff

View File

@ -1,95 +0,0 @@
.. _contributing_docs:
Contributing documentation
==========================
|docs|
.. |docs| image:: https://readthedocs.org/projects/docs/badge/?version=latest
:alt: Documentation Status
:scale: 100%
:target: https://TEMPLATE-formula.readthedocs.io/en/latest/?badge=latest
Toolchain
^^^^^^^^^
The documentation for this formula is written in
`reStructuredText <https://en.wikipedia.org/wiki/ReStructuredText>`_
(also known as RST, ReST, or reST).
It is built by
`Sphinx <https://en.wikipedia.org/wiki/Sphinx_(documentation_generator)>`_
and hosted on
`Read the Docs <https://en.wikipedia.org/wiki/Read_the_Docs>`_.
Adding a new page
^^^^^^^^^^^^^^^^^
Adding a new page involves two steps:
#. Use the
:ref:`provided page template <saltstack_formulas_rst_page_template>`
to create a new page.
#. Add the page name under the ``toctree`` list in ``index.rst``.
a. Do not just append it to the list.
#. Select the best place where it fits within the overall documentation.
.. _saltstack_formulas_rst_page_template:
SaltStack-Formulas' RST page template
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Use the following template when creating a new page.
This ensures consistency across the documentation for this formula.
The heading symbols have been selected in accordance to the output rendered by the
`Markdown to reStructuredText converter <https://github.com/miyakogi/m2r#restrictions>`_
we are using for some of the pages of this documentation.
.. code-block:: rst
.. _template:
[Page title]
============
[Introductory paragraph]
.. contents:: **Table of Contents**
[Heading 2]
-----------
[Heading 3]
^^^^^^^^^^^
[Heading 4]
~~~~~~~~~~~
[Heading 5]
"""""""""""
[Heading 6]
###########
#. The first line is an anchor that can be used to link back to (the top of)
this file.
a. Change this to be the lowercase version of the file name.
#. Do not include the ``.rst`` file extension.
#. Use hyphens (``-``) instead of spaces or non-letter characters.
#. Change the ``[Page title]`` accordingly, matching the same number of equals
signs (``=``) underneath.
#. Change the ``[Introductory paragraph]`` to be a short summary of the page
content.
Use no more than three paragraphs for this.
#. Leave the ``..contents:: **Table of Contents**`` line as it is.
#. Use the remaining headings as required to break up the page content.
a. You will rarely need to use beyond ``[Heading 4]``.
#. Again, no single heading should have more than about three paragraphs of
content before the next heading or sub-heading is used.
Obviously, it is not necessary to follow the steps in the order above.
For example, it is usually easier to write the ``[Introductory paragraph]``
at the end.

View File

@ -1,14 +1,14 @@
.. _readme:
TEMPLATE-formula
unbound-formula
================
|img_travis| |img_sr| |img_pc|
.. |img_travis| image:: https://travis-ci.com/saltstack-formulas/TEMPLATE-formula.svg?branch=master
.. |img_travis| image:: https://travis-ci.com/saltstack-formulas/unbound-formula.svg?branch=master
:alt: Travis CI Build Status
:scale: 100%
:target: https://travis-ci.com/saltstack-formulas/TEMPLATE-formula
:target: https://travis-ci.com/saltstack-formulas/unbound-formula
.. |img_sr| image:: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg
:alt: Semantic Release
:scale: 100%
@ -68,35 +68,7 @@ now ``pre-commit`` will run automatically on each ``git commit``. ::
Special notes
-------------
.. <REMOVEME
Using this template
^^^^^^^^^^^^^^^^^^^
The easiest way to use this template formula as a base for a new formula is to use GitHub's **Use this template** button to create a new repository. For consistency with the rest of the formula ecosystem, name your formula repository following the pattern ``<formula theme>-formula``, where ``<formula theme>`` consists of lower-case alphabetic characters, numbers, '-' or '_'.
In the rest of this example we'll use ``example`` as the ``<formula theme>``.
Follow these steps to complete the conversion from ``template-formula`` to ``example-formula``. ::
$ git clone git@github.com:YOUR-USERNAME/example-formula.git
$ cd example-formula/
$ bin/convert-formula.sh example
$ git push --force
Alternatively, it's possible to clone ``template-formula`` into a new repository and perform the conversion there. For example::
$ git clone https://github.com/saltstack-formulas/template-formula example-formula
$ cd example-formula/
$ bin/convert-formula.sh example
To take advantage of `semantic-release <https://github.com/semantic-release/semantic-release>`_ for automated changelog generation and release tagging, you will need a GitHub `Personal Access Token <https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line>`_ with at least the **public_repo** scope.
In the Travis repository settings for your new repository, create an `environment variable <https://docs.travis-ci.com/user/environment-variables/#defining-variables-in-repository-settings>`_ named ``GH_TOKEN`` with the personal access token as value, restricted to the ``master`` branch for security.
Note that this repository uses a `CODEOWNERS <https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners>`_ file to assign ownership to various parts of the formula. The conversion process removes overall ownership, but you should consider assigning ownership to yourself or your organisation when contributing your new formula to the ``saltstack-formulas`` organisation.
.. REMOVEME>
None
Available states
----------------
@ -104,79 +76,79 @@ Available states
.. contents::
:local:
``TEMPLATE``
``unbound``
^^^^^^^^^^^^
*Meta-state (This is a state that includes other states)*.
This installs the TEMPLATE package,
manages the TEMPLATE configuration file and then
starts the associated TEMPLATE service.
This installs the unbound package,
manages the unbound configuration file and then
starts the associated unbound service.
``TEMPLATE.package``
``unbound.package``
^^^^^^^^^^^^^^^^^^^^
This state will install the TEMPLATE package only.
This state will install the unbound package only.
``TEMPLATE.config``
``unbound.config``
^^^^^^^^^^^^^^^^^^^
This state will configure the TEMPLATE service and has a dependency on ``TEMPLATE.install``
This state will configure the unbound service and has a dependency on ``unbound.install``
via include list.
``TEMPLATE.service``
``unbound.service``
^^^^^^^^^^^^^^^^^^^^
This state will start the TEMPLATE service and has a dependency on ``TEMPLATE.config``
This state will start the unbound service and has a dependency on ``unbound.config``
via include list.
``TEMPLATE.clean``
``unbound.clean``
^^^^^^^^^^^^^^^^^^
*Meta-state (This is a state that includes other states)*.
this state will undo everything performed in the ``TEMPLATE`` meta-state in reverse order, i.e.
this state will undo everything performed in the ``unbound`` meta-state in reverse order, i.e.
stops the service,
removes the configuration file and
then uninstalls the package.
``TEMPLATE.service.clean``
``unbound.service.clean``
^^^^^^^^^^^^^^^^^^^^^^^^^^
This state will stop the TEMPLATE service and disable it at boot time.
This state will stop the unbound service and disable it at boot time.
``TEMPLATE.config.clean``
``unbound.config.clean``
^^^^^^^^^^^^^^^^^^^^^^^^^
This state will remove the configuration of the TEMPLATE service and has a
dependency on ``TEMPLATE.service.clean`` via include list.
This state will remove the configuration of the unbound service and has a
dependency on ``unbound.service.clean`` via include list.
``TEMPLATE.package.clean``
``unbound.package.clean``
^^^^^^^^^^^^^^^^^^^^^^^^^^
This state will remove the TEMPLATE package and has a depency on
``TEMPLATE.config.clean`` via include list.
This state will remove the unbound package and has a depency on
``unbound.config.clean`` via include list.
``TEMPLATE.subcomponent``
``unbound.subcomponent``
^^^^^^^^^^^^^^^^^^^^^^^^^
*Meta-state (This is a state that includes other states)*.
This state installs a subcomponent configuration file before
configuring and starting the TEMPLATE service.
configuring and starting the unbound service.
``TEMPLATE.subcomponent.config``
``unbound.subcomponent.config``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This state will configure the TEMPLATE subcomponent and has a
dependency on ``TEMPLATE.config`` via include list.
This state will configure the unbound subcomponent and has a
dependency on ``unbound.config`` via include list.
``TEMPLATE.subcomponent.config.clean``
``unbound.subcomponent.config.clean``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This state will remove the configuration of the TEMPLATE subcomponent
and reload the TEMPLATE service by a dependency on
``TEMPLATE.service.running`` via include list and ``watch_in``
This state will remove the configuration of the unbound subcomponent
and reload the unbound service by a dependency on
``unbound.service.running`` via include list and ``watch_in``
requisite.
Testing
@ -202,7 +174,7 @@ e.g. ``debian-9-2019-2-py3``.
``bin/kitchen converge``
^^^^^^^^^^^^^^^^^^^^^^^^
Creates the docker instance and runs the ``TEMPLATE`` main state, ready for testing.
Creates the docker instance and runs the ``unbound`` main state, ready for testing.
``bin/kitchen verify``
^^^^^^^^^^^^^^^^^^^^^^

View File

@ -1,20 +0,0 @@
/*
Override styles for in-use Sphinx theme
*/
/* The next two `.wy`-based rules are specifically needed for the dealing with */
/* the `sphinx_rtd_theme` bug where long lines do not wrap in tables */
/* override table width restrictions */
.wy-table-responsive table th
, .wy-table-responsive table td
{
/* !important prevents the common CSS stylesheets from
overriding this as on RTD they are loaded after this stylesheet */
white-space: normal !important;
}
.wy-table-responsive
{
overflow: visible !important;
}

View File

@ -1,173 +0,0 @@
# -*- coding: utf-8 -*-
"""Configuration file for the Sphinx documentation builder.
This file does only contain a selection of the most common options. For a
full list see the documentation:
* http://www.sphinx-doc.org/en/stable/config
"""
from __future__ import division, print_function, unicode_literals
# from datetime import datetime
from recommonmark.parser import CommonMarkParser
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
__author__ = 'Imran Iqbal' # noqa: E221
__copyright__ = 'Copyright (C) 2019, MYII' # noqa: E221
__license__ = 'Apache-2.0' # noqa: E221
__version__ = 'latest' # noqa: E221
__maintainer__ = 'Imran Iqbal' # noqa: E221
# -- Project information -----------------------------------------------------
project = 'template-formula'
copyright = __copyright__.replace('Copyright (C) ', '') # noqa: A001
author = __author__
version = __version__
release = __version__
# -- General configuration ---------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = []
# Add any paths that contain templates here, relative to this directory.
templates_path = ['templates', '_templates', '.templates']
# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
source_suffix = ['.rst', '.md']
# The master toctree document.
master_doc = 'index'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path .
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# -- Options for the reStructuredText parser ---------------------------------
file_insertion_enabled = False
# -- Options for HTML output -------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
# html_theme_options = {}
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
#
# The default sidebars (for documents that don't match any pattern) are
# defined by theme itself. Builtin themes are using these templates by
# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
# 'searchbox.html']``.
#
# html_sidebars = {}
# -- Options for HTMLHelp output ---------------------------------------------
# Output file base name for HTML help builder.
htmlhelp_basename = 'template-formula'
# -- Options for Markdown output ---------------------------------------------
source_parsers = {
'.md': CommonMarkParser,
}
# -- Options for LaTeX output ------------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',
# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(
'index',
'template-formula.tex',
u'template-formula Documentation',
u'',
'manual',
),
]
# -- Functions: `setup`, docstring preprocessing, etc. -----------------------
def setup(app):
"""Prepare the Sphinx application object.
Used for providing a custom CSS file for override styles.
Parameters
----------
app : object
The Sphinx application object.
Returns
-------
app : object
The Sphinx application object.
"""
app.add_stylesheet('css/custom.css')
return app

View File

@ -1,20 +0,0 @@
.. _index:
.. ``template-formula`` documentation master file.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to template-formula's documentation!
============================================
.. toctree::
:maxdepth: 2
:caption: Contents
:numbered:
:glob:
README <README>
CONTRIBUTING
TOFS_pattern
AUTHORS
CHANGELOG

View File

@ -28,7 +28,7 @@ For formula users
Quick start: configure per role and per DNS domain name values
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
We will see a quick setup to configure the ``TEMPLATE`` formula for different DNS domain names and several roles.
We will see a quick setup to configure the ``unbound`` formula for different DNS domain names and several roles.
For this example, I'll define 2 kinds of `fileserver`_ sources:
@ -72,19 +72,19 @@ Create the file ``/etc/salt/master.d/fileserver.conf`` and restart the ``master`
...
Create per DNS configuration for ``TEMPLATE`` formula
Create per DNS configuration for ``unbound`` formula
`````````````````````````````````````````````````````
Now, we can provides the per DNS domain name configuration files for the ``TEMPLATE`` formulas under ``/srv/salt/TEMPLATE/parameters/``.
Now, we can provides the per DNS domain name configuration files for the ``unbound`` formulas under ``/srv/salt/unbound/parameters/``.
We create the directory for ``dns:domain`` grain and we add a symlink for the ``domain`` grain which is extracted from the minion ``id``:
.. code-block:: console
mkdir -p /srv/salt/TEMPLATE/parameters/dns:domain/
ln -s dns:domain /srv/salt/TEMPLATE/parameters/domain
mkdir -p /srv/salt/unbound/parameters/dns:domain/
ln -s dns:domain /srv/salt/unbound/parameters/domain
We create a configuration for the DNS domain ``example.net`` in ``/srv/salt/TEMPLATE/parameters/dns:domain/example.net.yaml``:
We create a configuration for the DNS domain ``example.net`` in ``/srv/salt/unbound/parameters/dns:domain/example.net.yaml``:
.. code-block:: yaml
@ -93,7 +93,7 @@ We create a configuration for the DNS domain ``example.net`` in ``/srv/salt/TEMP
config: /etc/template-formula-example-net.conf
...
We create another configuration for the DNS domain ``example.com`` in the Jinja YAML template ``/srv/salt/TEMPLATE/parameters/dns:domain/example.com.yaml.jinja``:
We create another configuration for the DNS domain ``example.com`` in the Jinja YAML template ``/srv/salt/unbound/parameters/dns:domain/example.com.yaml.jinja``:
.. code-block:: yaml
@ -103,23 +103,23 @@ We create another configuration for the DNS domain ``example.com`` in the Jinja
...
Create per role configuration for ``TEMPLATE`` formula
Create per role configuration for ``unbound`` formula
``````````````````````````````````````````````````````
Now, we can provides the per role configuration files for the ``TEMPLATE`` formulas under ``/srv/salt/TEMPLATE/parameters/``.
Now, we can provides the per role configuration files for the ``unbound`` formulas under ``/srv/salt/unbound/parameters/``.
We create the directory for roles:
.. code-block:: console
mkdir -p /srv/salt/TEMPLATE/parameters/roles
mkdir -p /srv/salt/unbound/parameters/roles
We will define 2 roles:
- ``TEMPLATE/server``
- ``TEMPLATE/client``
- ``unbound/server``
- ``unbound/client``
We create a configuration for the role ``TEMPLATE/server`` in ``/srv/salt/TEMPLATE/parameters/roles/TEMPLATE/server.yaml``:
We create a configuration for the role ``unbound/server`` in ``/srv/salt/unbound/parameters/roles/unbound/server.yaml``:
.. code-block:: yaml
@ -128,7 +128,7 @@ We create a configuration for the role ``TEMPLATE/server`` in ``/srv/salt/TEMPLA
config: /etc/template-formula-server.conf
...
We create another configuration for the role ``TEMPLATE/client`` in ``/srv/salt/TEMPLATE/parameters/roles/TEMPLATE/client.yaml``:
We create another configuration for the role ``unbound/client`` in ``/srv/salt/unbound/parameters/roles/unbound/client.yaml``:
.. code-block:: yaml
@ -185,13 +185,13 @@ For the servers:
.. code-block:: console
salt 'server-*' grains.append roles TEMPLATE/server
salt 'server-*' grains.append roles unbound/server
For the clients:
.. code-block:: console
salt 'client-*' grains.append roles TEMPLATE/client
salt 'client-*' grains.append roles unbound/client
.. note::
@ -236,7 +236,7 @@ And then, rename the directory:
.. code-block:: console
mv /srv/salt/TEMPLATE/parameters/dns:domain/ '/srv/salt/TEMPLATE/parameters/dns!domain/'
mv /srv/salt/unbound/parameters/dns:domain/ '/srv/salt/unbound/parameters/dns!domain/'
Format of configuration YAML files
@ -458,11 +458,11 @@ Here is the best way to use it in an ``sls`` file:
{#- Get the `tplroot` from `tpldir` #}
{%- set tplroot = tpldir.split("/")[0] %}
{%- from tplroot ~ "/map.jinja" import mapdata as TEMPLATE with context %}
{%- from tplroot ~ "/map.jinja" import mapdata as unbound with context %}
test-does-nothing-but-display-TEMPLATE-as-json:
test-does-nothing-but-display-unbound-as-json:
test.nop:
- name: {{ TEMPLATE | json }}
- name: {{ unbound | json }}
Use formula configuration values in templates
@ -470,7 +470,7 @@ Use formula configuration values in templates
When you need to process salt templates, you should avoid calling `salt['config.get']`_ (or `salt['pillar.get']`_ and `salt['grains.get']`_) directly from the template. All the needed values should be available within the ``mapdata`` variable exported by ``map.jinja``.
Here is an example based on `template-formula/TEMPLATE/config/file.sls`_:
Here is an example based on `template-formula/unbound/config/file.sls`_:
.. code-block:: sls
@ -480,30 +480,30 @@ Here is an example based on `template-formula/TEMPLATE/config/file.sls`_:
{#- Get the `tplroot` from `tpldir` #}
{%- set tplroot = tpldir.split('/')[0] %}
{%- set sls_package_install = tplroot ~ '.package.install' %}
{%- from tplroot ~ "/map.jinja" import mapdata as TEMPLATE with context %}
{%- from tplroot ~ "/map.jinja" import mapdata as unbound with context %}
{%- from tplroot ~ "/libtofs.jinja" import files_switch with context %}
include:
- {{ sls_package_install }}
TEMPLATE-config-file-file-managed:
unbound-config-file-file-managed:
file.managed:
- name: {{ TEMPLATE.config }}
- name: {{ unbound.config }}
- source: {{ files_switch(['example.tmpl'],
lookup='TEMPLATE-config-file-file-managed'
lookup='unbound-config-file-file-managed'
)
}}
- mode: 644
- user: root
- group: {{ TEMPLATE.rootgroup }}
- group: {{ unbound.rootgroup }}
- makedirs: True
- template: jinja
- require:
- sls: {{ sls_package_install }}
- context:
TEMPLATE: {{ TEMPLATE | json }}
unbound: {{ unbound | json }}
This ``sls`` file expose a ``TEMPLATE`` context variable to the jinja template which could be used like this:
This ``sls`` file expose a ``unbound`` context variable to the jinja template which could be used like this:
.. code-block:: jinja
@ -515,9 +515,9 @@ This ``sls`` file expose a ``TEMPLATE`` context variable to the jinja template w
This is another example file from SaltStack template-formula.
# This is here for testing purposes
{{ TEMPLATE | json }}
{{ unbound | json }}
winner of the merge: {{ TEMPLATE['winner'] }}
winner of the merge: {{ unbound['winner'] }}
.. _documentation: https://docs.saltproject.io/en/latest/topics/development/conventions/formulas.html#writing-formulas
@ -538,5 +538,5 @@ This ``sls`` file expose a ``TEMPLATE`` context variable to the jinja template w
.. _salt.slsutil.merge: https://docs.saltproject.io/en/latest/ref/modules/all/salt.modules.slsutil.html#salt.modules.slsutil.merge
.. _traverse: https://docs.saltproject.io/en/latest/topics/jinja/index.html#traverse
.. _salt-ssh: https://docs.saltproject.io/en/latest/topics/ssh/
.. _template-formula/TEMPLATE/config/file.sls: https://github.com/saltstack-formulas/template-formula/blob/master/TEMPLATE/config/file.sls
.. _template-formula/unbound/config/file.sls: https://github.com/saltstack-formulas/template-formula/blob/master/unbound/config/file.sls
.. _bug 58726: https://github.com/saltstack/salt/issues/58726

View File

@ -293,7 +293,7 @@ provisioner:
log_level: debug
salt_install: none
require_chef: false
formula: TEMPLATE
formula: unbound
salt_copy_filter:
- .kitchen
- .git
@ -321,16 +321,16 @@ suites:
state_top:
base:
'*':
- TEMPLATE._mapdata
- TEMPLATE
- unbound._mapdata
- unbound
pillars:
top.sls:
base:
'*':
- TEMPLATE
- unbound
- define_roles
pillars_from_files:
TEMPLATE.sls: pillar.example
unbound.sls: pillar.example
define_roles.sls: test/salt/pillar/define_roles.sls
verifier:
inspec_tests:
@ -349,17 +349,17 @@ suites:
state_top:
base:
'*':
- TEMPLATE._mapdata
- TEMPLATE
- unbound._mapdata
- unbound
pillars:
top.sls:
base:
'*':
- TEMPLATE
- unbound
- gentoo
- define_roles
pillars_from_files:
TEMPLATE.sls: pillar.example
unbound.sls: pillar.example
gentoo.sls: test/salt/pillar/gentoo.sls
define_roles.sls: test/salt/pillar/define_roles.sls
verifier:

View File

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# vim: ft=yaml
---
TEMPLATE:
unbound:
lookup:
master: template-master
# Just for testing purposes
@ -33,7 +33,7 @@ TEMPLATE:
# All aspects of path/file resolution are customisable using the options below.
# This is unnecessary in most cases; there are sensible defaults.
# Default path: salt://< path_prefix >/< dirs.files >/< dirs.default >
# I.e.: salt://TEMPLATE/files/default
# I.e.: salt://unbound/files/default
# path_prefix: template_alt
# dirs:
# files: files_alt
@ -41,15 +41,15 @@ TEMPLATE:
# The entries under `source_files` are prepended to the default source files
# given for the state
# source_files:
# TEMPLATE-config-file-file-managed:
# unbound-config-file-file-managed:
# - 'example_alt.tmpl'
# - 'example_alt.tmpl.jinja'
# For testing purposes
source_files:
TEMPLATE-config-file-file-managed:
unbound-config-file-file-managed:
- 'example.tmpl.jinja'
TEMPLATE-subcomponent-config-file-file-managed:
unbound-subcomponent-config-file-file-managed:
- 'subcomponent-example.tmpl.jinja'
# Just for testing purposes

View File

@ -2,7 +2,7 @@
require 'yaml'
control 'TEMPLATE._mapdata' do
control 'unbound._mapdata' do
title '`map.jinja` should match the reference file'
### Method

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
control 'TEMPLATE.config.file' do
control 'unbound.config.file' do
title 'Verify the configuration file'
describe file('/etc/template-formula.conf') do
@ -26,8 +26,8 @@ control 'TEMPLATE.config.file' do
should include(
'"tofs": {"files_switch": ["any/path/can/be/used/here", "id", '\
'"roles", "osfinger", "os", "os_family"], "source_files": '\
'{"TEMPLATE-config-file-file-managed": ["example.tmpl.jinja"], '\
'"TEMPLATE-subcomponent-config-file-file-managed": '\
'{"unbound-config-file-file-managed": ["example.tmpl.jinja"], '\
'"unbound-subcomponent-config-file-file-managed": '\
'["subcomponent-example.tmpl.jinja"]}'
)
# rubocop:enable Layout/LineLength

View File

@ -3,7 +3,7 @@
# Prepare platform "finger"
platform_finger = system.platform[:finger].split('.').first.to_s
control 'TEMPLATE.package.install' do
control 'unbound.package.install' do
title 'The required package should be installed'
# Overide by `platform_finger`

View File

@ -3,7 +3,7 @@
# Prepare platform "finger"
platform_finger = system.platform[:finger].split('.').first.to_s
control 'TEMPLATE.service.running' do
control 'unbound.service.running' do
title 'The service should be installed, enabled and running'
# Overide by `platform_finger`

View File

@ -1,9 +1,9 @@
# frozen_string_literal: true
control 'TEMPLATE.subcomponent.config.file' do
control 'unbound.subcomponent.config.file' do
title 'Verify the subcomponent configuration file'
describe file('/etc/TEMPLATE-subcomponent-formula.conf') do
describe file('/etc/unbound-subcomponent-formula.conf') do
it { should be_file }
it { should be_owned_by 'root' }
it { should be_grouped_into 'root' }
@ -11,7 +11,7 @@ control 'TEMPLATE.subcomponent.config.file' do
its('content') do
should include(
'# File managed by Salt at '\
'<salt://TEMPLATE/subcomponent/config/files/default/'\
'<salt://unbound/subcomponent/config/files/default/'\
'subcomponent-example.tmpl.jinja>.'
)
end

View File

@ -17,8 +17,8 @@ values:
- Y:G@os_family
- Y:G@os
- Y:G@osfinger
- C@TEMPLATE:lookup
- C@TEMPLATE
- C@unbound:lookup
- C@unbound
- Y:G@id
master: template-master
pkg:
@ -27,7 +27,7 @@ values:
service:
name: crond
subcomponent:
config: /etc/TEMPLATE-subcomponent-formula.conf
config: /etc/unbound-subcomponent-formula.conf
tofs:
files_switch:
- any/path/can/be/used/here
@ -37,8 +37,8 @@ values:
- os
- os_family
source_files:
TEMPLATE-config-file-file-managed:
unbound-config-file-file-managed:
- example.tmpl.jinja
TEMPLATE-subcomponent-config-file-file-managed:
unbound-subcomponent-config-file-file-managed:
- subcomponent-example.tmpl.jinja
winner: pillar

View File

@ -17,8 +17,8 @@ values:
- Y:G@os_family
- Y:G@os
- Y:G@osfinger
- C@TEMPLATE:lookup
- C@TEMPLATE
- C@unbound:lookup
- C@unbound
- Y:G@id
master: template-master
pkg:
@ -27,7 +27,7 @@ values:
service:
name: systemd-journald
subcomponent:
config: /etc/TEMPLATE-subcomponent-formula.conf
config: /etc/unbound-subcomponent-formula.conf
tofs:
files_switch:
- any/path/can/be/used/here
@ -37,8 +37,8 @@ values:
- os
- os_family
source_files:
TEMPLATE-config-file-file-managed:
unbound-config-file-file-managed:
- example.tmpl.jinja
TEMPLATE-subcomponent-config-file-file-managed:
unbound-subcomponent-config-file-file-managed:
- subcomponent-example.tmpl.jinja
winner: pillar

View File

@ -17,8 +17,8 @@ values:
- Y:G@os_family
- Y:G@os
- Y:G@osfinger
- C@TEMPLATE:lookup
- C@TEMPLATE
- C@unbound:lookup
- C@unbound
- Y:G@id
master: template-master
pkg:
@ -27,7 +27,7 @@ values:
service:
name: systemd-journald
subcomponent:
config: /etc/TEMPLATE-subcomponent-formula.conf
config: /etc/unbound-subcomponent-formula.conf
tofs:
files_switch:
- any/path/can/be/used/here
@ -37,8 +37,8 @@ values:
- os
- os_family
source_files:
TEMPLATE-config-file-file-managed:
unbound-config-file-file-managed:
- example.tmpl.jinja
TEMPLATE-subcomponent-config-file-file-managed:
unbound-subcomponent-config-file-file-managed:
- subcomponent-example.tmpl.jinja
winner: pillar

View File

@ -17,8 +17,8 @@ values:
- Y:G@os_family
- Y:G@os
- Y:G@osfinger
- C@TEMPLATE:lookup
- C@TEMPLATE
- C@unbound:lookup
- C@unbound
- Y:G@id
master: template-master
pkg:
@ -27,7 +27,7 @@ values:
service:
name: crond
subcomponent:
config: /etc/TEMPLATE-subcomponent-formula.conf
config: /etc/unbound-subcomponent-formula.conf
tofs:
files_switch:
- any/path/can/be/used/here
@ -37,8 +37,8 @@ values:
- os
- os_family
source_files:
TEMPLATE-config-file-file-managed:
unbound-config-file-file-managed:
- example.tmpl.jinja
TEMPLATE-subcomponent-config-file-file-managed:
unbound-subcomponent-config-file-file-managed:
- subcomponent-example.tmpl.jinja
winner: pillar

View File

@ -17,8 +17,8 @@ values:
- Y:G@os_family
- Y:G@os
- Y:G@osfinger
- C@TEMPLATE:lookup
- C@TEMPLATE
- C@unbound:lookup
- C@unbound
- Y:G@id
master: template-master
pkg:
@ -27,7 +27,7 @@ values:
service:
name: systemd-journald
subcomponent:
config: /etc/TEMPLATE-subcomponent-formula.conf
config: /etc/unbound-subcomponent-formula.conf
tofs:
files_switch:
- any/path/can/be/used/here
@ -37,8 +37,8 @@ values:
- os
- os_family
source_files:
TEMPLATE-config-file-file-managed:
unbound-config-file-file-managed:
- example.tmpl.jinja
TEMPLATE-subcomponent-config-file-file-managed:
unbound-subcomponent-config-file-file-managed:
- subcomponent-example.tmpl.jinja
winner: pillar

View File

@ -17,8 +17,8 @@ values:
- Y:G@os_family
- Y:G@os
- Y:G@osfinger
- C@TEMPLATE:lookup
- C@TEMPLATE
- C@unbound:lookup
- C@unbound
- Y:G@id
master: template-master
pkg:
@ -27,7 +27,7 @@ values:
service:
name: systemd-journald
subcomponent:
config: /etc/TEMPLATE-subcomponent-formula.conf
config: /etc/unbound-subcomponent-formula.conf
tofs:
files_switch:
- any/path/can/be/used/here
@ -37,8 +37,8 @@ values:
- os
- os_family
source_files:
TEMPLATE-config-file-file-managed:
unbound-config-file-file-managed:
- example.tmpl.jinja
TEMPLATE-subcomponent-config-file-file-managed:
unbound-subcomponent-config-file-file-managed:
- subcomponent-example.tmpl.jinja
winner: pillar

View File

@ -17,8 +17,8 @@ values:
- Y:G@os_family
- Y:G@os
- Y:G@osfinger
- C@TEMPLATE:lookup
- C@TEMPLATE
- C@unbound:lookup
- C@unbound
- Y:G@id
master: template-master
pkg:
@ -27,7 +27,7 @@ values:
service:
name: systemd-journald
subcomponent:
config: /etc/TEMPLATE-subcomponent-formula.conf
config: /etc/unbound-subcomponent-formula.conf
tofs:
files_switch:
- any/path/can/be/used/here
@ -37,8 +37,8 @@ values:
- os
- os_family
source_files:
TEMPLATE-config-file-file-managed:
unbound-config-file-file-managed:
- example.tmpl.jinja
TEMPLATE-subcomponent-config-file-file-managed:
unbound-subcomponent-config-file-file-managed:
- subcomponent-example.tmpl.jinja
winner: pillar

View File

@ -17,8 +17,8 @@ values:
- Y:G@os_family
- Y:G@os
- Y:G@osfinger
- C@TEMPLATE:lookup
- C@TEMPLATE
- C@unbound:lookup
- C@unbound
- Y:G@id
master: template-master
pkg:
@ -27,7 +27,7 @@ values:
service:
name: systemd-journald
subcomponent:
config: /etc/TEMPLATE-subcomponent-formula.conf
config: /etc/unbound-subcomponent-formula.conf
tofs:
files_switch:
- any/path/can/be/used/here
@ -37,8 +37,8 @@ values:
- os
- os_family
source_files:
TEMPLATE-config-file-file-managed:
unbound-config-file-file-managed:
- example.tmpl.jinja
TEMPLATE-subcomponent-config-file-file-managed:
unbound-subcomponent-config-file-file-managed:
- subcomponent-example.tmpl.jinja
winner: pillar

View File

@ -17,8 +17,8 @@ values:
- Y:G@os_family
- Y:G@os
- Y:G@osfinger
- C@TEMPLATE:lookup
- C@TEMPLATE
- C@unbound:lookup
- C@unbound
- Y:G@id
master: template-master
pkg:
@ -27,7 +27,7 @@ values:
service:
name: systemd-journald
subcomponent:
config: /etc/TEMPLATE-subcomponent-formula.conf
config: /etc/unbound-subcomponent-formula.conf
tofs:
files_switch:
- any/path/can/be/used/here
@ -37,8 +37,8 @@ values:
- os
- os_family
source_files:
TEMPLATE-config-file-file-managed:
unbound-config-file-file-managed:
- example.tmpl.jinja
TEMPLATE-subcomponent-config-file-file-managed:
unbound-subcomponent-config-file-file-managed:
- subcomponent-example.tmpl.jinja
winner: pillar

View File

@ -17,8 +17,8 @@ values:
- Y:G@os_family
- Y:G@os
- Y:G@osfinger
- C@TEMPLATE:lookup
- C@TEMPLATE
- C@unbound:lookup
- C@unbound
- Y:G@id
master: template-master
pkg:
@ -27,7 +27,7 @@ values:
service:
name: systemd-journald
subcomponent:
config: /etc/TEMPLATE-subcomponent-formula.conf
config: /etc/unbound-subcomponent-formula.conf
tofs:
files_switch:
- any/path/can/be/used/here
@ -37,8 +37,8 @@ values:
- os
- os_family
source_files:
TEMPLATE-config-file-file-managed:
unbound-config-file-file-managed:
- example.tmpl.jinja
TEMPLATE-subcomponent-config-file-file-managed:
unbound-subcomponent-config-file-file-managed:
- subcomponent-example.tmpl.jinja
winner: pillar

View File

@ -17,8 +17,8 @@ values:
- Y:G@os_family
- Y:G@os
- Y:G@osfinger
- C@TEMPLATE:lookup
- C@TEMPLATE
- C@unbound:lookup
- C@unbound
- Y:G@id
master: template-master
pkg:
@ -27,7 +27,7 @@ values:
service:
name: systemd-journald
subcomponent:
config: /etc/TEMPLATE-subcomponent-formula.conf
config: /etc/unbound-subcomponent-formula.conf
tofs:
files_switch:
- any/path/can/be/used/here
@ -37,8 +37,8 @@ values:
- os
- os_family
source_files:
TEMPLATE-config-file-file-managed:
unbound-config-file-file-managed:
- example.tmpl.jinja
TEMPLATE-subcomponent-config-file-file-managed:
unbound-subcomponent-config-file-file-managed:
- subcomponent-example.tmpl.jinja
winner: pillar

View File

@ -17,8 +17,8 @@ values:
- Y:G@os_family
- Y:G@os
- Y:G@osfinger
- C@TEMPLATE:lookup
- C@TEMPLATE
- C@unbound:lookup
- C@unbound
- Y:G@id
master: template-master
pkg:
@ -27,7 +27,7 @@ values:
service:
name: systemd-journald
subcomponent:
config: /etc/TEMPLATE-subcomponent-formula.conf
config: /etc/unbound-subcomponent-formula.conf
tofs:
files_switch:
- any/path/can/be/used/here
@ -37,8 +37,8 @@ values:
- os
- os_family
source_files:
TEMPLATE-config-file-file-managed:
unbound-config-file-file-managed:
- example.tmpl.jinja
TEMPLATE-subcomponent-config-file-file-managed:
unbound-subcomponent-config-file-file-managed:
- subcomponent-example.tmpl.jinja
winner: pillar

View File

@ -17,8 +17,8 @@ values:
- Y:G@os_family
- Y:G@os
- Y:G@osfinger
- C@TEMPLATE:lookup
- C@TEMPLATE
- C@unbound:lookup
- C@unbound
- Y:G@id
master: template-master
pkg:
@ -27,7 +27,7 @@ values:
service:
name: mtab
subcomponent:
config: /etc/TEMPLATE-subcomponent-formula.conf
config: /etc/unbound-subcomponent-formula.conf
tofs:
files_switch:
- any/path/can/be/used/here
@ -37,8 +37,8 @@ values:
- os
- os_family
source_files:
TEMPLATE-config-file-file-managed:
unbound-config-file-file-managed:
- example.tmpl.jinja
TEMPLATE-subcomponent-config-file-file-managed:
unbound-subcomponent-config-file-file-managed:
- subcomponent-example.tmpl.jinja
winner: pillar

View File

@ -17,8 +17,8 @@ values:
- Y:G@os_family
- Y:G@os
- Y:G@osfinger
- C@TEMPLATE:lookup
- C@TEMPLATE
- C@unbound:lookup
- C@unbound
- Y:G@id
master: template-master
pkg:
@ -27,7 +27,7 @@ values:
service:
name: systemd-journald
subcomponent:
config: /etc/TEMPLATE-subcomponent-formula.conf
config: /etc/unbound-subcomponent-formula.conf
tofs:
files_switch:
- any/path/can/be/used/here
@ -37,8 +37,8 @@ values:
- os
- os_family
source_files:
TEMPLATE-config-file-file-managed:
unbound-config-file-file-managed:
- example.tmpl.jinja
TEMPLATE-subcomponent-config-file-file-managed:
unbound-subcomponent-config-file-file-managed:
- subcomponent-example.tmpl.jinja
winner: pillar

View File

@ -17,8 +17,8 @@ values:
- Y:G@os_family
- Y:G@os
- Y:G@osfinger
- C@TEMPLATE:lookup
- C@TEMPLATE
- C@unbound:lookup
- C@unbound
- Y:G@id
master: template-master
pkg:
@ -27,7 +27,7 @@ values:
service:
name: systemd-journald
subcomponent:
config: /etc/TEMPLATE-subcomponent-formula.conf
config: /etc/unbound-subcomponent-formula.conf
tofs:
files_switch:
- any/path/can/be/used/here
@ -37,8 +37,8 @@ values:
- os
- os_family
source_files:
TEMPLATE-config-file-file-managed:
unbound-config-file-file-managed:
- example.tmpl.jinja
TEMPLATE-subcomponent-config-file-file-managed:
unbound-subcomponent-config-file-file-managed:
- subcomponent-example.tmpl.jinja
winner: pillar

View File

@ -17,8 +17,8 @@ values:
- Y:G@os_family
- Y:G@os
- Y:G@osfinger
- C@TEMPLATE:lookup
- C@TEMPLATE
- C@unbound:lookup
- C@unbound
- Y:G@id
master: template-master
pkg:
@ -27,7 +27,7 @@ values:
service:
name: systemd-journald
subcomponent:
config: /etc/TEMPLATE-subcomponent-formula.conf
config: /etc/unbound-subcomponent-formula.conf
tofs:
files_switch:
- any/path/can/be/used/here
@ -37,8 +37,8 @@ values:
- os
- os_family
source_files:
TEMPLATE-config-file-file-managed:
unbound-config-file-file-managed:
- example.tmpl.jinja
TEMPLATE-subcomponent-config-file-file-managed:
unbound-subcomponent-config-file-file-managed:
- subcomponent-example.tmpl.jinja
winner: pillar

View File

@ -17,8 +17,8 @@ values:
- Y:G@os_family
- Y:G@os
- Y:G@osfinger
- C@TEMPLATE:lookup
- C@TEMPLATE
- C@unbound:lookup
- C@unbound
- Y:G@id
master: template-master
pkg:
@ -27,7 +27,7 @@ values:
service:
name: systemd-journald
subcomponent:
config: /etc/TEMPLATE-subcomponent-formula.conf
config: /etc/unbound-subcomponent-formula.conf
tofs:
files_switch:
- any/path/can/be/used/here
@ -37,8 +37,8 @@ values:
- os
- os_family
source_files:
TEMPLATE-config-file-file-managed:
unbound-config-file-file-managed:
- example.tmpl.jinja
TEMPLATE-subcomponent-config-file-file-managed:
unbound-subcomponent-config-file-file-managed:
- subcomponent-example.tmpl.jinja
winner: pillar

View File

@ -17,8 +17,8 @@ values:
- Y:G@os_family
- Y:G@os
- Y:G@osfinger
- C@TEMPLATE:lookup
- C@TEMPLATE
- C@unbound:lookup
- C@unbound
- Y:G@id
master: template-master
pkg:
@ -27,7 +27,7 @@ values:
service:
name: systemd-journald
subcomponent:
config: /etc/TEMPLATE-subcomponent-formula.conf
config: /etc/unbound-subcomponent-formula.conf
tofs:
files_switch:
- any/path/can/be/used/here
@ -37,8 +37,8 @@ values:
- os
- os_family
source_files:
TEMPLATE-config-file-file-managed:
unbound-config-file-file-managed:
- example.tmpl.jinja
TEMPLATE-subcomponent-config-file-file-managed:
unbound-subcomponent-config-file-file-managed:
- subcomponent-example.tmpl.jinja
winner: pillar

View File

@ -17,8 +17,8 @@ values:
- Y:G@os_family
- Y:G@os
- Y:G@osfinger
- C@TEMPLATE:lookup
- C@TEMPLATE
- C@unbound:lookup
- C@unbound
- Y:G@id
master: template-master
pkg:
@ -27,7 +27,7 @@ values:
service:
name: systemd-journald
subcomponent:
config: /etc/TEMPLATE-subcomponent-formula.conf
config: /etc/unbound-subcomponent-formula.conf
tofs:
files_switch:
- any/path/can/be/used/here
@ -37,8 +37,8 @@ values:
- os
- os_family
source_files:
TEMPLATE-config-file-file-managed:
unbound-config-file-file-managed:
- example.tmpl.jinja
TEMPLATE-subcomponent-config-file-file-managed:
unbound-subcomponent-config-file-file-managed:
- subcomponent-example.tmpl.jinja
winner: pillar

View File

@ -17,8 +17,8 @@ values:
- Y:G@os_family
- Y:G@os
- Y:G@osfinger
- C@TEMPLATE:lookup
- C@TEMPLATE
- C@unbound:lookup
- C@unbound
- Y:G@id
master: template-master
pkg:
@ -27,7 +27,7 @@ values:
service:
name: systemd-journald
subcomponent:
config: /etc/TEMPLATE-subcomponent-formula.conf
config: /etc/unbound-subcomponent-formula.conf
tofs:
files_switch:
- any/path/can/be/used/here
@ -37,8 +37,8 @@ values:
- os
- os_family
source_files:
TEMPLATE-config-file-file-managed:
unbound-config-file-file-managed:
- example.tmpl.jinja
TEMPLATE-subcomponent-config-file-file-managed:
unbound-subcomponent-config-file-file-managed:
- subcomponent-example.tmpl.jinja
winner: pillar

View File

@ -2,11 +2,11 @@
# vim: ft=yaml
---
name: default
title: TEMPLATE formula
title: unbound formula
maintainer: SaltStack Formulas
license: Apache-2.0
# yamllint disable-line rule:line-length
summary: Verify that the TEMPLATE formula is setup and configured correctly
summary: Verify that the unbound formula is setup and configured correctly
depends:
- name: share
path: test/integration/share

View File

@ -3,7 +3,7 @@
---
portage:
sync_wait_one_day: true
TEMPLATE:
unbound:
pkg:
name: 'app-shells/bash'
service:

View File

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# vim: ft=yaml
---
TEMPLATE:
unbound:
lookup:
master: template-master
# Just for testing purposes
@ -42,9 +42,9 @@ TEMPLATE:
# For testing purposes
source_files:
TEMPLATE-config-file-file-managed:
unbound-config-file-file-managed:
- 'example.tmpl.jinja'
TEMPLATE-subcomponent-config-file-file-managed:
unbound-subcomponent-config-file-file-managed:
- 'subcomponent-example.tmpl.jinja'
# Just for testing purposes

View File

@ -4,13 +4,13 @@
{#- Get the `tplroot` from `tpldir` #}
{%- set tplroot = tpldir.split('/')[0] %}
{%- set sls_service_clean = tplroot ~ '.service.clean' %}
{%- from tplroot ~ "/map.jinja" import mapdata as TEMPLATE with context %}
{%- from tplroot ~ "/map.jinja" import mapdata as unbound with context %}
include:
- {{ sls_service_clean }}
TEMPLATE-config-clean-file-absent:
unbound-config-clean-file-absent:
file.absent:
- name: {{ TEMPLATE.config }}
- name: {{ unbound.config }}
- require:
- sls: {{ sls_service_clean }}

View File

@ -4,25 +4,25 @@
{#- Get the `tplroot` from `tpldir` #}
{%- set tplroot = tpldir.split('/')[0] %}
{%- set sls_package_install = tplroot ~ '.package.install' %}
{%- from tplroot ~ "/map.jinja" import mapdata as TEMPLATE with context %}
{%- from tplroot ~ "/map.jinja" import mapdata as unbound with context %}
{%- from tplroot ~ "/libtofs.jinja" import files_switch with context %}
include:
- {{ sls_package_install }}
TEMPLATE-config-file-file-managed:
unbound-config-file-file-managed:
file.managed:
- name: {{ TEMPLATE.config }}
- name: {{ unbound.config }}
- source: {{ files_switch(['example.tmpl'],
lookup='TEMPLATE-config-file-file-managed'
lookup='unbound-config-file-file-managed'
)
}}
- mode: 644
- user: root
- group: {{ TEMPLATE.rootgroup }}
- group: {{ unbound.rootgroup }}
- makedirs: True
- template: jinja
- require:
- sls: {{ sls_package_install }}
- context:
TEMPLATE: {{ TEMPLATE | json }}
unbound: {{ unbound | json }}

View File

@ -6,6 +6,6 @@
This is another example file from SaltStack template-formula.
# This is here for testing purposes
{{ TEMPLATE | json }}
{{ unbound | json }}
winner of the merge: {{ TEMPLATE['winner'] }}
winner of the merge: {{ unbound['winner'] }}

View File

@ -4,13 +4,13 @@
{#- Get the `tplroot` from `tpldir` #}
{%- set tplroot = tpldir.split('/')[0] %}
{%- set sls_config_clean = tplroot ~ '.config.clean' %}
{%- from tplroot ~ "/map.jinja" import mapdata as TEMPLATE with context %}
{%- from tplroot ~ "/map.jinja" import mapdata as unbound with context %}
include:
- {{ sls_config_clean }}
TEMPLATE-package-clean-pkg-removed:
unbound-package-clean-pkg-removed:
pkg.removed:
- name: {{ TEMPLATE.pkg.name }}
- name: {{ unbound.pkg.name }}
- require:
- sls: {{ sls_config_clean }}

View File

@ -0,0 +1,10 @@
# -*- coding: utf-8 -*-
# vim: ft=sls
{#- Get the `tplroot` from `tpldir` #}
{%- set tplroot = tpldir.split('/')[0] %}
{%- from tplroot ~ "/map.jinja" import mapdata as unbound with context %}
unbound-package-install-pkg-installed:
pkg.installed:
- name: {{ unbound.pkg.name }}

View File

@ -5,13 +5,13 @@
---
values:
pkg:
name: TEMPLATE
name: unbound
rootgroup: root
config: '/etc/TEMPLATE'
config: '/etc/unbound'
service:
name: TEMPLATE
name: unbound
subcomponent:
config: '/etc/TEMPLATE-subcomponent-formula.conf'
config: '/etc/unbound-subcomponent-formula.conf'
# Just here for testing
added_in_defaults: defaults_value
winner: defaults

View File

@ -13,7 +13,7 @@
---
values:
pkg:
name: TEMPLATE-fedora
name: unbound-fedora
service:
name: service-fedora
...

View File

@ -13,6 +13,6 @@
---
values:
pkg:
name: TEMPLATE-ubuntu
config: /etc/TEMPLATE.d/custom-ubuntu.conf
name: unbound-ubuntu
config: /etc/unbound.d/custom-ubuntu.conf
...

View File

@ -13,7 +13,7 @@
---
values:
pkg:
name: TEMPLATE-arch
name: unbound-arch
service:
name: service-arch
...

View File

@ -13,6 +13,6 @@
---
values:
pkg:
name: TEMPLATE-debian
config: /etc/TEMPLATE.d/custom.conf
name: unbound-debian
config: /etc/unbound.d/custom.conf
...

View File

@ -13,5 +13,5 @@
---
values:
pkg:
name: TEMPLATE-gentoo
name: unbound-gentoo
...

View File

@ -13,6 +13,6 @@
---
values:
pkg:
name: TEMPLATE-redhat
config: /etc/TEMPLATE.conf
name: unbound-redhat
config: /etc/unbound.conf
...

View File

@ -13,5 +13,5 @@
---
values:
pkg:
name: TEMPLATE-suse
name: unbound-suse
...

View File

@ -13,6 +13,6 @@
---
values:
pkg:
name: TEMPLATE-centos-6
config: /etc/TEMPLATE.d/custom-centos-6.conf
name: unbound-centos-6
config: /etc/unbound.d/custom-centos-6.conf
...

View File

@ -12,5 +12,5 @@
# values: {}
---
values:
config: /etc/TEMPLATE.d/custom-ubuntu-18.04.conf
config: /etc/unbound.d/custom-ubuntu-18.04.conf
...

View File

@ -3,9 +3,9 @@
{#- Get the `tplroot` from `tpldir` #}
{%- set tplroot = tpldir.split('/')[0] %}
{%- from tplroot ~ "/map.jinja" import mapdata as TEMPLATE with context %}
{%- from tplroot ~ "/map.jinja" import mapdata as unbound with context %}
TEMPLATE-service-clean-service-dead:
unbound-service-clean-service-dead:
service.dead:
- name: {{ TEMPLATE.service.name }}
- name: {{ unbound.service.name }}
- enable: False

View File

@ -4,14 +4,14 @@
{#- Get the `tplroot` from `tpldir` #}
{%- set tplroot = tpldir.split('/')[0] %}
{%- set sls_config_file = tplroot ~ '.config.file' %}
{%- from tplroot ~ "/map.jinja" import mapdata as TEMPLATE with context %}
{%- from tplroot ~ "/map.jinja" import mapdata as unbound with context %}
include:
- {{ sls_config_file }}
TEMPLATE-service-running-service-running:
unbound-service-running-service-running:
service.running:
- name: {{ TEMPLATE.service.name }}
- name: {{ unbound.service.name }}
- enable: True
- watch:
- sls: {{ sls_config_file }}

View File

@ -4,13 +4,13 @@
{#- Get the `tplroot` from `tpldir` #}
{%- set tplroot = tpldir.split('/')[0] %}
{%- set sls_service_clean = tplroot ~ '.service.clean' %}
{%- from tplroot ~ "/map.jinja" import mapdata as TEMPLATE with context %}
{%- from tplroot ~ "/map.jinja" import mapdata as unbound with context %}
include:
- {{ sls_service_clean }}
TEMPLATE-subcomponent-config-clean-file-absent:
unbound-subcomponent-config-clean-file-absent:
file.absent:
- name: {{ TEMPLATE.subcomponent.config }}
- name: {{ unbound.subcomponent.config }}
- watch_in:
- sls: {{ sls_service_clean }}

View File

@ -4,23 +4,23 @@
{#- Get the `tplroot` from `tpldir` #}
{%- set tplroot = tpldir.split('/')[0] %}
{%- set sls_config_file = tplroot ~ '.config.file' %}
{%- from tplroot ~ "/map.jinja" import mapdata as TEMPLATE with context %}
{%- from tplroot ~ "/map.jinja" import mapdata as unbound with context %}
{%- from tplroot ~ "/libtofs.jinja" import files_switch with context %}
include:
- {{ sls_config_file }}
TEMPLATE-subcomponent-config-file-file-managed:
unbound-subcomponent-config-file-file-managed:
file.managed:
- name: {{ TEMPLATE.subcomponent.config }}
- name: {{ unbound.subcomponent.config }}
- source: {{ files_switch(['subcomponent-example.tmpl'],
lookup='TEMPLATE-subcomponent-config-file-file-managed',
lookup='unbound-subcomponent-config-file-file-managed',
use_subpath=True
)
}}
- mode: 644
- user: root
- group: {{ TEMPLATE.rootgroup }}
- group: {{ unbound.rootgroup }}
- makedirs: True
- template: jinja
- require_in: