Welcome to template-formula’s documentation!¶
TEMPLATE-formula¶
A SaltStack formula that is empty. It has dummy content to help with a quick start on a new formula and it serves as a style guide.
Table of Contents
General notes¶
See the full SaltStack Formulas installation and usage instructions.
If you are interested in writing or contributing to formulas, please pay attention to the Writing Formula Section.
If you want to use this formula, please pay attention to the FORMULA
file and/or git tag
,
which contains the currently released version. This formula is versioned according to Semantic Versioning.
See Formula Versioning Section for more details.
If you need (non-default) configuration, please refer to:
- how to configure the formula with map.jinja
- the
pillar.example
file - the Special notes section
Contributing to this repo¶
Commit messages¶
Commit message formatting is significant!!
Please see How to contribute for more details.
pre-commit¶
pre-commit is configured for this formula, which you may optionally use to ease the steps involved in submitting your changes.
First install the pre-commit
package manager using the appropriate method, then run bin/install-hooks
and
now pre-commit
will run automatically on each git commit
.
$ bin/install-hooks
pre-commit installed at .git/hooks/pre-commit
pre-commit installed at .git/hooks/commit-msg
Special notes¶
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 for automated changelog generation and release tagging, you will need a GitHub Personal Access Token with at least the public_repo scope.
In the Travis repository settings for your new repository, create an environment variable named GH_TOKEN
with the personal access token as value, restricted to the master
branch for security.
Note that this repository uses a CODEOWNERS 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.
Available states¶
TEMPLATE
¶
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.
TEMPLATE.package
¶
This state will install the TEMPLATE package only.
TEMPLATE.config
¶
This state will configure the TEMPLATE service and has a dependency on TEMPLATE.install
via include list.
TEMPLATE.service
¶
This state will start the TEMPLATE service and has a dependency on TEMPLATE.config
via include list.
TEMPLATE.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.
stops the service,
removes the configuration file and
then uninstalls the package.
TEMPLATE.service.clean
¶
This state will stop the TEMPLATE service and disable it at boot time.
TEMPLATE.config.clean
¶
This state will remove the configuration of the TEMPLATE service and has a
dependency on TEMPLATE.service.clean
via include list.
TEMPLATE.package.clean
¶
This state will remove the TEMPLATE package and has a depency on
TEMPLATE.config.clean
via include list.
TEMPLATE.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.
TEMPLATE.subcomponent.config
¶
This state will configure the TEMPLATE subcomponent and has a
dependency on TEMPLATE.config
via include list.
TEMPLATE.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
requisite.
Testing¶
Linux testing is done with kitchen-salt
.
Requirements¶
- Ruby
- Docker
$ gem install bundler
$ bundle install
$ bin/kitchen test [platform]
Where [platform]
is the platform name defined in kitchen.yml
,
e.g. debian-9-2019-2-py3
.
bin/kitchen converge
¶
Creates the docker instance and runs the TEMPLATE
main state, ready for testing.
bin/kitchen verify
¶
Runs the inspec
tests on the actual instance.
bin/kitchen destroy
¶
Removes the docker instance.
bin/kitchen test
¶
Runs all of the stages above in one go: i.e. destroy
+ converge
+ verify
+ destroy
.
bin/kitchen login
¶
Gives you SSH access to the instance for manual testing.
TOFS: A pattern for using SaltStack¶
Person | Contact | Date | |
---|---|---|---|
Authored by | Roberto Moreda | moreda@allenta.com | 29/12/2014 |
Modified by | Daniel Dehennin | daniel.dehennin@baby-gnu.org | 07/02/2019 |
Modified by | Imran Iqbal | https://github.com/myii | 23/02/2019 |
All that follows is a proposal based on my experience with SaltStack. The good thing of a piece of software like this is that you can “bend it” to suit your needs in many possible ways, and this is one of them. All the recommendations and thoughts are given “as it is” with no warranty of any type.
Table of Contents
Usage of values in pillar vs templates in file_roots
¶
Among other functions, the master (or salt-master) serves files to the minions (or salt-minions). The file_roots is the list of directories used in sequence to find a file when a minion requires it: the first match is served to the minion. Those files could be state files or configuration templates, among others.
Using SaltStack is a simple and effective way to implement configuration management, but even in a non-multitenant scenario, it is not a good idea to generally access some data (e.g. the database password in our Zabbix server configuration file or the private key of our Nginx TLS certificate).
To avoid this situation we can use the pillar mechanism, which is designed to provide controlled access to data from the minions based on some selection rules. As pillar data could be easily integrated in the Jinja templates, it is a good mechanism to store values to be used in the final rendering of state files and templates.
There are a variety of approaches on the usage of pillar and templates as seen in the saltstack-formulas’ repositories. Some developments stress the initial purpose of pillar data into a storage for most of the possible variables for a determined system configuration. This, in my opinion, is shifting too much load from the original template files approach. Adding up some non-trivial Jinja code as essential part of composing the state file definitely makes SaltStack state files (hence formulas) more difficult to read. The extreme of this approach is that we could end up with a new render mechanism, implemented in Jinja, storing everything needed in pillar data to compose configurations. Additionally, we are establishing a strong dependency with the Jinja renderer.
In opposition to the put the code in file_roots and the data in pillars approach, there is the pillar as a store for a set of key-values approach. A full-blown configuration file abstracted in pillar and jinja is complicated to develop, understand and maintain. I think a better and simpler approach is to keep a configuration file templated using just a basic (non-extensive but extensible) set of pillar values.
On the reusability of SaltStack state files¶
There is a brilliant initiative of the SaltStack community called salt-formulas. Their goal is to provide state files, pillar examples and configuration templates ready to be used for provisioning. I am a contributor for two small ones: zabbix-formula and varnish-formula.
The design guidelines for formulas are clear in many aspects and it is a recommended reading for anyone willing to write state files, even non-formulaic ones.
In the next section, I am going to describe my proposal to extend further the reusability of formulas, suggesting some patterns of usage.
The Template Override and Files Switch (TOFS) pattern¶
I understand a formula as a complete, independent set of SaltStack state and configuration template files sufficient to configure a system. A system could be something as simple as an NTP server or some other much more complex service that requires many state and configuration template files.
The customization of a formula should be done mainly by providing pillar data used later to render either the state or the configuration template files.
Example: NTP before applying TOFS¶
Let’s work with the NTP example. A basic formula that follows the design guidelines has the following files and directories tree:
/srv/saltstack/salt-formulas/ntp-saltstack-formula/
ntp/
map.jinja
init.sls
conf.sls
files/
default/
etc/
ntp.conf.jinja
In order to use it, let’s assume a masterless configuration and this relevant section of /etc/salt/minion
:
pillar_roots:
base:
- /srv/saltstack/pillar
file_client: local
file_roots:
base:
- /srv/saltstack/salt
- /srv/saltstack/salt-formulas/ntp-saltstack-formula
{#- /srv/saltstack/salt-formulas/ntp-saltstack-formula/ntp/map.jinja #}
{%- set ntp = salt['grains.filter_by']({
'default': {
'pkg': 'ntp',
'service': 'ntp',
'config': '/etc/ntp.conf',
},
}, merge=salt['pillar.get']('ntp:lookup')) %}
In init.sls
we have the minimal states required to have NTP configured. In many cases init.sls
is almost equivalent to an apt-get install
or a yum install
of the package.
## /srv/saltstack/salt-formulas/ntp-saltstack-formula/ntp/init.sls
{%- from 'ntp/map.jinja' import ntp with context %}
Install NTP:
pkg.installed:
- name: {{ ntp.pkg }}
Enable and start NTP:
service.running:
- name: {{ ntp.service }}
- enabled: True
- require:
- pkg: Install NTP package
In conf.sls
we have the configuration states. In most cases, that is just managing configuration file templates and making them to be watched by the service.
## /srv/saltstack/salt-formulas/ntp-saltstack-formula/ntp/conf.sls
include:
- ntp
{%- from 'ntp/map.jinja' import ntp with context %}
Configure NTP:
file.managed:
- name: {{ ntp.config }}
- template: jinja
- source: salt://ntp/files/default/etc/ntp.conf.jinja
- watch_in:
- service: Enable and start NTP service
- require:
- pkg: Install NTP package
Under files/default
, there is a structure that mimics the one in the minion in order to avoid clashes and confusion on where to put the needed templates. There you can find a mostly standard template for the configuration file.
{#- /srv/saltstack/salt-formulas/ntp-saltstack-formula/ntp/files/default/etc/ntp.conf.jinja #}
{#- Managed by saltstack #}
{#- Edit pillars or override this template in saltstack if you need customization #}
{%- set settings = salt['pillar.get']('ntp', {}) %}
{%- set default_servers = ['0.ubuntu.pool.ntp.org',
'1.ubuntu.pool.ntp.org',
'2.ubuntu.pool.ntp.org',
'3.ubuntu.pool.ntp.org'] %}
driftfile /var/lib/ntp/ntp.drift
statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable
{%- for server in settings.get('servers', default_servers) %}
server {{ server }}
{%- endfor %}
restrict -4 default kod notrap nomodify nopeer noquery
restrict -6 default kod notrap nomodify nopeer noquery
restrict 127.0.0.1
restrict ::1
With all this, it is easy to install and configure a simple NTP server by just running salt-call state.sls ntp.conf
: the package will be installed, the service will be running and the configuration should be correct for most of cases, even without pillar data.
Alternatively, you can define a highstate in /srv/saltstack/salt/top.sls
and run salt-call state.highstate
.
## /srv/saltstack/salt/top.sls
base:
'*':
- ntp.conf
Customizing the formula just with pillar data, we have the option to define the NTP servers.
## /srv/saltstack/pillar/top.sls
base:
'*':
- ntp
## /srv/saltstack/pillar/ntp.sls
ntp:
servers:
- 0.ch.pool.ntp.org
- 1.ch.pool.ntp.org
- 2.ch.pool.ntp.org
- 3.ch.pool.ntp.org
Template Override¶
If the customization based on pillar data is not enough, we can override the template by creating a new one in /srv/saltstack/salt/ntp/files/default/etc/ntp.conf.jinja
{#- /srv/saltstack/salt/ntp/files/default/etc/ntp.conf.jinja #}
{#- Managed by saltstack #}
{#- Edit pillars or override this template in saltstack if you need customization #}
{#- Some bizarre configurations here #}
{#- ... #}
{%- for server in settings.get('servers', default_servers) %}
server {{ server }}
{%- endfor %}
This way we are locally overriding the template files offered by the formula in order to make a more complex adaptation. Of course, this could be applied as well to any of the files, including the state files.
Files Switch¶
To bring some order into the set of template files included in a formula, as we commented, we suggest having a similar structure to a normal final file system under files/default
.
We can make different templates coexist for different minions, classified by any grain value, by simply creating new directories under files
. This mechanism is based on using values of some grains as a switch for the directories under files/
.
If we decide that we want os_family
as switch, then we could provide the formula template variants for both the RedHat
and Debian
families.
/srv/saltstack/salt-formulas/ntp-saltstack-formula/ntp/files/
default/
etc/
ntp.conf.jinja
RedHat/
etc/
ntp.conf.jinja
Debian/
etc/
ntp.conf.jinja
To make this work we need a conf.sls
state file that takes a list of possible files as the configuration template.
## /srv/saltstack/salt-formulas/ntp-saltstack-formula/ntp/conf.sls
include:
- ntp
{%- from 'ntp/map.jinja' import ntp with context %}
Configure NTP:
file.managed:
- name: {{ ntp.config }}
- template: jinja
- source:
- salt://ntp/files/{{ grains.get('os_family', 'default') }}/etc/ntp.conf.jinja
- salt://ntp/files/default/etc/ntp.conf.jinja
- watch_in:
- service: Enable and start NTP service
- require:
- pkg: Install NTP package
If we want to cover the possibility of a special template for a minion identified by node01
then we could have a specific template in /srv/saltstack/salt/ntp/files/node01/etc/ntp.conf.jinja
.
{#- /srv/saltstack/salt/ntp/files/node01/etc/ntp.conf.jinja #}
{#- Managed by saltstack #}
{#- Edit pillars or override this template in saltstack if you need customization #}
{#- Some crazy configurations here for node01 #}
{#- ... #}
To make this work we could write a specially crafted conf.sls
.
## /srv/saltstack/salt-formulas/ntp-saltstack-formula/ntp/conf.sls
include:
- ntp
{%- from 'ntp/map.jinja' import ntp with context %}
Configure NTP:
file.managed:
- name: {{ ntp.config }}
- template: jinja
- source:
- salt://ntp/files/{{ grains.get('id') }}/etc/ntp.conf.jinja
- salt://ntp/files/{{ grains.get('os_family') }}/etc/ntp.conf.jinja
- salt://ntp/files/default/etc/ntp.conf.jinja
- watch_in:
- service: Enable and start NTP service
- require:
- pkg: Install NTP package
Using the files_switch
macro¶
We can simplify the conf.sls
with the new files_switch
macro to use in the source
parameter for the file.managed
state.
## /srv/saltstack/salt-formulas/ntp-saltstack-formula/ntp/conf.sls
include:
- ntp
{%- set tplroot = tpldir.split('/')[0] %}
{%- from 'ntp/map.jinja' import ntp with context %}
{%- from 'ntp/libtofs.jinja' import files_switch %}
Configure NTP:
file.managed:
- name: {{ ntp.config }}
- template: jinja
- source: {{ files_switch(['/etc/ntp.conf.jinja'],
lookup='Configure NTP'
)
}}
- watch_in:
- service: Enable and start NTP service
- require:
- pkg: Install NTP package
- This uses
config.get
, searching forntp:tofs:source_files:Configure NTP
to determine the list of template files to use. - If this returns a result, the default of
['/etc/ntp.conf.jinja']
will be appended to it. - If this does not yield any results, the default of
['/etc/ntp.conf.jinja']
will be used.
In libtofs.jinja
, we define this new macro files_switch
.
How to customise the source
further¶
The examples below are based on an Ubuntu
minion called theminion
being configured via. pillar.
Using the default settings of the files_switch
macro above,
the source
will be:
- source:
- salt://ntp/files/theminion/etc/ntp.conf.jinja
- salt://ntp/files/Debian/etc/ntp.conf.jinja
- salt://ntp/files/default/etc/ntp.conf.jinja
Customise files
¶
The files
portion can be customised:
ntp:
tofs:
dirs:
files: files_alt
Resulting in:
- source:
- salt://ntp/files_alt/theminion/etc/ntp.conf.jinja
- salt://ntp/files_alt/Debian/etc/ntp.conf.jinja
- salt://ntp/files_alt/default/etc/ntp.conf.jinja
Customise the use of grains¶
Grains can be customised and even arbitrary paths can be supplied:
ntp:
tofs:
files_switch:
- any/path/can/be/used/here
- id
- os
- os_family
Resulting in:
- source:
- salt://ntp/files/any/path/can/be/used/here/etc/ntp.conf.jinja
- salt://ntp/files/theminion/etc/ntp.conf.jinja
- salt://ntp/files/Ubuntu/etc/ntp.conf.jinja
- salt://ntp/files/Debian/etc/ntp.conf.jinja
- salt://ntp/files/default/etc/ntp.conf.jinja
Customise the default
path¶
The default
portion of the path can be customised:
ntp:
tofs:
dirs:
default: default_alt
Resulting in:
- source:
...
- salt://ntp/files/default_alt/etc/ntp.conf.jinja
Customise the list of source_files
¶
The list of source_files
can be given:
ntp:
tofs:
source_files:
Configure NTP:
- '/etc/ntp.conf_alt.jinja'
Resulting in:
- source:
- salt://ntp/files/theminion/etc/ntp.conf_alt.jinja
- salt://ntp/files/theminion/etc/ntp.conf.jinja
- salt://ntp/files/Debian/etc/ntp.conf_alt.jinja
- salt://ntp/files/Debian/etc/ntp.conf.jinja
- salt://ntp/files/default/etc/ntp.conf_alt.jinja
- salt://ntp/files/default/etc/ntp.conf.jinja
Note: This does not override the default value. Rather, the value from the pillar/config is prepended to the default.
Using sub-directories for components
¶
If your formula is composed of several components, you may prefer to provides files under sub-directories, like in the systemd-formula.
/srv/saltstack/systemd-formula/
systemd/
init.sls
libtofs.jinja
map.jinja
networkd/
init.sls
files/
default/
network/
99-default.link
resolved/
init.sls
files/
default/
resolved.conf
timesyncd/
init.sls
files/
Arch/
resolved.conf
Debian/
resolved.conf
default/
resolved.conf
Ubuntu/
resolved.conf
For example, the following formula.component.config
SLS:
{%- from "formula/libtofs.jinja" import files_switch with context %}
formula configuration file:
file.managed:
- name: /etc/formula.conf
- user: root
- group: root
- mode: 644
- template: jinja
- source: {{ files_switch(['formula.conf'],
lookup='formula',
use_subpath=True
)
}}
will be rendered on a Debian
minion named salt-formula.ci.local
as:
formula configuration file:
file.managed:
- name: /etc/formula.conf
- user: root
- group: root
- mode: 644
- template: jinja
- source:
- salt://formula/component/files/salt-formula.ci.local/formula.conf
- salt://formula/component/files/Debian/formula.conf
- salt://formula/component/files/default/formula.conf
- salt://formula/files/salt-formula.ci.local/formula.conf
- salt://formula/files/Debian/formula.conf
- salt://formula/files/default/formula.conf
Authors¶
This list is sorted by the number of commits per contributor in descending order.
Avatar | Contributor | Contributions |
---|---|---|
@myii | 319 | |
@baby-gnu | 37 | |
@dafyddj | 32 | |
@aboe76 | 27 | |
@javierbertoli | 18 | |
@noelmcloughlin | 15 | |
@n-rodriguez | 8 | |
@daks | 8 | |
@gravyboat | 6 | |
@alxwr | 5 | |
@evvers | 4 | |
@nmadhok | 3 | |
@vutny | 2 | |
@k-hamza | 2 | |
@puneetk | 2 | |
@andygabby | 1 | |
@Jokipii | 1 | |
@johnkeates | 1 | |
@duk3luk3 | 1 | |
@marco-m | 1 | |
@whiteinge | 1 | |
@sroegner | 1 | |
@babilen5 | 1 | |
@GMAzrael | 1 |
Auto-generated by a forked version of gaocegege/maintainer on 2021-04-14.
Changelog¶
5.0.0 (2021-03-09)¶
BREAKING CHANGES¶
- map:
map.jinja
now exports a genericmapdata
variable - map: The per grain parameter values are now under
TEMPLATE/parameters/
4.0.1 (2019-12-17)¶
Bug Fixes¶
- convert-formula.sh: apply remaining suggestions from #180 (76ecd44), closes /github.com/saltstack-formulas/template-formula/pull/180#discussion_r357308821 /github.com/saltstack-formulas/template-formula/pull/180#discussion_r357318860 /github.com/saltstack-formulas/template-formula/pull/180#discussion_r357362707
3.3.4 (2019-11-27)¶
Continuous Integration¶
- kitchen: use
debian-10-master-py3
instead ofdevelop
[skip ci] (14ebf92) - kitchen: use
develop
image untilmaster
is ready (amazonlinux
) [skip ci] (42482d7) - kitchen+travis: upgrade matrix after
2019.2.2
release [skip ci] (d0e07b8) - travis: apply changes from build config validation [skip ci] (b625245)
- travis: opt-in to
dpl v2
to complete build config validation [skip ci] (f1fbf7f) - travis: run
shellcheck
during lint job (a711665) - travis: update
salt-lint
config forv0.0.10
[skip ci] (faea464) - travis: use build config validation (beta) [skip ci] (66494bb)
3.3.3 (2019-10-16)¶
Documentation¶
- contributing: add recent
semantic-release
formulas [skip ci] (` <https://github.com/saltstack-formulas/template-formula/commit/e6fb519>`_) - contributing: remove to use org-level file instead [skip ci] (` <https://github.com/saltstack-formulas/template-formula/commit/d2ebccf>`_)
- readme: update link to
CONTRIBUTING
[skip ci] (` <https://github.com/saltstack-formulas/template-formula/commit/ed61d09>`_) - reamde: have special notes section (` <https://github.com/saltstack-formulas/template-formula/commit/c68aed5>`_)
3.3.2 (2019-10-08)¶
Bug Fixes¶
Continuous Integration¶
- kitchen: install required packages to bootstrapped
opensuse
[skip ci] (1cfed60) - kitchen: use bootstrapped
opensuse
images until2019.2.2
[skip ci] (0467bdf) - travis: quote
${INSTANCE}
when runningkitchen verify
(00d56a4), closes /github.com/saltstack-formulas/template-formula/pull/175#discussion_r332525964 - travis: run
rubocop
during theLint
job (8d8c766) - travis: run
salt-lint
during theLint
job (2df4646), closes /freenode.logbot.info/saltstack-formulas/20191004#c2723464 /freenode.logbot.info/saltstack-formulas/20191004#c2724272 - travis: use
env
andname
for improved display in Travis (5f773d1), closes /github.com/saltstack-formulas/template-formula/pull/175#discussion_r332613933
Documentation¶
- bug_report: add section requesting commit hash / release tag (faccb6a)
- bug_report: group into sections for better logical ordering (e9b6c2f)
- contributing: add recent
semantic-release
formula (c2924b0) - contributing: add recent
semantic-release
formula (8d2318c) - contributing: add recent
semantic-release
formula [skip ci] (85118de) - issues: provide
Bug report
&Feature request
templates (f90f1f6) - issues: use
Meta
instead ofOptional
as suggested (65cadb4), closes /github.com/saltstack-formulas/template-formula/pull/174#issuecomment-538999459 - issues: use larger headings (from level 4 to level 3) (53e7b75)
- pillar.example: fix TOFS comment to explain the default path [skip ci] (fde5063), closes /github.com/saltstack-formulas/libvirt-formula/pull/60#issuecomment-537965254 /github.com/saltstack-formulas/libvirt-formula/pull/60#issuecomment-537988138
- pillar.example: improve TOFS comment to explain the default path [skip ci] (27d2fe4), closes /github.com/saltstack-formulas/nginx-formula/blob/17291a0ae2c2554707b79d897bb6ddec716e8426/pillar.example#L340-L341
3.1.1 (2019-07-25)¶
Bug Fixes¶
- tofs: prepend the config-based
source_files
to the default (3483e76), closes /github.com/saltstack-formulas/nginx-formula/pull/247#issuecomment-514262549 #151
Documentation¶
- tofs: ensure merged will all recent changes (6a614d9)
- tofs: update from
nginx-formula
(23a221e), closes /github.com/saltstack-formulas/nginx-formula/pull/238#discussion_r289124365
3.0.0 (2019-06-13)¶
BREAKING CHANGES¶
- pkgname: the parameter
pkg
is now a dictionary. References totemplate.pkg
should be changed totemplate.pkg.name
.
2.0.0 (2019-03-24)¶
BREAKING CHANGES¶
- tofs: every formula writer will need to change the import to use this new version.
- template/libtofs.jinja: provides the “files_switch” macro.
- docs/TOFS_pattern.rst: update documentation to use the new path.
- template/config/clean.sls: change import from “macros.jinja” to “libtofs.jinja”.
- template/config/file.sls: ditoo.
1.2.6 (2019-03-24)¶
Reverts¶
- kitchen+travis: use
debian:jessie-backports
asdebian-8
(dcd141a), closes /github.com/saltstack/salt-pack/issues/657#issuecomment-474954298
1.2.2 (2019-03-09)¶
Bug Fixes¶
- tofs: update use of state ID in
config
andpillar
(3d9a24c) - tofs: use
source_files
instead offiles
(5110716), closes /freenode.logbot.info/saltstack-formulas/20190308#c2046753
1.2.1 (2019-03-07)¶
Code Refactoring¶
- kitchen:
pillars-from-files
=>pillars_from_files
(7c954a7), closes /github.com/saltstack-formulas/packages-formula/pull/50#discussion_r262769817
1.0.1 (2019-03-01)¶
Documentation¶
- contributing: convert to
.rst
and move todocs
subdir (474f318) - index: add
CONTRIBUTING
to thetoctree
(0c98e67) - readme: move under
docs
subdir to access in both GitHub and RTD (c92f674) - readme: update heading markers for consistency (5a2bea8)
- rtd: add basic
index.rst
to allow RTD to produce docs (f02139f) - rtd: use internal link targets at the top of each
.rst
file (da09528)
1.0.0 (2019-02-28)¶
Code Refactoring¶
- components: split components into separate subdirs (d957055), closes /github.com/saltstack-formulas/template-formula/pull/48#pullrequestreview-207182085 /github.com/saltstack-formulas/template-formula/pull/48#discussion_r259805312
- include+require: use variable for duplicate values (4443518)
- pkg: change to
package
instead (2cd82e5), closes /github.com/saltstack-formulas/template-formula/pull/48#discussion_r259951123 - pkg: move
pkg
related components into separate directory (c21f82b) - states: set state IDs based on a dependable structure (6690ee6), closes /github.com/saltstack-formulas/template-formula/pull/48#discussion_r259953473 /github.com/saltstack-formulas/template-formula/pull/48#discussion_r259956996
- topdir: use for
include
andrequire
exceptinit.sls
(a218e91) - tpldir: use
topdir
globally in place oftpldir
(2838bc9) - tplroot: use
tplroot
instead oftopdir
to matchtpldata
(b7356b0)
Continuous Integration¶
- kitchen: specify
image
explicitly for each platform (b25fbdc) - kitchen+travis: use
debian:jessie-backports
asdebian-8
(1b9d249), closes #50 /github.com/saltstack/salt-pack/issues/657#issuecomment-467932962
Documentation¶
Features¶
- pkg: add
clean
states (422c7ac) - pkg: use
require
requisite betweenpkg
states (6e7141b), closes /github.com/saltstack/salt/blob/0c78d7dc894058988d171a28a11bd4a9dbf60266/salt/utils/jinja.py#L120 /github.com/saltstack/salt/blob/0c78d7dc894058988d171a28a11bd4a9dbf60266/salt/utils/templates.py#L145 /github.com/saltstack/salt/issues/10838#issuecomment-391718086
BREAKING CHANGES¶
- states: Wholesale state ID changes will break implementations that are relying on the previous state IDs for requisite purposes.
- pkg: Changing the
pkg
directory topackage
will break implementations that are depending onpkg
forinclude
orsls
-based requisite purposes.
0.7.5 (2019-02-27)¶
Bug Fixes¶
Documentation¶
- tofs: add more sub-headings to ease document navigation (2c5dc21)
- tofs: apply language formatting to source code blocks (0638413)
- tofs: explain how all parts of the
source
can be customised (2f82eb5), closes #44 - tofs: improve general use of language (5105d29)
- tofs: update the
files_switch
section for the updated macro (788f732) - tofs: use
{%-
for all Jinja statements (4348df8)
0.7.2 (2019-02-24)¶
Continuous Integration¶
- kitchen: improve comments about
opensuse
problems encountered (c246939) - travis: prevent
release
stage running for PRs (3a072c7), closes /travis-ci.com/saltstack-formulas/template-formula/jobs/180068519#L466 /github.com/saltstack-formulas/template-formula/pull/42#issuecomment-466446324
0.1.7 (2019-02-16)¶
Fix¶
- Typo in the installation instructions. [Niels Abspoel]
Other¶
- Update the changelog. [Niels Abspoel]
- Update README with link to install gitchangelog [Imran Iqbal]
0.1.3 (2019-02-12)¶
Updated changelog and version. [Alexander Weidinger]
Map.jinja: use grains.filter_by instead of defaults.merge. [Alexander Weidinger]
because defaults.merge does not work with salt-ssh. https://github.com/saltstack/salt/issues/51605
Added osfingermap.yaml.
0.1.2 (2019-02-12)¶
- Improve comments and examples in osfamilymap & osmap [Imran Iqbal]
- Fix map.jinja and add more OSes. [Imran Iqbal]
0.1.1 (2019-02-10)¶
- Update. [Niels Abspoel]
- Update formula with map.jinja and style guide references, improve README and VERSION. [Niels Abspoel]
0.1.0 (2019-02-10)¶
Examples must be consistent. [Daniel Dehennin]
The “template” is kept during rendering.
- TOFS_pattern.md: add “template” to rendered state.
- template/macros.jinja: ditoo.
Remove double slash in generated salt URL. [Daniel Dehennin]
When the files are “full path” with leading slash “/”, the generated URL contain a double slash because of the join.
- template/macros.jinja: remove leading slash before joining parts.
- TOFS_pattern.md: mirror changes of “macros.jinja”.
Add an example for “ntp” of the use of “files_switch” [Daniel Dehennin]
Accept pillar separator in “files_switch” prefix. [Daniel Dehennin]
The prefix was used for 2 purposes:
define the pillar prefix where to lookup “:files_switch”. It supports the colon “:” separator to lookup in pillar subtree like “foo:bar”
define the path prefix where to look for “files/”, It did not support separator to lookup inside directory tree.
This patch only replace any colon “:” with “/” when looking up “files/” directory, with the “foo:bar” prefix:
lookup “foo:bar:files_switch” pillar to get list of grains to match
lookup files under “salt://foo/bar/files/”
TOFS_pattern.md: document the new use of “prefix” supporting colon “:”.
template/macros.jinja: transform any colon “:” in “prefix” by slash “/” to lookup files.
Make TOFS pattern example usable. [Daniel Dehennin]
The example could not be used as-is. This commit improve conformity to formula conventions.
- TOFS_pattern.md: add missing commas “,” in “map.jinja” and extra one to ease the addition of new entries. Import “map.jinja” in “init.sls” and “conf.sls”. Declare descriptive state IDs. Use the “module.function” notation. Use the “name” parameter.
Cosmetics modification of TOFS pattern documentation. [Daniel Dehennin]
- TOFS_pattern.md: add myself as modifier. Trim trailing whitespaces. Separate titles from first paragraph.
Switch template.config to TOFS pattern. [Daniel Dehennin]
Import TOFS pattern from Zabbix formula. [Daniel Dehennin]
0.0.9 (2019-02-10)¶
- Add VERSION file. [Karim Hamza]
- Add note about formula versioning. [Karim Hamza]
0.0.8 (2019-02-10)¶
- Align with SaltStack official formulas doc page. [Denys Havrysh]
- Use https in the link to SaltStack documentation. [Denys Havrysh]
0.0.7 (2019-02-10)¶
- Map.ninja: fix typos and leftover comments. [Marco Molteni]
- Remove whitespace in map.jinja comment. [Andrew Gabbitas]
0.0.6 (2019-02-10)¶
- Improve style and jinja too match salt-formula. [Niels Abspoel]
- Propose new-ish formula style - defaults live in defaults.yml - map jinja overrides by grain + merges pillar:lookup - split all contextually similar states in their own files. [puneet kandhari]
0.0.5 (2019-02-10)¶
Change states to use short-dec style. [Seth House]
Update CHANGELOG.rst. [Nitin Madhok]
Update README.rst. [Nitin Madhok]
Fix broken link
Fixing pillar to match the map file. [Forrest]
Map file and pillar didn’t match.
0.0.3 (2019-02-10)¶
- Updated the license and readme to match our standards. [Forrest Alvarez]
- Use map.jinja content in init.sls. [Eugene Vereschagin]
- Add map.jinja. [Eugene Vereschagin]