From 51cf404b66037677c21db9699d473b7cc5212147 Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Mon, 5 Apr 2021 08:47:48 +0100 Subject: [PATCH] feat(vagrant): use pre-salted boxes & conditional local settings Pre-salted Vagrant boxes: * https://app.vagrantup.com/myii/boxes/freebsd-12.2-master-py3 * https://app.vagrantup.com/myii/boxes/freebsd-11.4-master-py3 * https://app.vagrantup.com/myii/boxes/freebsd-12.2-3002.6-py3 * https://app.vagrantup.com/myii/boxes/freebsd-11.4-3002.6-py3 * https://app.vagrantup.com/myii/boxes/openbsd-6.8-3001.1-py3 --- ssf/defaults.yaml | 12 +++++++----- ssf/files/default/Gemfile | 2 +- ssf/files/default/kitchen.vagrant.yml | 26 +++++++++++++++---------- ssf/formulas.yaml | 28 +++++++++++++-------------- 4 files changed, 38 insertions(+), 30 deletions(-) diff --git a/ssf/defaults.yaml b/ssf/defaults.yaml index 683e69ca..8a321841 100644 --- a/ssf/defaults.yaml +++ b/ssf/defaults.yaml @@ -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: update '`'CODEOWNERS'`' & '`'.yamllint'`' re: '`'kitchen-vagrant'`' [skip ci]" - body: '* Automated using https://github.com/myii/ssf-formula/pull/310' + title: "ci(vagrant): use pre-salted boxes & conditional local settings [skip ci]" + body: '* Automated using https://github.com/myii/ssf-formula/pull/311' # yamllint enable rule:line-length rule:quoted-strings github: owner: 'saltstack-formulas' @@ -314,10 +314,12 @@ ssf: - [windows , 2016 , latest, 3] # wind-2016-latest-py3 vagrantboxes: ### `freebsd` - - [freebsd , 12.2 , latest, 3] # fbsd-12.2-latest-py3 - - [freebsd , 11.4 , latest, 3] # fbsd-11.4-latest-py3 + - [freebsd , 12.2 , master, 3] # fbsd-12.2-master-py3 + - [freebsd , 11.4 , master, 3] # fbsd-11.4-master-py3 + - [freebsd , 12.2 , 3002.6, 3] # fbsd-12.2-3002.6-py3 + - [freebsd , 11.4 , 3002.6, 3] # fbsd-11.4-3002.6-py3 ### `openbsd` - - [openbsd , 6.8 , latest, 3] # obsd-06.8-latest-py3 + - [openbsd , 6.8 , 3001.1, 3] # obsd-06.8-master-py3 ### `windows` - [windows , 8.1 , latest, 3] # wind-08.1-latest-py3 saltimages: diff --git a/ssf/files/default/Gemfile b/ssf/files/default/Gemfile index c807adc8..bc37fa95 100644 --- a/ssf/files/default/Gemfile +++ b/ssf/files/default/Gemfile @@ -22,7 +22,7 @@ gem 'kitchen-salt', '>= 0.6.3' 'php', 'postgres', 'salt', - ] %} + ] %} {%- if semrel_formula in ['openvpn'] %} gem 'rspec-retry' {%- endif %} diff --git a/ssf/files/default/kitchen.vagrant.yml b/ssf/files/default/kitchen.vagrant.yml index 6d2f0ff6..04cf73f3 100644 --- a/ssf/files/default/kitchen.vagrant.yml +++ b/ssf/files/default/kitchen.vagrant.yml @@ -7,9 +7,15 @@ driver: customize: usbxhci: 'off' gui: false - linked_clone: true ssh: shell: /bin/sh + <% unless ENV['CI'] %> + linked_clone: true + synced_folders: + - - '.kitchen/kitchen-vagrant/%{instance_name}/vagrant' + - '/vagrant' + - 'create: true, disabled: false' + <% end %> platforms: {%- for platform in vagrantboxes %} @@ -25,21 +31,24 @@ platforms: {%- endif %} - name: {{ os | replace('/', '-') }}-{{ os_ver | replace('.', '') }}-{{ salt_ver | replace('.', '-') }}-py{{ py_ver }} driver: - {%- if os == 'freebsd' %} - box: {{ 'bento/{}-{}'.format(os, os_ver) }} - {%- elif os == 'openbsd' %} - box: {{ 'generic/{}{}'.format(os, os_ver | int) }} + {#- `box` first #} + {%- if os == 'windows' %} + box: {{ testing_windows.vagrant.platforms.driver.box }} + {%- else %} + box: {{ 'myii/{}-{}-{}-py{}'.format(os, os_ver, salt_ver, py_ver) }} + {%- endif %} + {#- Remaining settings #} + {%- if os == 'openbsd' %} ssh: {{ testing_openbsd.vagrant.platforms.driver.ssh | yaml(False) | indent(8) }} + synced_folders: [] {%- elif os == 'windows' %} - box: {{ testing_windows.vagrant.platforms.driver.box }} cache_directory: "/omnibus/cache" customize: {} ssh: {} {%- endif %} {%- if os == 'windows' %} provisioner: - salt_install: none # yamllint disable rule:line-length init_environment: | # Workaround to allow `kitchen converge` to be used multiple times @@ -58,6 +67,3 @@ platforms: # yamllint enable rule:line-length {%- endif %} {%- endfor %} - -provisioner: - salt_install: bootstrap diff --git a/ssf/formulas.yaml b/ssf/formulas.yaml index 53353c02..b57fcd18 100644 --- a/ssf/formulas.yaml +++ b/ssf/formulas.yaml @@ -424,7 +424,7 @@ ssf: - [oraclelinux , 7 , master, 0, ''] # modules # # - [gentoo/stage3, 0 , master, 0, default] - [arch-base , 0 , 3002.5, 0, modules] # POSSIBLE - - [freebsd , 0 , latest, 3, ''] + - [freebsd , 0 , master, 3, ''] testing_freebsd: active: true use_tofs: true @@ -1341,8 +1341,8 @@ ssf: - [oraclelinux , 0 , master, 0, ''] # # - [gentoo/stage3, 0 , master, 0, ''] - [arch-base , 0 , 3002.5, 0, ''] - - [freebsd , 0 , latest, 3, ''] - - [openbsd , 0 , latest, 3, package] + - [freebsd , 0 , master, 3, ''] + - [openbsd , 0 , 3001.1, 3, package] - [windows , 0 , latest, 3, ''] testing_freebsd: active: true @@ -3021,7 +3021,7 @@ ssf: - [oraclelinux , 7 , master, 0, default] - [gentoo/stage3, systemd, master, 0, default] - [arch-base , 0 , 3002.5, 0, default] - - [freebsd , 0 , latest, 3, default] + - [freebsd , 0 , master, 3, default] testing_freebsd: active: true use_tofs: true @@ -3318,8 +3318,8 @@ ssf: - [oraclelinux , 0 , master, 0, default] - [gentoo/stage3, 0 , master, 0, default] - [arch-base , 0 , 3002.2, 0, default] - - [freebsd , 0 , latest, 3, default] - - [openbsd , 0 , latest, 3, default] + - [freebsd , 0 , master, 3, default] + - [openbsd , 0 , 3001.1, 3, default] testing_freebsd: active: true testing_openbsd: @@ -3372,7 +3372,7 @@ ssf: # # - [gentoo/stage3, 0 , master, 0, default] # # - [arch-base , 0 , 3002.5, 0, default] # # TODO: Fix 2 failing states in order to enable this - # # - [freebsd , 0 , latest, 3, default] + # # - [freebsd , 0 , master, 3, default] - [windows , 0 , latest, 3, default] testing_freebsd: active: true @@ -3664,7 +3664,7 @@ ssf: - [oraclelinux , 0 , master, 0, redhat] # # - [gentoo/stage3, 0 , master, 0, gentoo] # # - [arch-base , 0 , 3002.5, 0, arch] - - [freebsd , 0 , latest, 3, freebsd] + - [freebsd , 0 , master, 3, freebsd] testing_freebsd: active: true use_tofs: true @@ -3736,8 +3736,8 @@ ssf: - [oraclelinux , 0 , master, 0, default] # # - [gentoo/stage3, 0 , master, 0, default] - [arch-base , 0 , 3002.5, 0, default] - - [freebsd , 0 , latest, 3, default] - # # - [openbsd , 0 , latest, 3, default] + - [freebsd , 0 , master, 3, default] + # # - [openbsd , 0 , 3001.1, 3, default] # # - [windows , 0 , latest, 3, default] testing_freebsd: active: true @@ -4185,7 +4185,7 @@ ssf: includes: # [os , os_ver, salt_ver, py_ver] - [0 , 0 , 3002.5, 3] - - [freebsd , 0 , latest, 3] + - [freebsd , 0 , 3002.6, 3] - [windows , 0 , latest, 3] inspec_yml: summary: >- @@ -4203,7 +4203,7 @@ ssf: includes: # [os , os_ver, salt_ver, py_ver] - [0 , 0 , 3001.6, 3] - - [openbsd , 0 , latest, 3] + - [openbsd , 0 , 3001.1, 3] inspec_yml: summary: >- Verify that Salt `v3001-py3` is setup and configured @@ -4279,7 +4279,7 @@ ssf: - [arch-base , latest, 3002.5, 3, v3002-py3] - [gentoo/stage3, latest, 3002.5, 3, v3002-py3] - [gentoo/stage3, systemd, 3002.5, 3, v3002-py3] - - [freebsd , 0 , latest, 3, v3002-py3] + - [freebsd , 0 , 3002.6, 3, v3002-py3] - [windows , 0 , latest, 3, v3002-py3] - [debian , 10 , 3001.6, 3, v3001-py3] # - [debian , 9 , 3001.6, 3, v3001-py3] @@ -4300,7 +4300,7 @@ ssf: # # - [arch-base , latest, 3001.6, 3, v3001-py3] # - [gentoo/stage3, latest, 3001.6, 3, v3001-py3] # - [gentoo/stage3, systemd, 3001.6, 3, v3001-py3] - - [openbsd , 0 , latest, 3, v3001-py3] + - [openbsd , 0 , 3001.1, 3, v3001-py3] # - [debian , 10 , 3000.8, 3, v3000-py3] - [debian , 9 , 3000.8, 3, v3000-py3] - [ubuntu , 18.04, 3000.8, 3, v3000-py3]