From b51be37dd9cf38b7de698d89f5c17d48e08d6d4b Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Mon, 4 Nov 2019 09:05:19 +0000 Subject: [PATCH 1/2] feat(kitchen): use bootstrapped `amazonlinux-1` images --- ssf/files/default/kitchen.yml | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/ssf/files/default/kitchen.yml b/ssf/files/default/kitchen.yml index c437a40f..5acd7e47 100644 --- a/ssf/files/default/kitchen.yml +++ b/ssf/files/default/kitchen.yml @@ -54,7 +54,12 @@ {%- if [os, os_ver, salt_ver] == ['amazonlinux', 2, 'master'] %} {%- set salt_ver = 'develop' %} {%- endif %} +{#- Use bootstrapped images for `amazonlinux-1` #} +{%- if [os, os_ver] == ['amazonlinux', 1] %} +image: {{ os }}:{{ os_ver }} +{%- else %} image: netmanagers/salt-{{ salt_ver }}-py{{ py_ver }}:{{ os | replace('/', '-') }}-{{ os_ver }} +{%- endif %} {%- endfilter %} {%- endmacro %} @@ -69,8 +74,11 @@ image: netmanagers/salt-{{ salt_ver }}-py{{ py_ver }}:{{ os | replace('/', '-') {%- if [os, os_ver, salt_ver] == ['amazonlinux', 2, 'master'] %} {%- set salt_ver = 'develop' %} {%- endif %} -{%- do prov_cmds.append('- curl -o bootstrap-salt.sh -L https://bootstrap.saltstack.com') %} -{%- do prov_cmds.append('- sh bootstrap-salt.sh -XdPbfrq -x python{0} git {1}'.format(py_ver, salt_ver)) %} +{#- Append the `prov_cmds` for pre-salted images (i.e. non-bootstrap) #} +{%- if [os, os_ver] != ['amazonlinux', 1] %} +{%- do prov_cmds.append('- curl -o bootstrap-salt.sh -L https://bootstrap.saltstack.com') %} +{%- do prov_cmds.append('- sh bootstrap-salt.sh -XdPbfrq -x python{0} git {1}'.format(py_ver, salt_ver)) %} +{%- endif %} {%- if semrel_formula == 'deepsea' %} {%- if os in ['centos', 'fedora'] %} {%- do prov_cmds.append('- yum install make -y') %} @@ -105,7 +113,7 @@ provision_command: {%- filter indent(6) %} {%- if os in ['opensuse/leap', 'arch-base'] %} run_command: /usr/lib/systemd/systemd -{%- elif [os, os_ver] == ['centos', 6] %} +{%- elif [os, os_ver] in [['amazonlinux', 1], ['centos', 6]] %} run_command: /sbin/init {%- endif %} {%- endfilter %} @@ -170,7 +178,11 @@ platforms: {{- format_driver_image(os, os_ver, salt_ver, py_ver) }} {{- format_driver_prov_cmds(os, os_ver, salt_ver, py_ver) }} {{- format_driver_run_cmds(os, os_ver) }} - {%- if [os, os_ver] == ['opensuse/leap', 15.1] %} + {%- if [os, os_ver] == ['amazonlinux', 1] %} + provisioner: + salt_bootstrap_options: -XdPfq -x python{{ py_ver }} git {{ salt_ver }} + salt_install: bootstrap + {%- elif [os, os_ver] == ['opensuse/leap', 15.1] %} # Workaround to avoid intermittent failures on `opensuse-leap-15.1`: # => SCP did not finish successfully (255): (Net::SCP::Error) transport: From 2814ea09637ab86dacb4325a0378afbdd19380c6 Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Thu, 31 Oct 2019 00:13:22 +0000 Subject: [PATCH 2/2] feat(formula): add `epel-formula` --- pillar.example | 1 + ssf/defaults.yaml | 5 +- .../docs/CONTRIBUTING.rst | 1 + ssf/formulas.yaml | 48 +++++++++++++++++++ 4 files changed, 53 insertions(+), 2 deletions(-) diff --git a/pillar.example b/pillar.example index a1ca6bb2..7989c03a 100644 --- a/pillar.example +++ b/pillar.example @@ -80,6 +80,7 @@ ssf: - deepsea - dhcpd - docker + - epel - exim - fail2ban - golang diff --git a/ssf/defaults.yaml b/ssf/defaults.yaml index 5c72cc1a..bf473e0e 100644 --- a/ssf/defaults.yaml +++ b/ssf/defaults.yaml @@ -22,8 +22,8 @@ ssf_node_anchors: # An alternative method could be to use: # `git describe --abbrev=0 --tags` # yamllint disable rule:line-length - title: 'ci(kitchen): use `develop` image until `master` is ready (`amazonlinux`) [skip ci]' - body: '* Automated using https://github.com/myii/ssf-formula/pull/93' + title: 'feat(semantic-release): implement for this formula' + body: '* Automated using https://github.com/myii/ssf-formula/pull/92' # yamllint enable rule:line-length github: owner: 'saltstack-formulas' @@ -269,6 +269,7 @@ ssf: deepsea: *formula_default dhcpd: *formula_default docker: *formula_default + epel: *formula_default exim: *formula_default fail2ban: *formula_default golang: *formula_default diff --git a/ssf/files/tofs_template-formula/docs/CONTRIBUTING.rst b/ssf/files/tofs_template-formula/docs/CONTRIBUTING.rst index 8bc97df5..eb11c8dd 100644 --- a/ssf/files/tofs_template-formula/docs/CONTRIBUTING.rst +++ b/ssf/files/tofs_template-formula/docs/CONTRIBUTING.rst @@ -174,6 +174,7 @@ These formulas are already compatible with semantic-release: * `deepsea-formula `_ * `dhcpd-formula `_ * `docker-formula `_ +* `epel-formula `_ * `exim-formula `_ * `fail2ban-formula `_ * `golang-formula `_ diff --git a/ssf/formulas.yaml b/ssf/formulas.yaml index db29ce5c..5d8ea767 100644 --- a/ssf/formulas.yaml +++ b/ssf/formulas.yaml @@ -26,6 +26,10 @@ ssf_node_anchors: - centos - fedora - opensuse + supports_centos_fedora_amazon: &supports_centos_fedora_amazon + - centos + - fedora + - amazon provisioner: state_top_salt: &state_top_salt - '*': @@ -560,6 +564,50 @@ ssf: additional: - docker/osfamilymap.yaml semrel_files: *semrel_files_default + epel: + context: + git: + github: + repo: 'epel-formula' + inspec_suites_kitchen: + 0: + inspec_yml: + summary: >- + Verify that the epel formula is setup and configured correctly + supports: *supports_centos_fedora_amazon + provisioner: + pillars_from_files: + - .sls: 'test/salt/pillar/default.sls' + platforms: + # Later, consider using for all *platforms_osfamily_redhat + # [os , os_ver, salt_ver, py_ver] + - [amazonlinux , 1 , master, 2] + - [centos , 8 , master, 3] + - [fedora , 31 , master, 3] + - [amazonlinux , 2 , master, 2] + - [amazonlinux , 1 , 2019.2, 2] + - [centos , 8 , 2019.2, 3] + - [fedora , 31 , 2019.2, 3] + - [amazonlinux , 2 , 2019.2, 2] + - [centos , 7 , 2019.2, 2] + - [amazonlinux , 1 , 2018.3, 2] + - [fedora , 30 , 2018.3, 3] + - [centos , 7 , 2018.3, 2] + - [amazonlinux , 2 , 2018.3, 2] + - [amazonlinux , 1 , 2017.7, 2] + - [centos , 6 , 2017.7, 2] + - [fedora , 30 , 2017.7, 2] + - [amazonlinux , 2 , 2017.7, 2] + platforms_matrix: + # [os , os_ver, salt_ver, py_ver, inspec_suite] + - [centos , 8 , master, 3, default] + # - [fedora , 31 , master, 3, default] + - [amazonlinux , 1 , 2019.2, 2, default] + - [amazonlinux , 2 , 2019.2, 2, default] + - [centos , 7 , 2019.2, 2, default] + # - [fedora , 30 , 2018.3, 3, default] + - [centos , 6 , 2017.7, 2, default] + semrel_files: *semrel_files_default exim: context: git: