Skip to content

Commit

Permalink
Merge pull request #344 from myii/feat/improve-kitchen.yml-run_comman…
Browse files Browse the repository at this point in the history
…d-and-layout

feat(kitchen): move `provisioner` block & update `run_command`
  • Loading branch information
myii authored Jul 17, 2021
2 parents 4aa13c8 + 21da320 commit 2ef49bd
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 25 deletions.
4 changes: 2 additions & 2 deletions ssf/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ ssf_node_anchors:
# An alternative method could be to use:
# `git describe --abbrev=0 --tags`
# yamllint disable rule:line-length rule:quoted-strings
title: "chore(gemfile+lock): update to latest gem versions (2021-W28) [skip ci]"
body: '* Automated using https://github.com/myii/ssf-formula/pull/343'
title: "ci(kitchen): move '`'provisioner'`' block & update '`'run_command'`' [skip ci]"
body: '* Automated using https://github.com/myii/ssf-formula/pull/344'
# yamllint enable rule:line-length rule:quoted-strings
github:
owner: 'saltstack-formulas'
Expand Down
18 changes: 9 additions & 9 deletions ssf/files/default/kitchen.windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,6 @@ driver:
username: {{ testing_windows.github.driver.username }}
password: {{ testing_windows.github.driver.password }}

platforms:
{%- for platform in proxyplatformswindows %}
{%- set os = platform[0] | d('') %}
{%- set os_ver = platform[1] | d('') %}
{%- set salt_ver = platform[2] | d('') %}
{%- set py_ver = platform[3] | d('') %}
- name: {{ os | replace('/', '-') }}-{{ os_ver | replace('.', '') }}-{{ salt_ver | replace('.', '-') }}-py{{ py_ver }}
{%- endfor %}

provisioner:
salt_install: {{ testing_windows.github.platforms.provisioner.salt_install }}
salt_bootstrap_options: {{ testing_windows.github.platforms.provisioner.salt_bootstrap_options }}
Expand All @@ -33,3 +24,12 @@ provisioner:
{%- endfor %}
# yamllint enable rule:line-length
{%- endif %}

platforms:
{%- for platform in proxyplatformswindows %}
{%- set os = platform[0] | d('') %}
{%- set os_ver = platform[1] | d('') %}
{%- set salt_ver = platform[2] | d('') %}
{%- set py_ver = platform[3] | d('') %}
- name: {{ os | replace('/', '-') }}-{{ os_ver | replace('.', '') }}-{{ salt_ver | replace('.', '-') }}-py{{ py_ver }}
{%- endfor %}
29 changes: 15 additions & 14 deletions ssf/files/default/kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,11 @@ provision_command:

{%- macro format_driver_run_cmds(os, os_ver) %}
{%- filter indent(6) %}
{%- if os in ['opensuse/leap', 'opensuse/tmbl', 'arch-base'] %}
run_command: /usr/lib/systemd/systemd
{%- elif [os, os_ver] in [['amazonlinux', 1], ['centos', 6], ['gentoo/stage3', 'latest']] %}
{#- Ordering of `if` and `elif` is important here, since we need to differentiate between the two Gentoo platforms #}
{%- if [os, os_ver] in [['gentoo/stage3', 'latest']] %}
run_command: /sbin/init
{%- elif os in ['debian', 'ubuntu', 'gentoo'] %}
run_command: /lib/systemd/systemd
{%- endif %}
{%- endfilter %}
{%- endmacro %}
Expand All @@ -173,7 +174,7 @@ driver:
name: docker
use_sudo: false
privileged: true
run_command: /lib/systemd/systemd
run_command: /usr/lib/systemd/systemd
{%- set run_options = kitchen.driver.run_options %}
{%- if run_options %}
{%- if semrel_formula == 'proftpd' %}
Expand All @@ -193,6 +194,16 @@ driver:
{%- endfor %}
{%- endif %}

provisioner:
name: salt_solo
log_level: {{ 'info' if semrel_formula in ['devstack'] else 'debug' }}
salt_install: none
require_chef: false
formula: {{ semrel_formula }}
salt_copy_filter:
- .kitchen
- .git

platforms:
{#- Centralise duplication from here and `libcimatrix.jinja` #}
{%- set ns_platforms = namespace(prev_comment='') %}
Expand Down Expand Up @@ -247,16 +258,6 @@ platforms:
{%- endif %}
{%- endfor %}

provisioner:
name: salt_solo
log_level: {{ 'info' if semrel_formula in ['devstack'] else 'debug' }}
salt_install: none
require_chef: false
formula: {{ semrel_formula }}
salt_copy_filter:
- .kitchen
- .git

verifier:
# https://www.inspec.io/
name: inspec
Expand Down
1 change: 1 addition & 0 deletions ssf/formulas.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3871,6 +3871,7 @@ ssf:
- '*':
- ._mapdata
- states.files
- .clean
- .
map_jinja:
verification:
Expand Down

0 comments on commit 2ef49bd

Please sign in to comment.