From 163c77fceea0f4a098bc74039cb24e77f0f9852a Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Fri, 26 Mar 2021 11:15:22 +0000 Subject: [PATCH 1/9] ci: enable Vagrant-based testing using GitHub Actions * Semi-automated using https://github.com/myii/ssf-formula/pull/304 --- .github/workflows/kitchen.vagrant.yml | 36 ++++++++++ .github/workflows/kitchen.windows.yml | 96 ++++++++++++++++++++++----- .gitlab-ci.yml | 2 +- .travis.yml | 2 +- kitchen.vagrant.yml | 67 +++++++++++-------- kitchen.windows.yml | 40 ++++------- kitchen.yml | 6 ++ 7 files changed, 174 insertions(+), 75 deletions(-) create mode 100644 .github/workflows/kitchen.vagrant.yml diff --git a/.github/workflows/kitchen.vagrant.yml b/.github/workflows/kitchen.vagrant.yml new file mode 100644 index 0000000..1ea1c46 --- /dev/null +++ b/.github/workflows/kitchen.vagrant.yml @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- +# vim: ft=yaml +--- +name: 'Kitchen Vagrant (FreeBSD, OpenBSD & Windows)' +'on': ['push', 'pull_request'] + +env: + KITCHEN_LOCAL_YAML: 'kitchen.vagrant.yml' + +jobs: + test: + runs-on: 'macos-10.15' + strategy: + fail-fast: false + matrix: + instance: + - v3002-py3-freebsd-122-latest-py3 + - v3002-py3-freebsd-114-latest-py3 + - v3001-py3-openbsd-68-latest-py3 + - v3002-py3-windows-81-latest-py3 + steps: + - name: 'Check out code' + uses: 'actions/checkout@v2' + - name: 'Set up Bundler cache' + uses: 'actions/cache@v1' + with: + path: 'vendor/bundle' + key: "${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}" + restore-keys: "${{ runner.os }}-gems-" + - name: 'Run Bundler' + run: | + ruby --version + bundle config path vendor/bundle + bundle install --jobs 4 --retry 3 + - name: 'Run Test Kitchen' + run: 'bundle exec kitchen verify ${{ matrix.instance }}' diff --git a/.github/workflows/kitchen.windows.yml b/.github/workflows/kitchen.windows.yml index 09c1af9..be35bf8 100644 --- a/.github/workflows/kitchen.windows.yml +++ b/.github/workflows/kitchen.windows.yml @@ -1,39 +1,101 @@ +# -*- coding: utf-8 -*- +# vim: ft=yaml --- name: 'Kitchen (Windows)' - -'on': [push, pull_request] +'on': ['push', 'pull_request'] env: machine_user: kitchen machine_pass: Pass@word1 machine_port: 5985 - KITCHEN_LOCAL_YAML: kitchen.windows.yml + KITCHEN_LOCAL_YAML: 'kitchen.windows.yml' jobs: - build: - runs-on: windows-latest - + test-2019: + runs-on: 'windows-2019' + strategy: + fail-fast: false + matrix: + instance: + - v3002-py3-windows-2019-latest-py3 steps: - - uses: actions/checkout@v2 - - uses: actions/cache@v1 + - name: 'Check out code' + uses: 'actions/checkout@v2' + - name: 'Install Chef' + uses: 'actionshub/chef-install@1.1.0' with: - path: vendor/bundle - key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }} - restore-keys: | - ${{ runner.os }}-gems- - - shell: powershell + project: 'chef' + version: '16.10.8' + - name: 'Add Chef bindir to PATH' + uses: 'myci-actions/export-env-var-powershell@1' + with: + name: 'PATH' + value: "C:\\opscode\\chef\\bin;\ + C:\\opscode\\chef\\embedded\\bin;$env:PATH" + - name: 'Set up Bundler cache' + uses: 'actions/cache@v1' + with: + path: 'vendor/bundle' + key: "${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}" + restore-keys: "${{ runner.os }}-gems-" + - name: 'Set up test user' run: | $password = ConvertTo-SecureString $env:machine_pass -AsPlainText -Force New-LocalUser $env:machine_user -Password $password Add-LocalGroupMember -Group "Administrators" -Member $env:machine_user - - shell: powershell + - name: 'Set up WinRM' run: > Set-WSManQuickConfig -Force; Set-WSManInstance -ResourceURI winrm/config/service -ValueSet @{AllowUnencrypted="true"} - - run: gem install bundler --quiet --no-document - - name: Bundle install + - name: 'Run Bundler' run: | + ruby --version bundle config path vendor/bundle bundle install --jobs 4 --retry 3 - - run: bundle exec kitchen test + - name: 'Run Test Kitchen' + run: 'bundle exec kitchen verify ${{ matrix.instance }}' + test-2016: + runs-on: 'windows-2016' + strategy: + fail-fast: false + matrix: + instance: + - v3002-py3-windows-2016-latest-py3 + steps: + - name: 'Check out code' + uses: 'actions/checkout@v2' + - name: 'Install Chef' + uses: 'actionshub/chef-install@1.1.0' + with: + project: 'chef' + version: '16.10.8' + - name: 'Add Chef bindir to PATH' + uses: 'myci-actions/export-env-var-powershell@1' + with: + name: 'PATH' + value: "C:\\opscode\\chef\\bin;\ + C:\\opscode\\chef\\embedded\\bin;$env:PATH" + - name: 'Set up Bundler cache' + uses: 'actions/cache@v1' + with: + path: 'vendor/bundle' + key: "${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}" + restore-keys: "${{ runner.os }}-gems-" + - name: 'Set up test user' + run: | + $password = ConvertTo-SecureString $env:machine_pass -AsPlainText -Force + New-LocalUser $env:machine_user -Password $password + Add-LocalGroupMember -Group "Administrators" -Member $env:machine_user + - name: 'Set up WinRM' + run: > + Set-WSManQuickConfig -Force; + Set-WSManInstance -ResourceURI winrm/config/service + -ValueSet @{AllowUnencrypted="true"} + - name: 'Run Bundler' + run: | + ruby --version + bundle config path vendor/bundle + bundle install --jobs 4 --retry 3 + - name: 'Run Test Kitchen' + run: 'bundle exec kitchen verify ${{ matrix.instance }}' diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 032b3d8..512953a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -135,7 +135,7 @@ v3002-py3-fedora-33-3002-5-py3: {extends: '.test_instance'} v3002-py3-amazonlinux-2-3002-5-py3: {extends: '.test_instance'} v3002-py3-oraclelinux-8-3002-5-py3: {extends: '.test_instance'} v3002-py3-oraclelinux-7-3002-5-py3: {extends: '.test_instance'} -# v3002-py3-arch-base-latest-3002-5-py3: {extends: '.test_instance'} +v3002-py3-arch-base-latest-3002-5-py3: {extends: '.test_instance'} v3002-py3-gentoo-stage3-latest-3002-5-py3: {extends: '.test_instance'} v3002-py3-gentoo-stage3-systemd-3002-5-py3: {extends: '.test_instance'} v3001-py3-debian-10-3001-6-py3: {extends: '.test_instance'} diff --git a/.travis.yml b/.travis.yml index eecc291..2a4e50f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -95,7 +95,7 @@ jobs: - env: INSTANCE=v3002-py3-amazonlinux-2-3002-5-py3 - env: INSTANCE=v3002-py3-oraclelinux-8-3002-5-py3 - env: INSTANCE=v3002-py3-oraclelinux-7-3002-5-py3 - # - env: INSTANCE=v3002-py3-arch-base-latest-3002-5-py3 + - env: INSTANCE=v3002-py3-arch-base-latest-3002-5-py3 - env: INSTANCE=v3002-py3-gentoo-stage3-latest-3002-5-py3 - env: INSTANCE=v3002-py3-gentoo-stage3-systemd-3002-5-py3 - env: INSTANCE=v3001-py3-debian-10-3001-6-py3 diff --git a/kitchen.vagrant.yml b/kitchen.vagrant.yml index 55e38e5..8248638 100644 --- a/kitchen.vagrant.yml +++ b/kitchen.vagrant.yml @@ -3,37 +3,48 @@ --- driver: name: vagrant + cache_directory: false + customize: + usbxhci: 'off' + gui: false + linked_clone: true + ssh: + shell: /bin/sh platforms: - - name: windows-81 + - name: freebsd-122-latest-py3 + driver: + box: bento/freebsd-12.2 + - name: freebsd-114-latest-py3 + driver: + box: bento/freebsd-11.4 + - name: openbsd-68-latest-py3 + driver: + box: generic/openbsd6 + ssh: + shell: /bin/ksh + - name: windows-81-latest-py3 driver: box: techneg/win81x64-pro-salt - gui: false - linked_clone: true + cache_directory: "/omnibus/cache" + customize: {} + ssh: {} provisioner: - init_environment: > - salt-call --local state.single file.managed - C:\Users\vagrant\AppData\Local\Temp\kitchen\srv\salt\win\repo-ng\salt-minion-py3.sls - source=https://github.com/saltstack/salt-winrepo-ng/raw/master/salt-minion-py3.sls - skip_verify=True makedirs=True + salt_install: none + # yamllint disable rule:line-length + init_environment: | + # Workaround to allow `kitchen converge` to be used multiple times + # without having to `kitchen destroy` first: remove state files cached by + # Salt during the previous `converge` (if present) + rm -recurse ` + C:\Users\vagrant\AppData\Local\Temp\kitchen\var\cache\salt\minion\files\base ` + -ErrorAction SilentlyContinue + salt-call --local state.single file.managed ` + C:\Users\vagrant\AppData\Local\Temp\kitchen\srv\salt\win\repo-ng\salt-minion-py3.sls ` + source=https://github.com/saltstack/salt-winrepo-ng/raw/master/salt-minion-py3.sls ` + skip_verify=True makedirs=True + exit 0 + # yamllint enable rule:line-length -suites: - - name: v3000-py3 - provisioner: - state_top: - base: - '*': - - salt._mapdata - - salt.minion - pillars: - top.sls: - base: - '*': - - salt - - v3000-py3 - pillars_from_files: - salt.sls: test/salt/pillar/salt.sls - v3000-py3.sls: test/salt/pillar/v3000-py3.sls - verifier: - inspec_tests: - - path: test/integration/v3000-py3 +provisioner: + salt_install: bootstrap diff --git a/kitchen.windows.yml b/kitchen.windows.yml index 0a4ec00..7c3cc6f 100644 --- a/kitchen.windows.yml +++ b/kitchen.windows.yml @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- +# vim: ft=yaml --- driver: name: proxy @@ -8,34 +10,16 @@ driver: password: Pass@word1 platforms: - - name: windows + - name: windows-2019-latest-py3 + - name: windows-2016-latest-py3 provisioner: salt_install: bootstrap - salt_bootstrap_options: -pythonVersion 3 -version 3000.3 - init_environment: > - C:\salt\salt-call --local state.single file.managed - C:\Users\kitchen\AppData\Local\Temp\kitchen\srv\salt\win\repo-ng\salt-minion-py3.sls - source=https://github.com/saltstack/salt-winrepo-ng/raw/master/salt-minion-py3.sls - skip_verify=True makedirs=True - -suites: - - name: v3000-py3 - provisioner: - state_top: - base: - '*': - - salt._mapdata - - salt.minion - pillars: - top.sls: - base: - '*': - - salt - - v3000-py3 - pillars_from_files: - salt.sls: test/salt/pillar/salt.sls - v3000-py3.sls: test/salt/pillar/v3000-py3.sls - verifier: - inspec_tests: - - path: test/integration/v3000-py3 + salt_bootstrap_options: -pythonVersion 3 -version 3002.5 + # yamllint disable rule:line-length + init_environment: | + C:\salt\salt-call --local state.single file.managed ` + C:\Users\kitchen\AppData\Local\Temp\kitchen\srv\salt\win\repo-ng\salt-minion-py3.sls ` + source=https://github.com/saltstack/salt-winrepo-ng/raw/master/salt-minion-py3.sls ` + skip_verify=True makedirs=True + # yamllint enable rule:line-length diff --git a/kitchen.yml b/kitchen.yml index f4416a1..e4e4c76 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -324,6 +324,11 @@ suites: - arch-base-latest-3002-5-py3 - gentoo-stage3-latest-3002-5-py3 - gentoo-stage3-systemd-3002-5-py3 + - freebsd-122-latest-py3 + - freebsd-114-latest-py3 + - windows-81-latest-py3 + - windows-2019-latest-py3 + - windows-2016-latest-py3 provisioner: state_top: base: @@ -363,6 +368,7 @@ suites: - arch-base-latest-3001-6-py3 - gentoo-stage3-latest-3001-6-py3 - gentoo-stage3-systemd-3001-6-py3 + - openbsd-68-latest-py3 provisioner: state_top: base: From ef1bc02a8680a9b92b9d8d74013986070cc01f5e Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Fri, 26 Mar 2021 14:59:56 +0000 Subject: [PATCH 2/9] docs(readme): add `Testing with Vagrant` section --- docs/README.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/README.rst b/docs/README.rst index fde8eb3..4369109 100644 --- a/docs/README.rst +++ b/docs/README.rst @@ -255,7 +255,7 @@ Gives you SSH access to the instance for manual testing. Testing with Vagrant -------------------- -Windows testing is done with ``kitchen-salt``. +Windows/FreeBSD/OpenBSD testing is done with ``kitchen-salt``. Requirements ^^^^^^^^^^^^ @@ -273,8 +273,8 @@ Setup $ bundle install --with=vagrant $ bin/kitchen test [platform] -Where ``[platform]`` is the platform name defined in ``kitchen.yml``, -e.g. ``windows``. +Where ``[platform]`` is the platform name defined in ``kitchen.vagrant.yml``, +e.g. ``windows-81-latest-py3``. Note ^^^^ @@ -292,7 +292,7 @@ Then run the following commands as needed. ``bin/kitchen converge`` ^^^^^^^^^^^^^^^^^^^^^^^^ -Creates the Vagrant instance and runs the ``salt.minion`` main state, ready for testing. +Creates the Vagrant instance and runs the ``salt`` main states, ready for testing. ``bin/kitchen verify`` ^^^^^^^^^^^^^^^^^^^^^^ @@ -312,4 +312,4 @@ Runs all of the stages above in one go: i.e. ``destroy`` + ``converge`` + ``veri ``bin/kitchen login`` ^^^^^^^^^^^^^^^^^^^^^ -Gives you RDP access to the instance for manual testing. +Gives you RDP/SSH access to the instance for manual testing. From 69d598138e18134a9dcf8ed84daf04e3d4e2158e Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Tue, 29 Dec 2020 13:15:34 +0000 Subject: [PATCH 3/9] fix(osfamilymap): use `whoami` for Windows `rootuser` Fix #495 --- salt/osfamilymap.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/salt/osfamilymap.yaml b/salt/osfamilymap.yaml index 7f31b24..327470c 100644 --- a/salt/osfamilymap.yaml +++ b/salt/osfamilymap.yaml @@ -20,7 +20,7 @@ {%- set rootuser = salt['cmd.run']("stat -f '%Su' /dev/console") %} {%- set rootgroup = salt['cmd.run']("stat -f '%Sg' /dev/console") %} {%- elif grains.os_family == 'Windows' %} -{%- set rootuser = salt['cmd.run']("id -un") %} +{%- set rootuser = salt['cmd.run']("whoami").split("\\")[1] %} {%- endif %} From e0afe89f2492f1b530d6205b871e435ea7ab0c97 Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Sun, 14 Mar 2021 09:00:41 +0000 Subject: [PATCH 4/9] test: add Windows map verification files --- .../files/_mapdata/windows-2016-server.yaml | 106 ++++++++++++++++++ .../files/_mapdata/windows-2019-server.yaml | 106 ++++++++++++++++++ .../files/_mapdata/windows-8.yaml | 4 +- 3 files changed, 214 insertions(+), 2 deletions(-) create mode 100644 test/integration/v3002-py3/files/_mapdata/windows-2016-server.yaml create mode 100644 test/integration/v3002-py3/files/_mapdata/windows-2019-server.yaml rename test/integration/{v3000-py3 => v3002-py3}/files/_mapdata/windows-8.yaml (98%) diff --git a/test/integration/v3002-py3/files/_mapdata/windows-2016-server.yaml b/test/integration/v3002-py3/files/_mapdata/windows-2016-server.yaml new file mode 100644 index 0000000..dbd4c6a --- /dev/null +++ b/test/integration/v3002-py3/files/_mapdata/windows-2016-server.yaml @@ -0,0 +1,106 @@ +# yamllint disable rule:indentation rule:line-length +# Windows-2016Server +--- +values: + formulas_settings: + checkout_orig_branch: false + git_opts: + default: + basedir: "/srv/formulas" + baseurl: https://github.com/saltstack-formulas + options: + output_loglevel: quiet + rev: master + update: false + list: {} + salt_settings: + api_service: salt-api + api_service_details: + enabled: true + state: running + clean_config_d_dir: true + cloud: + template_sources: + maps: salt://salt/files/cloud.maps.d + profiles: salt://salt/files/cloud.profiles.d + providers: salt://salt/files/cloud.providers.d + config_path: C:\salt\conf + gitfs: + dulwich: + install_from_source: true + gitpython: + install_from_source: false + pygit2: + git: + install_from_package: git + require_state: false + install_from_source: true + libgit2: + build_parent_dir: "/usr/src/" + download_hash: 683d1164e361e2a0a8d52652840e2340 + install_from_source: true + version: 0.23.0 + version: 0.23.0 + install_packages: true + master: + ext_pillar: + - cmd_yaml: cat /etc/salt/yaml + - stack: + - /path/to/stack1.cfg + - /path/to/stack2.cfg + - reclass: + inventory_base_uri: /etc/reclass + file_roots: + base: + - "/srv/salt" + fileserver_backend: + - rootfs + gitfs_provider: gitpython + pillar_roots: + base: + - "/srv/pillar" + master_config_use_TOFS: false + master_remove_config: false + master_service: salt-master + master_service_details: + enabled: true + state: running + minion: + file_roots: + base: + - "/srv/salt" + fileserver_backend: + - rootfs + master: localhost + master_type: true + pillar_roots: + base: + - "/srv/pillar" + minion_config_use_TOFS: false + minion_remove_config: false + minion_service: salt-minion + minion_service_details: + enabled: true + state: running + parallel: false + pin_version: false + pkgrepo: '' + py_ver: py3 + python_dulwich: python-dulwich + python_git: python-git + release: '3002' + restart_via_at: false + rootgroup: root + rootuser: kitchen + salt_api: salt-api + salt_cloud: salt-cloud + salt_master: salt-master + salt_master_macos_plist_hash: '' + salt_minion: salt-minion-py3 + salt_minion_macos_plist_hash: '' + salt_ssh: salt-ssh + salt_syndic: salt-syndic + ssh_roster: {} + syndic_service: salt-syndic + use_pip: false + version: '' diff --git a/test/integration/v3002-py3/files/_mapdata/windows-2019-server.yaml b/test/integration/v3002-py3/files/_mapdata/windows-2019-server.yaml new file mode 100644 index 0000000..80ab0b9 --- /dev/null +++ b/test/integration/v3002-py3/files/_mapdata/windows-2019-server.yaml @@ -0,0 +1,106 @@ +# yamllint disable rule:indentation rule:line-length +# Windows-2019Server +--- +values: + formulas_settings: + checkout_orig_branch: false + git_opts: + default: + basedir: "/srv/formulas" + baseurl: https://github.com/saltstack-formulas + options: + output_loglevel: quiet + rev: master + update: false + list: {} + salt_settings: + api_service: salt-api + api_service_details: + enabled: true + state: running + clean_config_d_dir: true + cloud: + template_sources: + maps: salt://salt/files/cloud.maps.d + profiles: salt://salt/files/cloud.profiles.d + providers: salt://salt/files/cloud.providers.d + config_path: C:\salt\conf + gitfs: + dulwich: + install_from_source: true + gitpython: + install_from_source: false + pygit2: + git: + install_from_package: git + require_state: false + install_from_source: true + libgit2: + build_parent_dir: "/usr/src/" + download_hash: 683d1164e361e2a0a8d52652840e2340 + install_from_source: true + version: 0.23.0 + version: 0.23.0 + install_packages: true + master: + ext_pillar: + - cmd_yaml: cat /etc/salt/yaml + - stack: + - /path/to/stack1.cfg + - /path/to/stack2.cfg + - reclass: + inventory_base_uri: /etc/reclass + file_roots: + base: + - "/srv/salt" + fileserver_backend: + - rootfs + gitfs_provider: gitpython + pillar_roots: + base: + - "/srv/pillar" + master_config_use_TOFS: false + master_remove_config: false + master_service: salt-master + master_service_details: + enabled: true + state: running + minion: + file_roots: + base: + - "/srv/salt" + fileserver_backend: + - rootfs + master: localhost + master_type: true + pillar_roots: + base: + - "/srv/pillar" + minion_config_use_TOFS: false + minion_remove_config: false + minion_service: salt-minion + minion_service_details: + enabled: true + state: running + parallel: false + pin_version: false + pkgrepo: '' + py_ver: py3 + python_dulwich: python-dulwich + python_git: python-git + release: '3002' + restart_via_at: false + rootgroup: root + rootuser: kitchen + salt_api: salt-api + salt_cloud: salt-cloud + salt_master: salt-master + salt_master_macos_plist_hash: '' + salt_minion: salt-minion-py3 + salt_minion_macos_plist_hash: '' + salt_ssh: salt-ssh + salt_syndic: salt-syndic + ssh_roster: {} + syndic_service: salt-syndic + use_pip: false + version: '' diff --git a/test/integration/v3000-py3/files/_mapdata/windows-8.yaml b/test/integration/v3002-py3/files/_mapdata/windows-8.yaml similarity index 98% rename from test/integration/v3000-py3/files/_mapdata/windows-8.yaml rename to test/integration/v3002-py3/files/_mapdata/windows-8.yaml index befbbef..3fe2a3c 100644 --- a/test/integration/v3000-py3/files/_mapdata/windows-8.yaml +++ b/test/integration/v3002-py3/files/_mapdata/windows-8.yaml @@ -88,10 +88,10 @@ values: py_ver: py3 python_dulwich: python-dulwich python_git: python-git - release: '3000' + release: '3002' restart_via_at: false rootgroup: root - rootuser: kitchen + rootuser: vagrant salt_api: salt-api salt_cloud: salt-cloud salt_master: salt-master From e31a56e7a328117f5d5b951119eb853a91eade60 Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Tue, 30 Mar 2021 11:59:50 +0100 Subject: [PATCH 5/9] test(_mapdata): add Arch Linux verification file --- .../files/_mapdata/arch-base-latest.yaml | 109 ++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 test/integration/v3002-py3/files/_mapdata/arch-base-latest.yaml diff --git a/test/integration/v3002-py3/files/_mapdata/arch-base-latest.yaml b/test/integration/v3002-py3/files/_mapdata/arch-base-latest.yaml new file mode 100644 index 0000000..feb3c4f --- /dev/null +++ b/test/integration/v3002-py3/files/_mapdata/arch-base-latest.yaml @@ -0,0 +1,109 @@ +# yamllint disable rule:indentation rule:line-length +# Arch +--- +values: + formulas_settings: + checkout_orig_branch: false + git_opts: + default: + basedir: /srv/formulas + baseurl: https://github.com/saltstack-formulas + options: + output_loglevel: quiet + rev: master + update: false + list: {} + salt_settings: + api_service: salt-api + api_service_details: + enabled: true + state: running + clean_config_d_dir: true + cloud: + template_sources: + maps: salt://salt/files/cloud.maps.d + profiles: salt://salt/files/cloud.profiles.d + providers: salt://salt/files/cloud.providers.d + config_path: /etc/salt + gitfs: + dulwich: + install_from_source: true + gitpython: + install_from_source: false + pygit2: + git: + install_from_package: git + require_state: false + install_from_source: true + libgit2: + build_parent_dir: /usr/src/ + download_hash: 683d1164e361e2a0a8d52652840e2340 + install_from_source: true + version: 0.23.0 + version: 0.23.0 + install_packages: true + libgit2: libgit2 + master: + ext_pillar: + - cmd_yaml: cat /etc/salt/yaml + - stack: + - /path/to/stack1.cfg + - /path/to/stack2.cfg + - reclass: + inventory_base_uri: /etc/reclass + file_roots: + base: + - /srv/salt + fileserver_backend: + - rootfs + gitfs_provider: gitpython + pillar_roots: + base: + - /srv/pillar + master_config_use_TOFS: false + master_remove_config: false + master_service: salt-master + master_service_details: + enabled: true + state: running + minion: + file_roots: + base: + - /srv/salt + fileserver_backend: + - rootfs + master: localhost + master_type: true + pillar_roots: + base: + - /srv/pillar + minion_config_use_TOFS: false + minion_remove_config: false + minion_service: salt-minion + minion_service_details: + enabled: true + state: running + parallel: true + pin_version: false + pkgrepo: '' + py_ver: py3 + pygit2: python2-pygit2 + pyinotify: python2-pyinotify + python_dulwich: python-dulwich + python_git: python2-gitpython + release: '3002' + restart_via_at: false + rootgroup: root + rootuser: root + salt_api: salt + salt_cloud: salt + salt_master: salt + salt_master_macos_plist_hash: '' + salt_minion: salt + salt_minion_macos_plist_hash: '' + salt_ssh: salt + salt_syndic: salt + ssh_roster: {} + syndic_service: salt-syndic + use_pip: false + version: '' From bbd7286240c2f604e9c1a6bb027e696fc973f74f Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Fri, 26 Mar 2021 17:59:40 +0000 Subject: [PATCH 6/9] refactor(retry_options): provide options from defaults/pillar --- pillar.example | 7 +++++++ salt/defaults.yaml | 7 +++++++ salt/master.sls | 6 +----- salt/minion.sls | 12 ++---------- .../v3000-py2/files/_mapdata/ubuntu-16.yaml | 5 +++++ .../v3000-py2/files/_mapdata/ubuntu-18.yaml | 5 +++++ .../v3000-py3/files/_mapdata/amazonlinux-2.yaml | 5 +++++ .../v3000-py3/files/_mapdata/centos-7.yaml | 5 +++++ .../v3000-py3/files/_mapdata/centos-8.yaml | 5 +++++ .../v3000-py3/files/_mapdata/debian-10.yaml | 5 +++++ .../v3000-py3/files/_mapdata/debian-9.yaml | 5 +++++ .../v3000-py3/files/_mapdata/gentoo-2-sysd.yaml | 5 +++++ .../v3000-py3/files/_mapdata/gentoo-2-sysv.yaml | 5 +++++ .../v3000-py3/files/_mapdata/opensuse-15.yaml | 5 +++++ .../v3000-py3/files/_mapdata/oraclelinux-7.yaml | 5 +++++ .../v3000-py3/files/_mapdata/oraclelinux-8.yaml | 5 +++++ .../v3000-py3/files/_mapdata/ubuntu-16.yaml | 5 +++++ .../v3000-py3/files/_mapdata/ubuntu-18.yaml | 5 +++++ .../files/_mapdata/windows-2019-server.yaml | 5 +++++ .../v3001-py3/files/_mapdata/amazonlinux-2.yaml | 5 +++++ .../v3001-py3/files/_mapdata/centos-7.yaml | 5 +++++ .../v3001-py3/files/_mapdata/centos-8.yaml | 5 +++++ .../v3001-py3/files/_mapdata/debian-10.yaml | 5 +++++ .../v3001-py3/files/_mapdata/debian-9.yaml | 5 +++++ .../v3001-py3/files/_mapdata/fedora-32.yaml | 5 +++++ .../v3001-py3/files/_mapdata/fedora-33.yaml | 5 +++++ .../v3001-py3/files/_mapdata/gentoo-2-sysd.yaml | 5 +++++ .../v3001-py3/files/_mapdata/gentoo-2-sysv.yaml | 5 +++++ .../v3001-py3/files/_mapdata/opensuse-15.yaml | 5 +++++ .../files/_mapdata/opensuse-tumbleweed.yaml | 5 +++++ .../v3001-py3/files/_mapdata/oraclelinux-7.yaml | 5 +++++ .../v3001-py3/files/_mapdata/oraclelinux-8.yaml | 5 +++++ .../v3001-py3/files/_mapdata/ubuntu-16.yaml | 5 +++++ .../v3001-py3/files/_mapdata/ubuntu-18.yaml | 5 +++++ .../v3001-py3/files/_mapdata/ubuntu-20.yaml | 5 +++++ .../v3002-py3/files/_mapdata/amazonlinux-2.yaml | 5 +++++ .../v3002-py3/files/_mapdata/arch-base-latest.yaml | 5 +++++ .../v3002-py3/files/_mapdata/centos-7.yaml | 5 +++++ .../v3002-py3/files/_mapdata/centos-8.yaml | 5 +++++ .../v3002-py3/files/_mapdata/debian-10.yaml | 5 +++++ .../v3002-py3/files/_mapdata/debian-9.yaml | 5 +++++ .../v3002-py3/files/_mapdata/fedora-32.yaml | 5 +++++ .../v3002-py3/files/_mapdata/fedora-33.yaml | 5 +++++ .../v3002-py3/files/_mapdata/gentoo-2-sysd.yaml | 5 +++++ .../v3002-py3/files/_mapdata/gentoo-2-sysv.yaml | 5 +++++ .../v3002-py3/files/_mapdata/opensuse-15.yaml | 5 +++++ .../files/_mapdata/opensuse-tumbleweed.yaml | 5 +++++ .../v3002-py3/files/_mapdata/oraclelinux-7.yaml | 5 +++++ .../v3002-py3/files/_mapdata/oraclelinux-8.yaml | 5 +++++ .../v3002-py3/files/_mapdata/ubuntu-16.yaml | 5 +++++ .../v3002-py3/files/_mapdata/ubuntu-18.yaml | 5 +++++ .../v3002-py3/files/_mapdata/ubuntu-20.yaml | 5 +++++ .../files/_mapdata/windows-2016-server.yaml | 5 +++++ .../files/_mapdata/windows-2019-server.yaml | 5 +++++ .../v3002-py3/files/_mapdata/windows-8.yaml | 5 +++++ 55 files changed, 272 insertions(+), 15 deletions(-) diff --git a/pillar.example b/pillar.example index 5860152..748eb27 100644 --- a/pillar.example +++ b/pillar.example @@ -369,6 +369,13 @@ salt: - 'deploy': - /srv/salt/reactors/deploy.sls + # https://docs.saltstack.com/en/latest/ref/states/requisites.html#retrying-states + retry_options: + attempts: 2 + until: true + interval: 10 + splay: 10 + salt_cloud_certs: aws: pem: | diff --git a/salt/defaults.yaml b/salt/defaults.yaml index b35c418..cc225c1 100644 --- a/salt/defaults.yaml +++ b/salt/defaults.yaml @@ -85,6 +85,13 @@ salt: profiles: salt://salt/files/cloud.profiles.d maps: salt://salt/files/cloud.maps.d + # https://docs.saltstack.com/en/latest/ref/states/requisites.html#retrying-states + retry_options: + attempts: 2 + until: true + interval: 10 + splay: 10 + salt_formulas: list: {} # via pillar data checkout_orig_branch: false diff --git a/salt/master.sls b/salt/master.sls index 3a6835d..13cc5a8 100644 --- a/salt/master.sls +++ b/salt/master.sls @@ -15,11 +15,7 @@ salt-master-macos: - name: /Library/LaunchDaemons/com.saltstack.salt.master.plist - source: https://raw.githubusercontent.com/saltstack/salt/master/pkg/osx/scripts/com.saltstack.salt.master.plist - source_hash: {{ salt_settings.salt_master_macos_plist_hash }} - - retry: - attempts: 2 - until: True - interval: 10 - splay: 10 + - retry: {{ salt_settings.retry_options | json }} - require_in: - service: salt-master {%- endif %} diff --git a/salt/minion.sls b/salt/minion.sls index 0963282..a672aaf 100644 --- a/salt/minion.sls +++ b/salt/minion.sls @@ -27,11 +27,7 @@ download-salt-minion: - test -n "{{ salt_settings.version }}" && '/opt/salt/bin/salt-minion --version=.*{{ salt_settings.version }}.*' - require_in: - macpackage: salt-minion - - retry: - attempts: 2 - until: True - interval: 10 - splay: 10 + - retry: {{ salt_settings.retry_options | json }} {%- elif "workaround https://github.com/saltstack/salt/issues/49348" %} cmd.run: - name: /usr/local/bin/brew install {{ salt_settings.salt_minion }} @@ -45,11 +41,7 @@ salt-minion-macos: - name: /Library/LaunchDaemons/com.saltstack.salt.minion.plist - source: https://raw.githubusercontent.com/saltstack/salt/master/pkg/osx/scripts/com.saltstack.salt.master.plist - source_hash: {{ salt_settings.salt_minion_macos_plist_hash }} - - retry: - attempts: 2 - until: True - interval: 10 - splay: 10 + - retry: {{ salt_settings.retry_options | json }} - require_in: - service: salt-minion - watch_in: diff --git a/test/integration/v3000-py2/files/_mapdata/ubuntu-16.yaml b/test/integration/v3000-py2/files/_mapdata/ubuntu-16.yaml index ba55dc8..331ddc4 100644 --- a/test/integration/v3000-py2/files/_mapdata/ubuntu-16.yaml +++ b/test/integration/v3000-py2/files/_mapdata/ubuntu-16.yaml @@ -94,6 +94,11 @@ values: python_git: python-git release: '3000' restart_via_at: false + retry_options: + attempts: 2 + interval: 10 + splay: 10 + until: true rootgroup: root rootuser: root salt_api: salt-api diff --git a/test/integration/v3000-py2/files/_mapdata/ubuntu-18.yaml b/test/integration/v3000-py2/files/_mapdata/ubuntu-18.yaml index f099f27..5660023 100644 --- a/test/integration/v3000-py2/files/_mapdata/ubuntu-18.yaml +++ b/test/integration/v3000-py2/files/_mapdata/ubuntu-18.yaml @@ -94,6 +94,11 @@ values: python_git: python-git release: '3000' restart_via_at: false + retry_options: + attempts: 2 + interval: 10 + splay: 10 + until: true rootgroup: root rootuser: root salt_api: salt-api diff --git a/test/integration/v3000-py3/files/_mapdata/amazonlinux-2.yaml b/test/integration/v3000-py3/files/_mapdata/amazonlinux-2.yaml index 21239a9..a3e84ea 100644 --- a/test/integration/v3000-py3/files/_mapdata/amazonlinux-2.yaml +++ b/test/integration/v3000-py3/files/_mapdata/amazonlinux-2.yaml @@ -94,6 +94,11 @@ values: python_git: GitPython release: '3000' restart_via_at: false + retry_options: + attempts: 2 + interval: 10 + splay: 10 + until: true rootgroup: root rootuser: root salt_api: salt-api diff --git a/test/integration/v3000-py3/files/_mapdata/centos-7.yaml b/test/integration/v3000-py3/files/_mapdata/centos-7.yaml index 3ea4b2d..807aa83 100644 --- a/test/integration/v3000-py3/files/_mapdata/centos-7.yaml +++ b/test/integration/v3000-py3/files/_mapdata/centos-7.yaml @@ -94,6 +94,11 @@ values: python_git: GitPython release: '3000' restart_via_at: false + retry_options: + attempts: 2 + interval: 10 + splay: 10 + until: true rootgroup: root rootuser: root salt_api: salt-api diff --git a/test/integration/v3000-py3/files/_mapdata/centos-8.yaml b/test/integration/v3000-py3/files/_mapdata/centos-8.yaml index 4e3e209..ece7d0e 100644 --- a/test/integration/v3000-py3/files/_mapdata/centos-8.yaml +++ b/test/integration/v3000-py3/files/_mapdata/centos-8.yaml @@ -94,6 +94,11 @@ values: python_git: GitPython release: '3000' restart_via_at: false + retry_options: + attempts: 2 + interval: 10 + splay: 10 + until: true rootgroup: root rootuser: root salt_api: salt-api diff --git a/test/integration/v3000-py3/files/_mapdata/debian-10.yaml b/test/integration/v3000-py3/files/_mapdata/debian-10.yaml index e94449e..d0c1007 100644 --- a/test/integration/v3000-py3/files/_mapdata/debian-10.yaml +++ b/test/integration/v3000-py3/files/_mapdata/debian-10.yaml @@ -93,6 +93,11 @@ values: python_git: python-git release: '3000' restart_via_at: false + retry_options: + attempts: 2 + interval: 10 + splay: 10 + until: true rootgroup: root rootuser: root salt_api: salt-api diff --git a/test/integration/v3000-py3/files/_mapdata/debian-9.yaml b/test/integration/v3000-py3/files/_mapdata/debian-9.yaml index 5b6a56f..2d810e8 100644 --- a/test/integration/v3000-py3/files/_mapdata/debian-9.yaml +++ b/test/integration/v3000-py3/files/_mapdata/debian-9.yaml @@ -93,6 +93,11 @@ values: python_git: python-git release: '3000' restart_via_at: false + retry_options: + attempts: 2 + interval: 10 + splay: 10 + until: true rootgroup: root rootuser: root salt_api: salt-api diff --git a/test/integration/v3000-py3/files/_mapdata/gentoo-2-sysd.yaml b/test/integration/v3000-py3/files/_mapdata/gentoo-2-sysd.yaml index 2e57c32..0f27eaa 100644 --- a/test/integration/v3000-py3/files/_mapdata/gentoo-2-sysd.yaml +++ b/test/integration/v3000-py3/files/_mapdata/gentoo-2-sysd.yaml @@ -91,6 +91,11 @@ values: python_git: python-git release: '3000' restart_via_at: false + retry_options: + attempts: 2 + interval: 10 + splay: 10 + until: true rootgroup: root rootuser: root salt_api: app-admin/salt diff --git a/test/integration/v3000-py3/files/_mapdata/gentoo-2-sysv.yaml b/test/integration/v3000-py3/files/_mapdata/gentoo-2-sysv.yaml index 2e57c32..0f27eaa 100644 --- a/test/integration/v3000-py3/files/_mapdata/gentoo-2-sysv.yaml +++ b/test/integration/v3000-py3/files/_mapdata/gentoo-2-sysv.yaml @@ -91,6 +91,11 @@ values: python_git: python-git release: '3000' restart_via_at: false + retry_options: + attempts: 2 + interval: 10 + splay: 10 + until: true rootgroup: root rootuser: root salt_api: app-admin/salt diff --git a/test/integration/v3000-py3/files/_mapdata/opensuse-15.yaml b/test/integration/v3000-py3/files/_mapdata/opensuse-15.yaml index 9b1b79c..41aa635 100644 --- a/test/integration/v3000-py3/files/_mapdata/opensuse-15.yaml +++ b/test/integration/v3000-py3/files/_mapdata/opensuse-15.yaml @@ -94,6 +94,11 @@ values: python_git: python-git release: '3000' restart_via_at: false + retry_options: + attempts: 2 + interval: 10 + splay: 10 + until: true rootgroup: root rootuser: root salt_api: salt-api diff --git a/test/integration/v3000-py3/files/_mapdata/oraclelinux-7.yaml b/test/integration/v3000-py3/files/_mapdata/oraclelinux-7.yaml index 71c6a04..74a55ec 100644 --- a/test/integration/v3000-py3/files/_mapdata/oraclelinux-7.yaml +++ b/test/integration/v3000-py3/files/_mapdata/oraclelinux-7.yaml @@ -94,6 +94,11 @@ values: python_git: GitPython release: '3000' restart_via_at: false + retry_options: + attempts: 2 + interval: 10 + splay: 10 + until: true rootgroup: root rootuser: root salt_api: salt-api diff --git a/test/integration/v3000-py3/files/_mapdata/oraclelinux-8.yaml b/test/integration/v3000-py3/files/_mapdata/oraclelinux-8.yaml index 29b8400..d5edf93 100644 --- a/test/integration/v3000-py3/files/_mapdata/oraclelinux-8.yaml +++ b/test/integration/v3000-py3/files/_mapdata/oraclelinux-8.yaml @@ -94,6 +94,11 @@ values: python_git: GitPython release: '3000' restart_via_at: false + retry_options: + attempts: 2 + interval: 10 + splay: 10 + until: true rootgroup: root rootuser: root salt_api: salt-api diff --git a/test/integration/v3000-py3/files/_mapdata/ubuntu-16.yaml b/test/integration/v3000-py3/files/_mapdata/ubuntu-16.yaml index 09ce99c..398f0f5 100644 --- a/test/integration/v3000-py3/files/_mapdata/ubuntu-16.yaml +++ b/test/integration/v3000-py3/files/_mapdata/ubuntu-16.yaml @@ -94,6 +94,11 @@ values: python_git: python-git release: '3000' restart_via_at: false + retry_options: + attempts: 2 + interval: 10 + splay: 10 + until: true rootgroup: root rootuser: root salt_api: salt-api diff --git a/test/integration/v3000-py3/files/_mapdata/ubuntu-18.yaml b/test/integration/v3000-py3/files/_mapdata/ubuntu-18.yaml index 08ed091..71289e7 100644 --- a/test/integration/v3000-py3/files/_mapdata/ubuntu-18.yaml +++ b/test/integration/v3000-py3/files/_mapdata/ubuntu-18.yaml @@ -94,6 +94,11 @@ values: python_git: python-git release: '3000' restart_via_at: false + retry_options: + attempts: 2 + interval: 10 + splay: 10 + until: true rootgroup: root rootuser: root salt_api: salt-api diff --git a/test/integration/v3000-py3/files/_mapdata/windows-2019-server.yaml b/test/integration/v3000-py3/files/_mapdata/windows-2019-server.yaml index 4f3b4f3..f62d876 100644 --- a/test/integration/v3000-py3/files/_mapdata/windows-2019-server.yaml +++ b/test/integration/v3000-py3/files/_mapdata/windows-2019-server.yaml @@ -90,6 +90,11 @@ values: python_git: python-git release: '3000' restart_via_at: false + retry_options: + attempts: 2 + interval: 10 + splay: 10 + until: true rootgroup: root rootuser: kitchen salt_api: salt-api diff --git a/test/integration/v3001-py3/files/_mapdata/amazonlinux-2.yaml b/test/integration/v3001-py3/files/_mapdata/amazonlinux-2.yaml index 7df717e..c80a024 100644 --- a/test/integration/v3001-py3/files/_mapdata/amazonlinux-2.yaml +++ b/test/integration/v3001-py3/files/_mapdata/amazonlinux-2.yaml @@ -94,6 +94,11 @@ values: python_git: GitPython release: '3001' restart_via_at: false + retry_options: + attempts: 2 + interval: 10 + splay: 10 + until: true rootgroup: root rootuser: root salt_api: salt-api diff --git a/test/integration/v3001-py3/files/_mapdata/centos-7.yaml b/test/integration/v3001-py3/files/_mapdata/centos-7.yaml index 88806c0..961ca8b 100644 --- a/test/integration/v3001-py3/files/_mapdata/centos-7.yaml +++ b/test/integration/v3001-py3/files/_mapdata/centos-7.yaml @@ -94,6 +94,11 @@ values: python_git: GitPython release: '3001' restart_via_at: false + retry_options: + attempts: 2 + interval: 10 + splay: 10 + until: true rootgroup: root rootuser: root salt_api: salt-api diff --git a/test/integration/v3001-py3/files/_mapdata/centos-8.yaml b/test/integration/v3001-py3/files/_mapdata/centos-8.yaml index 8d68a74..c99d3a0 100644 --- a/test/integration/v3001-py3/files/_mapdata/centos-8.yaml +++ b/test/integration/v3001-py3/files/_mapdata/centos-8.yaml @@ -94,6 +94,11 @@ values: python_git: GitPython release: '3001' restart_via_at: false + retry_options: + attempts: 2 + interval: 10 + splay: 10 + until: true rootgroup: root rootuser: root salt_api: salt-api diff --git a/test/integration/v3001-py3/files/_mapdata/debian-10.yaml b/test/integration/v3001-py3/files/_mapdata/debian-10.yaml index fe4ecc5..6334d69 100644 --- a/test/integration/v3001-py3/files/_mapdata/debian-10.yaml +++ b/test/integration/v3001-py3/files/_mapdata/debian-10.yaml @@ -93,6 +93,11 @@ values: python_git: python-git release: '3001' restart_via_at: false + retry_options: + attempts: 2 + interval: 10 + splay: 10 + until: true rootgroup: root rootuser: root salt_api: salt-api diff --git a/test/integration/v3001-py3/files/_mapdata/debian-9.yaml b/test/integration/v3001-py3/files/_mapdata/debian-9.yaml index 5f67a36..589601d 100644 --- a/test/integration/v3001-py3/files/_mapdata/debian-9.yaml +++ b/test/integration/v3001-py3/files/_mapdata/debian-9.yaml @@ -93,6 +93,11 @@ values: python_git: python-git release: '3001' restart_via_at: false + retry_options: + attempts: 2 + interval: 10 + splay: 10 + until: true rootgroup: root rootuser: root salt_api: salt-api diff --git a/test/integration/v3001-py3/files/_mapdata/fedora-32.yaml b/test/integration/v3001-py3/files/_mapdata/fedora-32.yaml index be8c9f3..37a5882 100644 --- a/test/integration/v3001-py3/files/_mapdata/fedora-32.yaml +++ b/test/integration/v3001-py3/files/_mapdata/fedora-32.yaml @@ -94,6 +94,11 @@ values: python_git: GitPython release: '3001' restart_via_at: false + retry_options: + attempts: 2 + interval: 10 + splay: 10 + until: true rootgroup: root rootuser: root salt_api: salt-api diff --git a/test/integration/v3001-py3/files/_mapdata/fedora-33.yaml b/test/integration/v3001-py3/files/_mapdata/fedora-33.yaml index 2a4690e..3ea0c28 100644 --- a/test/integration/v3001-py3/files/_mapdata/fedora-33.yaml +++ b/test/integration/v3001-py3/files/_mapdata/fedora-33.yaml @@ -94,6 +94,11 @@ values: python_git: GitPython release: '3001' restart_via_at: false + retry_options: + attempts: 2 + interval: 10 + splay: 10 + until: true rootgroup: root rootuser: root salt_api: salt-api diff --git a/test/integration/v3001-py3/files/_mapdata/gentoo-2-sysd.yaml b/test/integration/v3001-py3/files/_mapdata/gentoo-2-sysd.yaml index 9e2168b..976c00c 100644 --- a/test/integration/v3001-py3/files/_mapdata/gentoo-2-sysd.yaml +++ b/test/integration/v3001-py3/files/_mapdata/gentoo-2-sysd.yaml @@ -91,6 +91,11 @@ values: python_git: python-git release: '3001' restart_via_at: false + retry_options: + attempts: 2 + interval: 10 + splay: 10 + until: true rootgroup: root rootuser: root salt_api: app-admin/salt diff --git a/test/integration/v3001-py3/files/_mapdata/gentoo-2-sysv.yaml b/test/integration/v3001-py3/files/_mapdata/gentoo-2-sysv.yaml index 9e2168b..976c00c 100644 --- a/test/integration/v3001-py3/files/_mapdata/gentoo-2-sysv.yaml +++ b/test/integration/v3001-py3/files/_mapdata/gentoo-2-sysv.yaml @@ -91,6 +91,11 @@ values: python_git: python-git release: '3001' restart_via_at: false + retry_options: + attempts: 2 + interval: 10 + splay: 10 + until: true rootgroup: root rootuser: root salt_api: app-admin/salt diff --git a/test/integration/v3001-py3/files/_mapdata/opensuse-15.yaml b/test/integration/v3001-py3/files/_mapdata/opensuse-15.yaml index cbcaf2b..09a52a2 100644 --- a/test/integration/v3001-py3/files/_mapdata/opensuse-15.yaml +++ b/test/integration/v3001-py3/files/_mapdata/opensuse-15.yaml @@ -94,6 +94,11 @@ values: python_git: python-git release: '3001' restart_via_at: false + retry_options: + attempts: 2 + interval: 10 + splay: 10 + until: true rootgroup: root rootuser: root salt_api: salt-api diff --git a/test/integration/v3001-py3/files/_mapdata/opensuse-tumbleweed.yaml b/test/integration/v3001-py3/files/_mapdata/opensuse-tumbleweed.yaml index 73f7f5a..a6c8a6d 100644 --- a/test/integration/v3001-py3/files/_mapdata/opensuse-tumbleweed.yaml +++ b/test/integration/v3001-py3/files/_mapdata/opensuse-tumbleweed.yaml @@ -94,6 +94,11 @@ values: python_git: python-git release: '3001' restart_via_at: false + retry_options: + attempts: 2 + interval: 10 + splay: 10 + until: true rootgroup: root rootuser: root salt_api: salt-api diff --git a/test/integration/v3001-py3/files/_mapdata/oraclelinux-7.yaml b/test/integration/v3001-py3/files/_mapdata/oraclelinux-7.yaml index cb2d895..7ad70f6 100644 --- a/test/integration/v3001-py3/files/_mapdata/oraclelinux-7.yaml +++ b/test/integration/v3001-py3/files/_mapdata/oraclelinux-7.yaml @@ -94,6 +94,11 @@ values: python_git: GitPython release: '3001' restart_via_at: false + retry_options: + attempts: 2 + interval: 10 + splay: 10 + until: true rootgroup: root rootuser: root salt_api: salt-api diff --git a/test/integration/v3001-py3/files/_mapdata/oraclelinux-8.yaml b/test/integration/v3001-py3/files/_mapdata/oraclelinux-8.yaml index 1027a5c..ae7f877 100644 --- a/test/integration/v3001-py3/files/_mapdata/oraclelinux-8.yaml +++ b/test/integration/v3001-py3/files/_mapdata/oraclelinux-8.yaml @@ -94,6 +94,11 @@ values: python_git: GitPython release: '3001' restart_via_at: false + retry_options: + attempts: 2 + interval: 10 + splay: 10 + until: true rootgroup: root rootuser: root salt_api: salt-api diff --git a/test/integration/v3001-py3/files/_mapdata/ubuntu-16.yaml b/test/integration/v3001-py3/files/_mapdata/ubuntu-16.yaml index 4959e5e..09739e1 100644 --- a/test/integration/v3001-py3/files/_mapdata/ubuntu-16.yaml +++ b/test/integration/v3001-py3/files/_mapdata/ubuntu-16.yaml @@ -94,6 +94,11 @@ values: python_git: python-git release: '3001' restart_via_at: false + retry_options: + attempts: 2 + interval: 10 + splay: 10 + until: true rootgroup: root rootuser: root salt_api: salt-api diff --git a/test/integration/v3001-py3/files/_mapdata/ubuntu-18.yaml b/test/integration/v3001-py3/files/_mapdata/ubuntu-18.yaml index 0f0b46b..0e4dbef 100644 --- a/test/integration/v3001-py3/files/_mapdata/ubuntu-18.yaml +++ b/test/integration/v3001-py3/files/_mapdata/ubuntu-18.yaml @@ -94,6 +94,11 @@ values: python_git: python-git release: '3001' restart_via_at: false + retry_options: + attempts: 2 + interval: 10 + splay: 10 + until: true rootgroup: root rootuser: root salt_api: salt-api diff --git a/test/integration/v3001-py3/files/_mapdata/ubuntu-20.yaml b/test/integration/v3001-py3/files/_mapdata/ubuntu-20.yaml index 9f1a5d5..d3755d7 100644 --- a/test/integration/v3001-py3/files/_mapdata/ubuntu-20.yaml +++ b/test/integration/v3001-py3/files/_mapdata/ubuntu-20.yaml @@ -94,6 +94,11 @@ values: python_git: python-git release: '3001' restart_via_at: false + retry_options: + attempts: 2 + interval: 10 + splay: 10 + until: true rootgroup: root rootuser: root salt_api: salt-api diff --git a/test/integration/v3002-py3/files/_mapdata/amazonlinux-2.yaml b/test/integration/v3002-py3/files/_mapdata/amazonlinux-2.yaml index 2451643..238322f 100644 --- a/test/integration/v3002-py3/files/_mapdata/amazonlinux-2.yaml +++ b/test/integration/v3002-py3/files/_mapdata/amazonlinux-2.yaml @@ -94,6 +94,11 @@ values: python_git: GitPython release: '3002' restart_via_at: false + retry_options: + attempts: 5 + interval: 10 + splay: 10 + until: true rootgroup: root rootuser: root salt_api: salt-api diff --git a/test/integration/v3002-py3/files/_mapdata/arch-base-latest.yaml b/test/integration/v3002-py3/files/_mapdata/arch-base-latest.yaml index feb3c4f..58cc040 100644 --- a/test/integration/v3002-py3/files/_mapdata/arch-base-latest.yaml +++ b/test/integration/v3002-py3/files/_mapdata/arch-base-latest.yaml @@ -93,6 +93,11 @@ values: python_git: python2-gitpython release: '3002' restart_via_at: false + retry_options: + attempts: 5 + interval: 10 + splay: 10 + until: true rootgroup: root rootuser: root salt_api: salt diff --git a/test/integration/v3002-py3/files/_mapdata/centos-7.yaml b/test/integration/v3002-py3/files/_mapdata/centos-7.yaml index e181430..52fcc3b 100644 --- a/test/integration/v3002-py3/files/_mapdata/centos-7.yaml +++ b/test/integration/v3002-py3/files/_mapdata/centos-7.yaml @@ -94,6 +94,11 @@ values: python_git: GitPython release: '3002' restart_via_at: false + retry_options: + attempts: 5 + interval: 10 + splay: 10 + until: true rootgroup: root rootuser: root salt_api: salt-api diff --git a/test/integration/v3002-py3/files/_mapdata/centos-8.yaml b/test/integration/v3002-py3/files/_mapdata/centos-8.yaml index 93d8311..303d853 100644 --- a/test/integration/v3002-py3/files/_mapdata/centos-8.yaml +++ b/test/integration/v3002-py3/files/_mapdata/centos-8.yaml @@ -94,6 +94,11 @@ values: python_git: GitPython release: '3002' restart_via_at: false + retry_options: + attempts: 5 + interval: 10 + splay: 10 + until: true rootgroup: root rootuser: root salt_api: salt-api diff --git a/test/integration/v3002-py3/files/_mapdata/debian-10.yaml b/test/integration/v3002-py3/files/_mapdata/debian-10.yaml index cf4a608..7ab5075 100644 --- a/test/integration/v3002-py3/files/_mapdata/debian-10.yaml +++ b/test/integration/v3002-py3/files/_mapdata/debian-10.yaml @@ -93,6 +93,11 @@ values: python_git: python-git release: '3002' restart_via_at: false + retry_options: + attempts: 5 + interval: 10 + splay: 10 + until: true rootgroup: root rootuser: root salt_api: salt-api diff --git a/test/integration/v3002-py3/files/_mapdata/debian-9.yaml b/test/integration/v3002-py3/files/_mapdata/debian-9.yaml index 6681f68..1119a48 100644 --- a/test/integration/v3002-py3/files/_mapdata/debian-9.yaml +++ b/test/integration/v3002-py3/files/_mapdata/debian-9.yaml @@ -93,6 +93,11 @@ values: python_git: python-git release: '3002' restart_via_at: false + retry_options: + attempts: 5 + interval: 10 + splay: 10 + until: true rootgroup: root rootuser: root salt_api: salt-api diff --git a/test/integration/v3002-py3/files/_mapdata/fedora-32.yaml b/test/integration/v3002-py3/files/_mapdata/fedora-32.yaml index b713436..ac21406 100644 --- a/test/integration/v3002-py3/files/_mapdata/fedora-32.yaml +++ b/test/integration/v3002-py3/files/_mapdata/fedora-32.yaml @@ -94,6 +94,11 @@ values: python_git: GitPython release: '3002' restart_via_at: false + retry_options: + attempts: 5 + interval: 10 + splay: 10 + until: true rootgroup: root rootuser: root salt_api: salt-api diff --git a/test/integration/v3002-py3/files/_mapdata/fedora-33.yaml b/test/integration/v3002-py3/files/_mapdata/fedora-33.yaml index 3736f2f..3d83a17 100644 --- a/test/integration/v3002-py3/files/_mapdata/fedora-33.yaml +++ b/test/integration/v3002-py3/files/_mapdata/fedora-33.yaml @@ -94,6 +94,11 @@ values: python_git: GitPython release: '3002' restart_via_at: false + retry_options: + attempts: 5 + interval: 10 + splay: 10 + until: true rootgroup: root rootuser: root salt_api: salt-api diff --git a/test/integration/v3002-py3/files/_mapdata/gentoo-2-sysd.yaml b/test/integration/v3002-py3/files/_mapdata/gentoo-2-sysd.yaml index eff157d..6a3416d 100644 --- a/test/integration/v3002-py3/files/_mapdata/gentoo-2-sysd.yaml +++ b/test/integration/v3002-py3/files/_mapdata/gentoo-2-sysd.yaml @@ -91,6 +91,11 @@ values: python_git: python-git release: '3002' restart_via_at: false + retry_options: + attempts: 5 + interval: 10 + splay: 10 + until: true rootgroup: root rootuser: root salt_api: app-admin/salt diff --git a/test/integration/v3002-py3/files/_mapdata/gentoo-2-sysv.yaml b/test/integration/v3002-py3/files/_mapdata/gentoo-2-sysv.yaml index eff157d..6a3416d 100644 --- a/test/integration/v3002-py3/files/_mapdata/gentoo-2-sysv.yaml +++ b/test/integration/v3002-py3/files/_mapdata/gentoo-2-sysv.yaml @@ -91,6 +91,11 @@ values: python_git: python-git release: '3002' restart_via_at: false + retry_options: + attempts: 5 + interval: 10 + splay: 10 + until: true rootgroup: root rootuser: root salt_api: app-admin/salt diff --git a/test/integration/v3002-py3/files/_mapdata/opensuse-15.yaml b/test/integration/v3002-py3/files/_mapdata/opensuse-15.yaml index 1df95c7..72411fe 100644 --- a/test/integration/v3002-py3/files/_mapdata/opensuse-15.yaml +++ b/test/integration/v3002-py3/files/_mapdata/opensuse-15.yaml @@ -94,6 +94,11 @@ values: python_git: python-git release: '3002' restart_via_at: false + retry_options: + attempts: 5 + interval: 10 + splay: 10 + until: true rootgroup: root rootuser: root salt_api: salt-api diff --git a/test/integration/v3002-py3/files/_mapdata/opensuse-tumbleweed.yaml b/test/integration/v3002-py3/files/_mapdata/opensuse-tumbleweed.yaml index 244d7f2..387251b 100644 --- a/test/integration/v3002-py3/files/_mapdata/opensuse-tumbleweed.yaml +++ b/test/integration/v3002-py3/files/_mapdata/opensuse-tumbleweed.yaml @@ -94,6 +94,11 @@ values: python_git: python-git release: '3002' restart_via_at: false + retry_options: + attempts: 5 + interval: 10 + splay: 10 + until: true rootgroup: root rootuser: root salt_api: salt-api diff --git a/test/integration/v3002-py3/files/_mapdata/oraclelinux-7.yaml b/test/integration/v3002-py3/files/_mapdata/oraclelinux-7.yaml index d0407e2..0602866 100644 --- a/test/integration/v3002-py3/files/_mapdata/oraclelinux-7.yaml +++ b/test/integration/v3002-py3/files/_mapdata/oraclelinux-7.yaml @@ -94,6 +94,11 @@ values: python_git: GitPython release: '3002' restart_via_at: false + retry_options: + attempts: 5 + interval: 10 + splay: 10 + until: true rootgroup: root rootuser: root salt_api: salt-api diff --git a/test/integration/v3002-py3/files/_mapdata/oraclelinux-8.yaml b/test/integration/v3002-py3/files/_mapdata/oraclelinux-8.yaml index ea2572c..01f3949 100644 --- a/test/integration/v3002-py3/files/_mapdata/oraclelinux-8.yaml +++ b/test/integration/v3002-py3/files/_mapdata/oraclelinux-8.yaml @@ -94,6 +94,11 @@ values: python_git: GitPython release: '3002' restart_via_at: false + retry_options: + attempts: 5 + interval: 10 + splay: 10 + until: true rootgroup: root rootuser: root salt_api: salt-api diff --git a/test/integration/v3002-py3/files/_mapdata/ubuntu-16.yaml b/test/integration/v3002-py3/files/_mapdata/ubuntu-16.yaml index 8fca9f2..6d89c6f 100644 --- a/test/integration/v3002-py3/files/_mapdata/ubuntu-16.yaml +++ b/test/integration/v3002-py3/files/_mapdata/ubuntu-16.yaml @@ -94,6 +94,11 @@ values: python_git: python-git release: '3002' restart_via_at: false + retry_options: + attempts: 5 + interval: 10 + splay: 10 + until: true rootgroup: root rootuser: root salt_api: salt-api diff --git a/test/integration/v3002-py3/files/_mapdata/ubuntu-18.yaml b/test/integration/v3002-py3/files/_mapdata/ubuntu-18.yaml index b9b2f8a..e6329eb 100644 --- a/test/integration/v3002-py3/files/_mapdata/ubuntu-18.yaml +++ b/test/integration/v3002-py3/files/_mapdata/ubuntu-18.yaml @@ -94,6 +94,11 @@ values: python_git: python-git release: '3002' restart_via_at: false + retry_options: + attempts: 5 + interval: 10 + splay: 10 + until: true rootgroup: root rootuser: root salt_api: salt-api diff --git a/test/integration/v3002-py3/files/_mapdata/ubuntu-20.yaml b/test/integration/v3002-py3/files/_mapdata/ubuntu-20.yaml index 3060276..e87d9ef 100644 --- a/test/integration/v3002-py3/files/_mapdata/ubuntu-20.yaml +++ b/test/integration/v3002-py3/files/_mapdata/ubuntu-20.yaml @@ -94,6 +94,11 @@ values: python_git: python-git release: '3002' restart_via_at: false + retry_options: + attempts: 5 + interval: 10 + splay: 10 + until: true rootgroup: root rootuser: root salt_api: salt-api diff --git a/test/integration/v3002-py3/files/_mapdata/windows-2016-server.yaml b/test/integration/v3002-py3/files/_mapdata/windows-2016-server.yaml index dbd4c6a..a9396b9 100644 --- a/test/integration/v3002-py3/files/_mapdata/windows-2016-server.yaml +++ b/test/integration/v3002-py3/files/_mapdata/windows-2016-server.yaml @@ -90,6 +90,11 @@ values: python_git: python-git release: '3002' restart_via_at: false + retry_options: + attempts: 5 + interval: 10 + splay: 10 + until: true rootgroup: root rootuser: kitchen salt_api: salt-api diff --git a/test/integration/v3002-py3/files/_mapdata/windows-2019-server.yaml b/test/integration/v3002-py3/files/_mapdata/windows-2019-server.yaml index 80ab0b9..df3a49a 100644 --- a/test/integration/v3002-py3/files/_mapdata/windows-2019-server.yaml +++ b/test/integration/v3002-py3/files/_mapdata/windows-2019-server.yaml @@ -90,6 +90,11 @@ values: python_git: python-git release: '3002' restart_via_at: false + retry_options: + attempts: 5 + interval: 10 + splay: 10 + until: true rootgroup: root rootuser: kitchen salt_api: salt-api diff --git a/test/integration/v3002-py3/files/_mapdata/windows-8.yaml b/test/integration/v3002-py3/files/_mapdata/windows-8.yaml index 3fe2a3c..c2e81af 100644 --- a/test/integration/v3002-py3/files/_mapdata/windows-8.yaml +++ b/test/integration/v3002-py3/files/_mapdata/windows-8.yaml @@ -90,6 +90,11 @@ values: python_git: python-git release: '3002' restart_via_at: false + retry_options: + attempts: 5 + interval: 10 + splay: 10 + until: true rootgroup: root rootuser: vagrant salt_api: salt-api From 24ebbb4e0c44a34fa3b20379306be67b5c03fbbe Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Tue, 30 Mar 2021 11:57:51 +0100 Subject: [PATCH 7/9] fix(freebsd): update to provide support for most recent versions --- salt/master.sls | 3 + salt/minion.sls | 6 + salt/osmap.yaml | 11 ++ .../v3002-py3/files/_mapdata/freebsd-11.yaml | 112 ++++++++++++++++++ .../v3002-py3/files/_mapdata/freebsd-12.yaml | 112 ++++++++++++++++++ test/salt/pillar/v3002-py3.sls | 7 ++ 6 files changed, 251 insertions(+) create mode 100644 test/integration/v3002-py3/files/_mapdata/freebsd-11.yaml create mode 100644 test/integration/v3002-py3/files/_mapdata/freebsd-12.yaml diff --git a/salt/master.sls b/salt/master.sls index 13cc5a8..81902df 100644 --- a/salt/master.sls +++ b/salt/master.sls @@ -27,6 +27,9 @@ salt-master: {%- if salt_settings.version is defined %} - version: {{ salt_settings.version }} {%- endif %} + {%- if grains.os_family == 'FreeBSD' %} + - unless: pkg info | grep {{ salt_settings.salt_master }} + {%- endif %} {% if salt_settings.master_service_details.state != 'ignore' %} - require_in: - service: salt-master diff --git a/salt/minion.sls b/salt/minion.sls index a672aaf..676ce42 100644 --- a/salt/minion.sls +++ b/salt/minion.sls @@ -71,6 +71,9 @@ salt-minion: {%- if salt_settings.version %} - version: {{ salt_settings.version }} {%- endif %} + {%- if grains.os_family == 'FreeBSD' %} + - unless: pkg info | grep {{ salt_settings.salt_master }} + {%- endif %} {% if salt_settings.minion_service_details.state != 'ignore' %} - require_in: - service: salt-minion @@ -97,6 +100,9 @@ salt-minion: service.{{ salt_settings.minion_service_details.state }}: - enable: {{ salt_settings.minion_service_details.enabled }} - name: {{ salt_settings.minion_service }} + {%- if grains.os_family == 'FreeBSD' %} + - retry: {{ salt_settings.retry_options | json }} + {%- endif %} - watch: - file: remove-old-minion-conf-file - order: last diff --git a/salt/osmap.yaml b/salt/osmap.yaml index 3eb0b5a..589127c 100644 --- a/salt/osmap.yaml +++ b/salt/osmap.yaml @@ -63,5 +63,16 @@ MacOS: salt_master_macos_plist_hash: 8435331b2d48ca8f0759f216e5b15ec9171a4216b1441328c732c6906728b7c9 salt_minion_macos_plist_hash: 26b33da12e0d8960ee96b488c8352002c22a377c19bf3df3f986a1e49eca8b20 +FreeBSD: + salt_master: py37-salt-3002.6 + salt_minion: py37-salt-3002.6 + salt_syndic: py37-salt-3002.6 + salt_cloud: py37-salt-3002.6 + salt_api: py37-salt-3002.6 + salt_ssh: py37-salt-3002.6 + python_git: py37-GitPython-3.1.11 + pygit2: py37-pygit2-1.3.0 + python_dulwich: py37-dulwich-0.19.16 + Windows: parallel: false # not supported on windows/cygwin diff --git a/test/integration/v3002-py3/files/_mapdata/freebsd-11.yaml b/test/integration/v3002-py3/files/_mapdata/freebsd-11.yaml new file mode 100644 index 0000000..e50ae84 --- /dev/null +++ b/test/integration/v3002-py3/files/_mapdata/freebsd-11.yaml @@ -0,0 +1,112 @@ +# yamllint disable rule:indentation rule:line-length +# FreeBSD-12 +--- +values: + formulas_settings: + checkout_orig_branch: false + git_opts: + default: + basedir: /srv/formulas + baseurl: https://github.com/saltstack-formulas + options: + output_loglevel: quiet + rev: master + update: false + list: {} + salt_settings: + api_service: salt_api + api_service_details: + enabled: true + state: running + clean_config_d_dir: true + cloud: + template_sources: + maps: salt://salt/files/cloud.maps.d + profiles: salt://salt/files/cloud.profiles.d + providers: salt://salt/files/cloud.providers.d + config_path: /usr/local/etc/salt + gitfs: + dulwich: + install_from_source: true + gitpython: + install_from_source: false + pygit2: + git: + install_from_package: git + require_state: false + install_from_source: true + libgit2: + build_parent_dir: /usr/src/ + download_hash: 683d1164e361e2a0a8d52652840e2340 + install_from_source: true + version: 0.23.0 + version: 0.23.0 + install_packages: true + master: + ext_pillar: + - cmd_yaml: cat /etc/salt/yaml + - stack: + - /path/to/stack1.cfg + - /path/to/stack2.cfg + - reclass: + inventory_base_uri: /etc/reclass + file_roots: + base: + - /srv/salt + fileserver_backend: + - rootfs + gitfs_provider: gitpython + pillar_roots: + base: + - /srv/pillar + master_config_use_TOFS: false + master_remove_config: false + master_service: salt_master + master_service_details: + enabled: true + state: running + minion: + file_roots: + base: + - /srv/salt + fileserver_backend: + - rootfs + master: localhost + master_type: true + pillar_roots: + base: + - /srv/pillar + minion_config_use_TOFS: false + minion_remove_config: false + minion_service: salt_minion + minion_service_details: + enabled: true + state: running + parallel: true + pin_version: false + pkgrepo: '' + py_ver: py3 + pygit2: py37-pygit2-1.3.0 + python_dulwich: py37-dulwich-0.19.16 + python_git: py37-GitPython-3.1.11 + release: '3002' + restart_via_at: false + retry_options: + attempts: 5 + interval: 10 + splay: 10 + until: true + rootgroup: wheel + rootuser: root + salt_api: py37-salt-3002.6 + salt_cloud: py37-salt-3002.6 + salt_master: py37-salt-3002.6 + salt_master_macos_plist_hash: '' + salt_minion: py37-salt-3002.6 + salt_minion_macos_plist_hash: '' + salt_ssh: py37-salt-3002.6 + salt_syndic: py37-salt-3002.6 + ssh_roster: {} + syndic_service: salt_syndic + use_pip: false + version: '' diff --git a/test/integration/v3002-py3/files/_mapdata/freebsd-12.yaml b/test/integration/v3002-py3/files/_mapdata/freebsd-12.yaml new file mode 100644 index 0000000..e50ae84 --- /dev/null +++ b/test/integration/v3002-py3/files/_mapdata/freebsd-12.yaml @@ -0,0 +1,112 @@ +# yamllint disable rule:indentation rule:line-length +# FreeBSD-12 +--- +values: + formulas_settings: + checkout_orig_branch: false + git_opts: + default: + basedir: /srv/formulas + baseurl: https://github.com/saltstack-formulas + options: + output_loglevel: quiet + rev: master + update: false + list: {} + salt_settings: + api_service: salt_api + api_service_details: + enabled: true + state: running + clean_config_d_dir: true + cloud: + template_sources: + maps: salt://salt/files/cloud.maps.d + profiles: salt://salt/files/cloud.profiles.d + providers: salt://salt/files/cloud.providers.d + config_path: /usr/local/etc/salt + gitfs: + dulwich: + install_from_source: true + gitpython: + install_from_source: false + pygit2: + git: + install_from_package: git + require_state: false + install_from_source: true + libgit2: + build_parent_dir: /usr/src/ + download_hash: 683d1164e361e2a0a8d52652840e2340 + install_from_source: true + version: 0.23.0 + version: 0.23.0 + install_packages: true + master: + ext_pillar: + - cmd_yaml: cat /etc/salt/yaml + - stack: + - /path/to/stack1.cfg + - /path/to/stack2.cfg + - reclass: + inventory_base_uri: /etc/reclass + file_roots: + base: + - /srv/salt + fileserver_backend: + - rootfs + gitfs_provider: gitpython + pillar_roots: + base: + - /srv/pillar + master_config_use_TOFS: false + master_remove_config: false + master_service: salt_master + master_service_details: + enabled: true + state: running + minion: + file_roots: + base: + - /srv/salt + fileserver_backend: + - rootfs + master: localhost + master_type: true + pillar_roots: + base: + - /srv/pillar + minion_config_use_TOFS: false + minion_remove_config: false + minion_service: salt_minion + minion_service_details: + enabled: true + state: running + parallel: true + pin_version: false + pkgrepo: '' + py_ver: py3 + pygit2: py37-pygit2-1.3.0 + python_dulwich: py37-dulwich-0.19.16 + python_git: py37-GitPython-3.1.11 + release: '3002' + restart_via_at: false + retry_options: + attempts: 5 + interval: 10 + splay: 10 + until: true + rootgroup: wheel + rootuser: root + salt_api: py37-salt-3002.6 + salt_cloud: py37-salt-3002.6 + salt_master: py37-salt-3002.6 + salt_master_macos_plist_hash: '' + salt_minion: py37-salt-3002.6 + salt_minion_macos_plist_hash: '' + salt_ssh: py37-salt-3002.6 + salt_syndic: py37-salt-3002.6 + ssh_roster: {} + syndic_service: salt_syndic + use_pip: false + version: '' diff --git a/test/salt/pillar/v3002-py3.sls b/test/salt/pillar/v3002-py3.sls index aca5306..e9298e8 100644 --- a/test/salt/pillar/v3002-py3.sls +++ b/test/salt/pillar/v3002-py3.sls @@ -4,3 +4,10 @@ salt: release: '3002' py_ver: 'py3' + + # Override used for FreeBSD minion service + retry_options: + attempts: 5 + until: true + interval: 10 + splay: 10 From 61201de8c65663498b6cb1b6f0f154a9af0e691f Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Tue, 30 Mar 2021 11:58:44 +0100 Subject: [PATCH 8/9] fix(openbsd): update to provide support for most recent versions --- salt/osmap.yaml | 6 + .../v3001-py3/files/_mapdata/openbsd-6.yaml | 111 ++++++++++++++++++ 2 files changed, 117 insertions(+) create mode 100644 test/integration/v3001-py3/files/_mapdata/openbsd-6.yaml diff --git a/salt/osmap.yaml b/salt/osmap.yaml index 589127c..de9c8dc 100644 --- a/salt/osmap.yaml +++ b/salt/osmap.yaml @@ -74,5 +74,11 @@ FreeBSD: pygit2: py37-pygit2-1.3.0 python_dulwich: py37-dulwich-0.19.16 +# If `osfingermap.yaml` is introduced in the future, perhaps better to move to there, +# since this is probably specific to `OpenBSD-6` +OpenBSD: + python_git: py3-GitPython + python_dulwich: py3-dulwich + Windows: parallel: false # not supported on windows/cygwin diff --git a/test/integration/v3001-py3/files/_mapdata/openbsd-6.yaml b/test/integration/v3001-py3/files/_mapdata/openbsd-6.yaml new file mode 100644 index 0000000..624f7e5 --- /dev/null +++ b/test/integration/v3001-py3/files/_mapdata/openbsd-6.yaml @@ -0,0 +1,111 @@ +# yamllint disable rule:indentation rule:line-length +# OpenBSD-6 +--- +values: + formulas_settings: + checkout_orig_branch: false + git_opts: + default: + basedir: /srv/formulas + baseurl: https://github.com/saltstack-formulas + options: + output_loglevel: quiet + rev: master + update: false + list: {} + salt_settings: + api_service: salt-api + api_service_details: + enabled: true + state: running + clean_config_d_dir: true + cloud: + template_sources: + maps: salt://salt/files/cloud.maps.d + profiles: salt://salt/files/cloud.profiles.d + providers: salt://salt/files/cloud.providers.d + config_path: /etc/salt + gitfs: + dulwich: + install_from_source: true + gitpython: + install_from_source: false + pygit2: + git: + install_from_package: git + require_state: false + install_from_source: true + libgit2: + build_parent_dir: /usr/src/ + download_hash: 683d1164e361e2a0a8d52652840e2340 + install_from_source: true + version: 0.23.0 + version: 0.23.0 + install_packages: true + master: + ext_pillar: + - cmd_yaml: cat /etc/salt/yaml + - stack: + - /path/to/stack1.cfg + - /path/to/stack2.cfg + - reclass: + inventory_base_uri: /etc/reclass + file_roots: + base: + - /srv/salt + fileserver_backend: + - rootfs + gitfs_provider: gitpython + pillar_roots: + base: + - /srv/pillar + master_config_use_TOFS: false + master_remove_config: false + master_service: salt_master + master_service_details: + enabled: true + state: running + minion: + file_roots: + base: + - /srv/salt + fileserver_backend: + - rootfs + master: localhost + master_type: true + pillar_roots: + base: + - /srv/pillar + minion_config_use_TOFS: false + minion_remove_config: false + minion_service: salt_minion + minion_service_details: + enabled: true + state: running + parallel: true + pin_version: false + pkgrepo: '' + py_ver: py3 + python_dulwich: py3-dulwich + python_git: py3-GitPython + release: '3001' + restart_via_at: false + retry_options: + attempts: 2 + interval: 10 + splay: 10 + until: true + rootgroup: root + rootuser: root + salt_api: salt + salt_cloud: salt + salt_master: salt + salt_master_macos_plist_hash: '' + salt_minion: salt + salt_minion_macos_plist_hash: '' + salt_ssh: salt + salt_syndic: salt + ssh_roster: {} + syndic_service: salt-syndic + use_pip: false + version: '' From e6bcdc1b4d8d15f00af17d1c33ed57f496d951b2 Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Tue, 30 Mar 2021 11:55:03 +0100 Subject: [PATCH 9/9] test: update for new platforms (inc. using `system` library) --- .../integration/v3000-py2/controls/pkgs_spec.rb | 17 +++++++++++++---- .../v3000-py2/controls/service_spec.rb | 15 +++++++++++---- .../integration/v3000-py3/controls/pkgs_spec.rb | 6 +++++- .../v3000-py3/controls/service_spec.rb | 4 +++- .../integration/v3001-py3/controls/pkgs_spec.rb | 17 +++++++++++++---- .../v3001-py3/controls/service_spec.rb | 15 +++++++++++---- .../integration/v3002-py3/controls/pkgs_spec.rb | 17 +++++++++++++---- .../v3002-py3/controls/service_spec.rb | 15 +++++++++++---- 8 files changed, 80 insertions(+), 26 deletions(-) diff --git a/test/integration/v3000-py2/controls/pkgs_spec.rb b/test/integration/v3000-py2/controls/pkgs_spec.rb index 74d48dd..818f70e 100644 --- a/test/integration/v3000-py2/controls/pkgs_spec.rb +++ b/test/integration/v3000-py2/controls/pkgs_spec.rb @@ -1,14 +1,23 @@ # frozen_string_literal: true +pkgs = + case system.platform[:name] + when 'arch' + %w[salt] + when /bsd$/ + %w[py37-salt-3002.6] + when 'windows' + %w[Salt\ Minion] + else + %w[salt-master salt-minion] + end + control 'salt packages' do title 'should be installed' version = '3000' - %w[ - salt-master - salt-minion - ].each do |p| + pkgs.each do |p| describe package(p) do it { should be_installed } its('version') { should match(/^#{version}/) } diff --git a/test/integration/v3000-py2/controls/service_spec.rb b/test/integration/v3000-py2/controls/service_spec.rb index 9d99883..be3dab7 100644 --- a/test/integration/v3000-py2/controls/service_spec.rb +++ b/test/integration/v3000-py2/controls/service_spec.rb @@ -1,12 +1,19 @@ # frozen_string_literal: true +services = + case system.platform[:family] + when 'bsd' + %w[salt_master salt_minion] + when 'windows' + %w[salt-minion] + else + %w[salt-master salt-minion] + end + control 'salt services' do title 'should be running' - %w[ - salt-master - salt-minion - ].each do |p| + services.each do |p| describe service(p) do it { should be_installed } it { should be_enabled } diff --git a/test/integration/v3000-py3/controls/pkgs_spec.rb b/test/integration/v3000-py3/controls/pkgs_spec.rb index 06a4c2a..818f70e 100644 --- a/test/integration/v3000-py3/controls/pkgs_spec.rb +++ b/test/integration/v3000-py3/controls/pkgs_spec.rb @@ -1,7 +1,11 @@ # frozen_string_literal: true pkgs = - case platform[:family] + case system.platform[:name] + when 'arch' + %w[salt] + when /bsd$/ + %w[py37-salt-3002.6] when 'windows' %w[Salt\ Minion] else diff --git a/test/integration/v3000-py3/controls/service_spec.rb b/test/integration/v3000-py3/controls/service_spec.rb index 303b136..be3dab7 100644 --- a/test/integration/v3000-py3/controls/service_spec.rb +++ b/test/integration/v3000-py3/controls/service_spec.rb @@ -1,7 +1,9 @@ # frozen_string_literal: true services = - case platform[:family] + case system.platform[:family] + when 'bsd' + %w[salt_master salt_minion] when 'windows' %w[salt-minion] else diff --git a/test/integration/v3001-py3/controls/pkgs_spec.rb b/test/integration/v3001-py3/controls/pkgs_spec.rb index 91d629d..4ba2b86 100644 --- a/test/integration/v3001-py3/controls/pkgs_spec.rb +++ b/test/integration/v3001-py3/controls/pkgs_spec.rb @@ -1,14 +1,23 @@ # frozen_string_literal: true +pkgs = + case system.platform[:name] + when 'arch' + %w[salt] + when /bsd$/ + %w[py37-salt-3002.6] + when 'windows' + %w[Salt\ Minion] + else + %w[salt-master salt-minion] + end + control 'salt packages' do title 'should be installed' version = '3001' - %w[ - salt-master - salt-minion - ].each do |p| + pkgs.each do |p| describe package(p) do it { should be_installed } its('version') { should match(/^#{version}/) } diff --git a/test/integration/v3001-py3/controls/service_spec.rb b/test/integration/v3001-py3/controls/service_spec.rb index 9d99883..be3dab7 100644 --- a/test/integration/v3001-py3/controls/service_spec.rb +++ b/test/integration/v3001-py3/controls/service_spec.rb @@ -1,12 +1,19 @@ # frozen_string_literal: true +services = + case system.platform[:family] + when 'bsd' + %w[salt_master salt_minion] + when 'windows' + %w[salt-minion] + else + %w[salt-master salt-minion] + end + control 'salt services' do title 'should be running' - %w[ - salt-master - salt-minion - ].each do |p| + services.each do |p| describe service(p) do it { should be_installed } it { should be_enabled } diff --git a/test/integration/v3002-py3/controls/pkgs_spec.rb b/test/integration/v3002-py3/controls/pkgs_spec.rb index b1aa8ab..73aee8a 100644 --- a/test/integration/v3002-py3/controls/pkgs_spec.rb +++ b/test/integration/v3002-py3/controls/pkgs_spec.rb @@ -1,14 +1,23 @@ # frozen_string_literal: true +pkgs = + case system.platform[:name] + when 'arch' + %w[salt] + when /bsd$/ + %w[py37-salt-3002.6] + when 'windows' + %w[Salt\ Minion] + else + %w[salt-master salt-minion] + end + control 'salt packages' do title 'should be installed' version = '3002' - %w[ - salt-master - salt-minion - ].each do |p| + pkgs.each do |p| describe package(p) do it { should be_installed } its('version') { should match(/^#{version}/) } diff --git a/test/integration/v3002-py3/controls/service_spec.rb b/test/integration/v3002-py3/controls/service_spec.rb index 9d99883..be3dab7 100644 --- a/test/integration/v3002-py3/controls/service_spec.rb +++ b/test/integration/v3002-py3/controls/service_spec.rb @@ -1,12 +1,19 @@ # frozen_string_literal: true +services = + case system.platform[:family] + when 'bsd' + %w[salt_master salt_minion] + when 'windows' + %w[salt-minion] + else + %w[salt-master salt-minion] + end + control 'salt services' do title 'should be running' - %w[ - salt-master - salt-minion - ].each do |p| + services.each do |p| describe service(p) do it { should be_installed } it { should be_enabled }