Welcome to template-formula’s documentation!

TEMPLATE-formula

Travis CI Build Status Semantic Release pre-commit

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:

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.

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 for ntp: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 @myii 319
@baby-gnu @baby-gnu 37
@dafyddj @dafyddj 32
@aboe76 @aboe76 27
@javierbertoli @javierbertoli 18
@noelmcloughlin @noelmcloughlin 15
@n-rodriguez @n-rodriguez 8
@daks @daks 8
@gravyboat @gravyboat 6
@alxwr @alxwr 5
@evvers @evvers 4
@nmadhok @nmadhok 3
@vutny @vutny 2
@k-hamza @k-hamza 2
@puneetk @puneetk 2
@andygabby @andygabby 1
@Jokipii @Jokipii 1
@johnkeates @johnkeates 1
@duk3luk3 @duk3luk3 1
@marco-m @marco-m 1
@whiteinge @whiteinge 1
@sroegner @sroegner 1
@babilen5 @babilen5 1
@GMAzrael @GMAzrael 1

Auto-generated by a forked version of gaocegege/maintainer on 2021-04-14.

Changelog

5.0.2 (2021-04-14)

Bug Fixes

  • convert-formula.sh: replace instances of template-formula for CI (537fe65), closes #231

Tests

  • standardise use of share suite & _mapdata state [skip ci] (bbe1c78)

5.0.1 (2021-03-09)

Bug Fixes

  • convert-formula: _mapdata control name must use the formula one (1f3600d)

5.0.0 (2021-03-09)

Bug Fixes

  • inspec: validate map.jinja configuration (41d222e)

Continuous Integration

  • kitchen+ci: use latest pre-salted images (after CVE) [skip ci] (6453145)

Features

  • map: update to v5 map.jinja (42e1932)

BREAKING CHANGES

  • map: map.jinja now exports a generic mapdata variable
  • map: The per grain parameter values are now under TEMPLATE/parameters/

4.3.8 (2021-02-21)

Continuous Integration

  • gemfile+lock: use ssf customised kitchen-docker repo [skip ci] (23c2bb2)
  • kitchen+gitlab-ci: use latest pre-salted images [skip ci] (00823a2)

Tests

  • _mapdata: add verification files for Fedora 33 & Tumbleweed (3347b85)

4.3.7 (2021-02-11)

Continuous Integration

  • pre-commit: update hook for rubocop [skip ci] (978a7e7)

Styles

  • inspec: match current practices for file and control names (aa8a58b)

Tests

  • share: standardise with latest changes [skip ci] (dab2f34)

4.3.6 (2021-01-14)

Bug Fixes

  • _mapdata: ensure map data is directly under values (bcb8e29)

Tests

  • _mapdata: update for _mapdata/init.sls change (50162ad)

4.3.5 (2020-12-23)

Code Refactoring

  • map: use top-level values: key in map.jinja dumps (f8e8fcb)

4.3.4 (2020-12-22)

Continuous Integration

  • commitlint: ensure upstream/master uses main repo URL [skip ci] (e476d5a)
  • gitlab-ci: add rubocop linter (with allow_failure) [skip ci] (4c300d0)

Tests

  • _mapdata: fix existing verification files (6bbafed)
  • map: standardise map.jinja verification (4c8cf32)

4.3.3 (2020-12-16)

Bug Fixes

  • codeowners: ensure lib* files are owned by ssf (d60cc15)

Continuous Integration

  • gitlab-ci: use GitLab CI as Travis CI replacement (0403f62)

4.3.2 (2020-10-31)

Bug Fixes

  • convert-formula.sh: add -_ to allowed chars in formula name (a999fee)
  • convert-formula.sh: delete all existing tags (7c33601), closes #210

4.3.1 (2020-10-28)

Tests

  • inspec: system.rb must call parent class initialisation (1ff9ab1)

4.3.0 (2020-10-12)

Continuous Integration

  • pre-commit: finalise rstcheck configuration [skip ci] (e78aa0c)

Features

4.2.2 (2020-10-06)

Bug Fixes

  • commitlint: fix header length at 72 chars as agreed (a95061d)

Continuous Integration

  • pre-commit: add to formula [skip ci] (fd89d62)
  • pre-commit: enable/disable rstcheck as relevant [skip ci] (219e6b7)

4.2.1 (2020-09-21)

Continuous Integration

  • kitchen+travis: use tiamat pre-salted images (3a63304)

Tests

  • oracle: add InSpec configuration for oraclelinux (c4b66d8)
  • share: remove unnecessary hostname mangling (194aa97)

4.2.0 (2020-09-04)

Continuous Integration

  • kitchen: execute _madata state (31e1096)
  • kitchen+travis: fix centos6 suite and rename to upstart (97309c6)

Features

  • map: generate a YAML file to validate map.jinja (fc90075)

Tests

  • inspec: share library to access some minion informations (64c2b6c)
  • inspec: verify map.jinja dump (3dc28bf)
  • platform_finger: extract from shared library (d68ed45)

4.1.1 (2020-07-28)

Continuous Integration

  • kitchen: use saltimages Docker Hub where available [skip ci] (eab21c3)
  • kitchen+travis: add new platforms [skip ci] (111a20b)
  • kitchen+travis: adjust matrix to add 3000.3 [skip ci] (19ae826)
  • travis: add notifications => zulip [skip ci] (ac93ad8)
  • travis: run linters using pre-commit (6da26cc)

Documentation

  • add basic pre-commit usage instructions (c78c068)
  • fix whitespace (d98d98f)

Styles

  • libtofs.jinja: use Black-inspired Jinja formatting [skip ci] (55bc69a)

4.1.0 (2020-05-12)

Continuous Integration

  • kitchen+travis: adjust matrix to add 3000.2 & remove 2018.3 [skip ci] (efd8797)
  • kitchen+travis: remove master-py2-arch-base-latest [skip ci] (d693f9d)
  • workflows/commitlint: add to repo [skip ci] (574d18f)

Features

  • convert-formula.sh: assign @NONE as whole-formula owner (cceffff)

4.0.9 (2020-04-25)

Continuous Integration

  • gemfile.lock: add to repo with updated Gemfile [skip ci] (d798928)

Documentation

  • readme: show only one level in table of contents (446b815)

4.0.8 (2020-04-19)

Bug Fixes

  • libsaltcli: update salt-ssh detection for enable_ssh_minions (f0e7192)

4.0.7 (2020-04-15)

Bug Fixes

  • convert-formula.sh: use portable sed function to make replacements (41e10b5), closes #192

Continuous Integration

  • travis: add quick check that convert-formula.sh has worked (8312063)

4.0.6 (2020-04-07)

Bug Fixes

  • running.sls: use watch not require to ensure service restart (3a1fc35)

Code Refactoring

  • libsaltcli: use the opts dict throughout [skip ci] (69b632f)

Continuous Integration

  • kitchen+travis: adjust matrix to add 3000 & remove 2017.7 [skip ci] (f81c372)
  • kitchen+travis: adjust matrix to update 3000 to 3000.1 [skip ci] (f48a727)

4.0.5 (2020-03-23)

Bug Fixes

  • libtofs: “files_switch” mess up the variable exported by “map.jinja” [skip ci] (241646f)

Code Refactoring

  • service: use systemd-journald instead of systemd-udevd (a265105)

4.0.4 (2020-02-14)

Bug Fixes

  • libtofs: “files_switch” mess up the variable defined by “map.jinja” (ab4ce75)

Continuous Integration

  • kitchen: avoid using bootstrap for master instances (6ecdb99)

4.0.3 (2020-01-27)

Bug Fixes

  • fix CentOS Linux-7 and add os details from current CI setup (4be16ca)
  • travis: reinstate conversion test [skip ci] (5d47fda)

Continuous Integration

  • travis: use major.minor for semantic-release version [skip ci] (e9bfb71)

4.0.2 (2019-12-19)

Bug Fixes

  • convert-formula.sh: remove “Using this template” post-conversion (55ab937)
  • convert-formula.sh: remove rubocop override post-conversion (aca4e44)
  • convert-formula.sh: remove CI test post-conversion (06ec949)
  • convert-formula.sh: reset version to 1.0.0 (39889ce)

Documentation

  • convert-formula.sh: add usage guide (539a335)

4.0.0 (2019-12-16)

Code Refactoring

  • improve reusability using an unique keyword TEMPLATE (2e8ded6)

Continuous Integration

  • gemfile: restrict train gem version until upstream fix [skip ci] (1b6164f)
  • travis: quote pathspecs used with git ls-files [skip ci] (341f495)

Features

  • add script to ease conversion from template to real formula (edfa269)

Tests

  • add CI test of conversion script (7ad85ae)

BREAKING CHANGES

  • changed all state names and ids

3.3.4 (2019-11-27)

Bug Fixes

  • release.config.js: use full commit hash in commit link [skip ci] (4ac8d92)

Continuous Integration

  • kitchen: use debian-10-master-py3 instead of develop [skip ci] (14ebf92)
  • kitchen: use develop image until master 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 for v0.0.10 [skip ci] (faea464)
  • travis: use build config validation (beta) [skip ci] (66494bb)

Performance Improvements

  • travis: improve salt-lint invocation [skip ci] (7a96cd7)

3.3.3 (2019-10-16)

Documentation

3.3.2 (2019-10-08)

Bug Fixes

  • rubocop: add fixes using rubocop --safe-auto-correct (484ce24)
  • rubocop: fix remaining errors manually (9566b6f)

Code Refactoring

  • travis: merge lint stage into the test stage (d3b93f8)

Continuous Integration

Documentation

3.3.1 (2019-09-23)

Bug Fixes

  • subcomponent: clean referencing wrong sls (394808e)

Continuous Integration

  • use dist: bionic & apply opensuse-leap-15 SCP error workaround (330b0cb)
  • kitchen: change log_level to debug instead of info (1b929ff)
  • platform: add arch-base-latest (042e8e2)
  • yamllint: add rule empty-values & use new yaml-files setting (70ed7e2), closes #164

Documentation

  • contributing: add recent semantic-release formulas (7f36ae9)

3.3.0 (2019-08-27)

Bug Fixes

  • libtofs: avoid using subpath by default (c07471d)

Code Refactoring

  • libtofs: remove deprecated v1_path_prefix argument (ad2a965)

Features

  • yamllint: include for this repo and apply rules throughout (e76525f)

3.2.1 (2019-08-06)

Code Refactoring

  • tofs: move subcomponent definition to defaults.yaml (c269673)
  • tofs: move subcomponent templates to first source match (70cc92d)

Continuous Integration

  • kitchen+travis: replace EOL pre-salted images (42ab22c)

3.2.0 (2019-08-03)

Bug Fixes

  • formula: update to current oldest supported version of Salt (878eca1)

Documentation

  • libtofs: explain usage of sub-directory for components (42a75d9)
  • readme: describe the new “template.subcomponent” states (6b595cd)

Features

  • sub-component: manage a dedicated configuration file (c4440d7)
  • tofs: lookup files directory in “tpldir” hierarchy (5c495fb)

Tests

  • inspec: verify subcomponent configuration file (fd55e03)

3.1.1 (2019-07-25)

Bug Fixes

Documentation

3.1.0 (2019-07-24)

Bug Fixes

Documentation

  • map: update comments in os*.yaml after adding osarchmap (d71a258)

Features

  • mapping: introduce osarchmap per issue #13 (41ac40d)

Tests

  • osarch: add unit test for osarch (1be2052)

3.0.9 (2019-07-24)

Bug Fixes

  • libtofs: don’t crash if “tofs.files_switch” lookup a list (0979d35)

Documentation

  • contributing: add recent semantic-release formula (f9def86)
  • contributing: add recent semantic-release formula (ed8c55a)
  • contributing: add recent semantic-release formulas (57d0b85)

Tests

  • libtofs: “tofs.files_switch” lookup can return a list (13f1728)

3.0.8 (2019-07-08)

Documentation

  • contributing: add template-formula to semantic-release formulas (87e4ebc)

3.0.7 (2019-07-04)

Documentation

  • contributing: add recent semantic-release formula (c679cb5)

3.0.6 (2019-06-28)

Code Refactoring

  • string: remove capitalisation from ‘template’ string (7062210)

3.0.5 (2019-06-28)

Documentation

  • contributing: add recent semantic-release formula (fc50a9e)

3.0.4 (2019-06-27)

Documentation

  • contributing: add recent semantic-release formulas (22052fc)

3.0.3 (2019-06-25)

Documentation

  • contributing: add recent semantic-release formula (7f56237)

3.0.2 (2019-06-20)

Documentation

  • contributing: add recent semantic-release formulas (461c7a5)

3.0.1 (2019-06-16)

Tests

  • inspec: readme for default profile & os-name depreciated (3fa7bce)

3.0.0 (2019-06-13)

Code Refactoring

  • pkgname: reserve ‘pkg’ as packaging dict (c6ae81c)

Continuous Integration

  • kitchen+travis: modify matrix to include develop platform (7b5d4ff)

BREAKING CHANGES

  • pkgname: the parameter pkg is now a dictionary. References to template.pkg should be changed to template.pkg.name.

2.2.1 (2019-05-31)

Code Refactoring

  • ``osfamilymap``: avoid *BSD ambiguity with MacOS rootgroup (3338605)

2.2.0 (2019-05-31)

Features

  • macos: basic package and group handling (8c3fe22)

2.1.18 (2019-05-29)

Bug Fixes

  • ``libtofs``: use select to deal with empty strings in path (afe0751)
  • ``libtofs``: use strip to deal with leading/trailing slashes (2563a46)

2.1.17 (2019-05-27)

Continuous Integration

  • kitchen: add Bundler binstub for Kitchen (7bb7c53)

Documentation

2.1.16 (2019-05-27)

Documentation

  • contributing: add ufw formula to semantic release formulas (18ff689)

2.1.15 (2019-05-25)

Tests

  • ``services_spec``: remove temporary suse conditional (00d4a77)

2.1.14 (2019-05-25)

Bug Fixes

  • ``config/file``: add missing space before Jinja }} (5cd08ab)

2.1.13 (2019-05-24)

Documentation

  • readme: add testing requirements section (from vault-formula) (e04413e)

2.1.12 (2019-05-24)

Continuous Integration

  • travis: improve recommended matrix usage comment (b08a0fd)
  • travis: reduce matrix down to 6 instances (ref: #118) (a8834e2)

Documentation

  • contributing: add bind-formula to semantic-release formulas (3da78b0)

2.1.11 (2019-05-18)

Documentation

  • contributing: add recent semantic-release formula (486b393)

2.1.10 (2019-05-16)

Documentation

  • contributing: fix link to contributing docs (b6a33d3)

2.1.9 (2019-05-16)

Documentation

  • move contributing sections and links to ease adaptation (741896d)

2.1.8 (2019-05-16)

Documentation

  • contributing: add recent semantic-release formulas (#110) (ab7afd4)

2.1.7 (2019-05-15)

Styles

  • indent: fix indentation (34d1307)

2.1.6 (2019-05-15)

Bug Fixes

  • ``map.jinja``: merge defaults and config.get (91bc2f0)

2.1.5 (2019-05-15)

Bug Fixes

  • ``map.jinja``: use tplroot (b9c5e03)

2.1.4 (2019-05-15)

Bug Fixes

  • ``map.jinja``: remove merge from config.get (for salt-ssh) (00e474c), closes #95

2.1.3 (2019-05-13)

Bug Fixes

  • travis: don’t install gems twice (925d8e2)

Documentation

  • readme: add testing section based on postgres-formula (c309d5f)

2.1.2 (2019-05-13)

Bug Fixes

  • gitignore: add Gemfile.lock to .gitignore (87fa410)

2.1.1 (2019-05-13)

Documentation

  • semantic-release: add list of semantic-release compatible formulas (97b19b9)

2.1.0 (2019-05-12)

Features

  • centos-6: reshape formula and tests for this platform (a4b1608), closes #104

2.0.6 (2019-05-02)

Continuous Integration

  • kitchen+travis: use latest pre-salted images (91ef13b)

Tests

  • inspec: disable service-based tests for opensuse-leap-15 (848c2ad)

2.0.5 (2019-04-30)

Documentation

  • tofs: remove whitespace from blank line (0881b7d)

2.0.4 (2019-04-27)

Code Refactoring

  • map: use config.get instead of pillar.get (5dc0b86)

Continuous Integration

  • gemfile: update kitchen-salt version (ad31c32)

2.0.3 (2019-04-24)

Bug Fixes

  • comments: explain that at least an empty dict is required (426f955), closes #93

Continuous Integration

  • kitchen: use pre-salted images instead (2855ed6)

2.0.2 (2019-04-22)

Code Refactoring

  • config_clean: remove unused import from libtofs.jinja (b7cb585)

Continuous Integration

  • kitchen+travis: implement new distro-python-salt_version matrix (bd4792d)

2.0.1 (2019-03-25)

Code Refactoring

  • tofs: ensure (v2 > v1 > default) checking for src_files (3e62d7b)
  • tofs: make files_switch macro fully portable (a98b777)
  • tofs: use config rather than pillar throughout (5730e94)

2.0.0 (2019-03-24)

Code Refactoring

  • tofs: move “files_switch” macro to “libtofs.jinja” (da7e692)

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

1.2.5 (2019-03-23)

Bug Fixes

  • travis: use version numbers in Gemfile to prevent failed builds (35f7111)

1.2.4 (2019-03-22)

Code Refactoring

  • tofs: avoid using “salt[‘config.get’]” for formula writers (60d43e7)

1.2.3 (2019-03-13)

Documentation

  • tofs: incorrect path for “source_files” lookup key (a76f659)

1.2.2 (2019-03-09)

Bug Fixes

1.2.1 (2019-03-07)

Code Refactoring

Styles

  • map: use - for each Jinja block (64e3834)

1.2.0 (2019-03-03)

Features

  • m2r: use m2r to convert automatic .md files to .rst (b86ddf4)

1.1.2 (2019-03-03)

Documentation

  • contributing: add documentation contribution guidelines (dff0ee8)
  • rtd: add comment to CSS file for overriding in-use Sphinx theme (f237364)
  • rtd: clean up numerous issues and inconsistencies (ad5a8b8)
  • tofs: use literalinclude of macros.jinja instead of code dupe (3f0071b)

1.1.1 (2019-03-01)

Continuous Integration

  • travis: remove obsolete markdown-toc process (97fbb60)

Documentation

  • contributing: add TOC to match all other pages (7b1a2a9)
  • readme: add Read the Docs build status badge (f47797d)
  • tofs: replace existing .md with .rst and add to RTD (fd68168)
  • tofs: use table to list authorship (2f0e20f)

1.1.0 (2019-03-01)

Documentation

  • rtd: add basic docs/conf.py to allow additional customisation (18d3924)

Features

  • rtd: provide custom CSS file for overriding in-use Sphinx theme (24bd338)

1.0.1 (2019-03-01)

Continuous Integration

  • travis: remove unavailable files from markdown-toc process (3148f0d)

Documentation

  • contributing: convert to .rst and move to docs subdir (474f318)
  • index: add CONTRIBUTING to the toctree (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

Continuous Integration

Documentation

  • components: update for separation of pkg, config & service (726fcab)
  • readme: add suggested improvement to template.service.clean (bf1039c)
  • readme: fix typos (007159a)

Reverts

  • kitchen+travis: disable debian-8 due to 2019.2 bug (e8f0f7e)

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 to package will break implementations that are depending on pkg for include or sls-based requisite purposes.

0.7.6 (2019-02-27)

Documentation

  • yaml: os*.yaml map files needs at least an empty dict (dd99750)

0.7.5 (2019-02-27)

Bug Fixes

  • pillar: fix os_family typo (3f89c12)
  • tofs: update comments in files_switch macro for new method (3fa3640)

Code Refactoring

  • macros: use tplroot instead of topdir to match tpldata (923b459)

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.4 (2019-02-27)

Continuous Integration

  • kitchen: check for repos updates before trying package installation (b632383)
  • kitchen+travis: disable debian-8 due to 2019.2 installation bug (178c710)

Documentation

  • contributing: separate BREAKING CHANGE under its own heading (ee053d7)

0.7.3 (2019-02-25)

Bug Fixes

  • tofs: use tpldir derivative topdir for pillar (config) paths (5e9df00)

0.7.2 (2019-02-24)

Code Refactoring

  • tpldir: use tpldir or derivatives to make formula portable (52d03d8), closes #22

Continuous Integration

0.7.1 (2019-02-24)

Continuous Integration

  • kitchen: use salt-minion version of opensuse to ensure tests run (99b073a)

Documentation

  • changelog: remove erroneous “closes” used by semantic-release (be4571d)

0.7.0 (2019-02-23)

Features

  • tofs: implement backwards-compatible TOFSv2 for configurability (068a94d)

0.6.0 (2019-02-23)

Documentation

  • contributing: add basic introductory text before the TOC (45ccaf6)
  • contributing: modify quoted heading to prevent TOC inclusion (abcb6ef)
  • readme: convert note into a heading (5f2d789)

Features

  • toc: use markdown-toc directly to update inline (a5bae1e)

0.5.0 (2019-02-23)

Features

  • kitchen+travis: add opensuse-leap after resolving issues (7614a3c)
  • kitchen+travis: conduct tests on a wider range of platforms (1348078)

Tests

  • inspec: update supports for all platforms added (42f93b3)

0.4.0 (2019-02-23)

Documentation

  • contributing: centre-align version bump columns in table (a238cae)

Features

  • authors: update automatically alongside semantic-release (8000098)

0.3.6 (2019-02-22)

Continuous Integration

  • travis: include commitlint stage (6659a69)
  • travis: remove obsolete check based on $TRAVIS_TEST_RESULT (6df9c95)

Documentation

  • contributing: update with sub-headings and commitlint details (ea2c9a4)

0.3.5 (2019-02-21)

Code Refactoring

  • kitchen: prefer kitchen.yml to .kitchen.yml (3860bf9)

0.3.4 (2019-02-21)

Documentation

  • contributing: add commit message formatting instructions (fb3d173)

0.3.3 (2019-02-20)

Documentation

  • changelog: add missing entry under v0.3.2 (50352b5)

0.3.2 (2019-02-20)

Documentation

  • README: remove gitchangelog (2fc85fc)
  • contributing: create blank template (3633e8f)

0.3.1 (2019-02-20)

Documentation

  • changelog: merge previous rst into new md format (2b4e485)

0.3.0 (2019-02-20)

Features

  • semantic-release: configure for this formula (cbcfd75)

0.2.0 (2019-02-17)

  • Added a working testing scaffold and travis support. [Javier Bértoli]

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.6 (2019-02-16)

  • Add changelog generator. [Niels Abspoel]

0.1.5 (2019-02-15)

  • Prepare v0.1.5 [Imran Iqbal]
  • Fix missing ‘)’ [gmazrael]

0.1.4 (2019-02-15)

  • Replace obsolete VERSION file and replace with FORMULA file. [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.4 (2019-02-10)

  • Add change log. [Antti Jokipii]

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]

0.0.2 (2019-02-10)

  • Add link to Salt Formula documentation. [Eugene Vereschagin]
  • Change extension from .md to .rst. [Eugene Vereschagin]

0.0.1 (2019-02-10)

  • Initial commit. [Lukas Erlacher]