Petr Michalec | 3ae395b | 2017-09-07 20:15:15 +0200 | [diff] [blame] | 1 | --- |
| 2 | driver: |
| 3 | name: docker |
| 4 | use_sudo: false |
| 5 | volume: |
| 6 | - <%= ENV['PWD'] %>:/tmp/kitchen |
| 7 | |
| 8 | provisioner: |
| 9 | name: shell |
Petr Michalec | 8abadb1 | 2018-03-16 15:12:44 +0100 | [diff] [blame] | 10 | script: .kitchen-verify.sh |
| 11 | |
| 12 | verifier: |
| 13 | name: inspec |
| 14 | |
| 15 | # Use: find classes/cluster/$cluster -name '*.env' | xargs -n1 source |
| 16 | # TODO, Load and set ENV from **/*.env |
| 17 | <%- saltver = ENV['SALT_VERSION'] || '2017.7' %> |
| 18 | <%- btstrap = ENV['SALT_BOOTSTRAP'] || '0' %> |
| 19 | <%- extrafo = ENV['EXTRA_FORMULAS'] || 'ntp' %> |
| 20 | <%- formula = ENV['FORMULA_VERSION'] || 'master' %> |
| 21 | <%- reclass = ENV['RECLASS_VERSION'] || 'develop' %> |
Petr Michalec | 3ae395b | 2017-09-07 20:15:15 +0200 | [diff] [blame] | 22 | |
| 23 | platforms: |
| 24 | <% `find classes/cluster -maxdepth 1 -mindepth 1 -type d | tr '_' '-' |sort -u`.split().each do |cluster| %> |
| 25 | <% cluster=cluster.split('/')[2] %> |
| 26 | - name: <%= cluster %> |
| 27 | driver_config: |
Petr Michalec | 8abadb1 | 2018-03-16 15:12:44 +0100 | [diff] [blame] | 28 | # image: epcim/salt:saltstack-ubuntu-xenial-salt-stable |
| 29 | # FIXME, USE ONCE RECLASS@DEVELOP IS IN MASTER, AND REQUIREDE FEATURES FROM FORMULA NIGHTLY REPO ARE IN STABLE |
| 30 | image: epcim/salt:saltmaster-reclass-ubuntu-xenial-salt-<%= saltver %>-formula-<%= formula %> |
Petr Michalec | 3ae395b | 2017-09-07 20:15:15 +0200 | [diff] [blame] | 31 | platform: ubuntu |
| 32 | hostname: cfg01.<%= cluster %>.local |
| 33 | provision_command: |
Petr Michalec | 8abadb1 | 2018-03-16 15:12:44 +0100 | [diff] [blame] | 34 | - test -e /srv/salt/bootstrap.sh || curl -qsSL https://raw.githubusercontent.com/salt-formulas/salt-formulas-scripts/develop/bootstrap.sh -o /srv/salt/bootstrap.sh |
| 35 | # Configure ENV options as needed, example: |
Petr Michalec | 3ae395b | 2017-09-07 20:15:15 +0200 | [diff] [blame] | 36 | - echo " |
Petr Michalec | 8abadb1 | 2018-03-16 15:12:44 +0100 | [diff] [blame] | 37 | export BOOTSTRAP=<%= btstrap %>;\n |
Petr Michalec | 3ae395b | 2017-09-07 20:15:15 +0200 | [diff] [blame] | 38 | export CLUSTER_NAME=<%= cluster %>;\n |
Petr Michalec | 8abadb1 | 2018-03-16 15:12:44 +0100 | [diff] [blame] | 39 | export EXTRA_FORMULAS='<%= extrafo %>';\n |
| 40 | export RECLASS_VERSION=<%= reclass %>;\n |
Petr Michalec | 3ae395b | 2017-09-07 20:15:15 +0200 | [diff] [blame] | 41 | export RECLASS_IGNORE_CLASS_NOTFOUND=True;\n |
Petr Michalec | cb924c1 | 2017-11-15 18:27:37 +0100 | [diff] [blame] | 42 | export RECLASS_IGNORE_CLASS_REGEXP='service.*';\n |
Petr Michalec | 3ae395b | 2017-09-07 20:15:15 +0200 | [diff] [blame] | 43 | " > /kitchen.env |
Petr Michalec | 8abadb1 | 2018-03-16 15:12:44 +0100 | [diff] [blame] | 44 | #export FORMULAS_SOURCE=pkg;\n |
Petr Michalec | 3ae395b | 2017-09-07 20:15:15 +0200 | [diff] [blame] | 45 | <% end %> |
| 46 | |
| 47 | suites: |
| 48 | - name: cluster |
| 49 | |