Cookiecutter template for Salt formulas
Clone or download
Martin819 Remove echo from travis install step
Change-Id: I9a64e59a75802e4bd2ce8eedb6e5510e12604752
Latest commit a3f1505 Nov 7, 2018

README.rst

cookiecutter-salt-formula

A cookiecutter template for Salt Formula.

Installation

pip install cookiecutter

cd cookiecutter

cookiecutter salt-formula

Init Test Kitchen configuration

Follow the salt formula testing guidelines and automated CI in the main documentation.

To generate .kitchen.yml for new or existing project:

  • install envtpl, renders jinja2 templates with shell environment variables
  • install required gems, it depends on drivers configured to be used (docker by default)
pip install envtpl
gem install kitchen-docker kitchen-salt [kitchen-openstack kitchen-vagrant kitchen-inspec busser-serverspec]

Once you create your tests/pillar structure (required if you want to auto-populate kitchen yaml with test suites)

# cd <formula repository>
../kitchen-init.sh

Instantly, to add kitchen configuration into existing repository:

# cd <formula repository>
curl -skL "https://raw.githubusercontent.com/salt-formulas/cookiecutter-salt-formula/master/kitchen-init.sh" | bash -s --

Docker way

MY_NEW_SALT_FORMULA_DIR="watchdog"
mkdir $MY_NEW_SALT_FORMULA_DIR
git clone https://github.com/salt-formulas/cookiecutter-salt-formula.git
docker run --rm -it -u $(id -u):$(id -g) --env HOME=/$MY_NEW_SALT_FORMULA_DIR -v $PWD/$MY_NEW_SALT_FORMULA_DIR:/$MY_NEW_SALT_FORMULA_DIR -v $PWD/cookiecutter-salt-formula:/cookiecutter-salt-formula:ro cookiecutter/cookiecutter /cookiecutter-salt-formula --output-dir /$MY_NEW_SALT_FORMULA_DIR
service_name [some_service]: watchdog
role_name [server]:
initial_version [2018.1]:
copyright_year [2018]:
copyright_holder [Your Name et al.]: Mirantis, Inc.
author_name [John Doe]: Petr Ruzicka
author_contact [jdoe@domain.com]: pruzicka@mirantis.com
homepage [https://github.com/salt-formulas]:
debian_version [xenial]:
kitchen_driver [docker]:
kitchen_verifier [inspec]:
kitchen_formula [watchdog]:
kitchen_suites []: server