Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(vagrant): use pre-salted boxes & conditional local settings #311

Merged
merged 1 commit into from
Apr 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 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: 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'
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion ssf/files/default/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ gem 'kitchen-salt', '>= 0.6.3'
'php',
'postgres',
'salt',
] %}
] %}
{%- if semrel_formula in ['openvpn'] %}
gem 'rspec-retry'
{%- endif %}
Expand Down
26 changes: 16 additions & 10 deletions ssf/files/default/kitchen.vagrant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
Expand All @@ -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
Expand All @@ -58,6 +67,3 @@ platforms:
# yamllint enable rule:line-length
{%- endif %}
{%- endfor %}

provisioner:
salt_install: bootstrap
28 changes: 14 additions & 14 deletions ssf/formulas.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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: >-
Expand All @@ -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
Expand Down Expand Up @@ -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]
Expand All @@ -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]
Expand Down