Merge branch '3006.x' into merge/3007.x/3006.x

This commit is contained in:
Daniel A. Wozniak 2024-08-26 19:26:17 -07:00
commit 8dd2e3473c
288 changed files with 6332 additions and 1573 deletions

View file

@ -20,12 +20,14 @@ jobs:
github.event.pull_request.merged == true github.event.pull_request.merged == true
&& ( && (
contains(github.event.pull_request.labels.*.name, 'backport:master') || contains(github.event.pull_request.labels.*.name, 'backport:master') ||
contains(github.event.pull_request.labels.*.name, 'backport:3007.x') ||
contains(github.event.pull_request.labels.*.name, 'backport:3006.x') || contains(github.event.pull_request.labels.*.name, 'backport:3006.x') ||
contains(github.event.pull_request.labels.*.name, 'backport:3005.x') contains(github.event.pull_request.labels.*.name, 'backport:3005.x')
) )
&& ( && (
(github.event.action == 'labeled' && ( (github.event.action == 'labeled' && (
contains(github.event.pull_request.labels.*.name, 'backport:master') || contains(github.event.pull_request.labels.*.name, 'backport:master') ||
contains(github.event.pull_request.labels.*.name, 'backport:3007.x') ||
contains(github.event.pull_request.labels.*.name, 'backport:3006.x') || contains(github.event.pull_request.labels.*.name, 'backport:3006.x') ||
contains(github.event.pull_request.labels.*.name, 'backport:3005.x') contains(github.event.pull_request.labels.*.name, 'backport:3005.x')
)) ))

View file

@ -32,7 +32,6 @@ jobs:
- linkcheck - linkcheck
- spellcheck - spellcheck
- html - html
- epub
# - pdf # - pdf
steps: steps:

View file

@ -2868,12 +2868,6 @@ jobs:
name: salt-${{ needs.prepare-workflow.outputs.salt-version }}-docs-html.tar.xz name: salt-${{ needs.prepare-workflow.outputs.salt-version }}-docs-html.tar.xz
path: artifacts/release path: artifacts/release
- name: Download Release Documentation (ePub)
uses: actions/download-artifact@v4
with:
name: Salt-${{ needs.prepare-workflow.outputs.salt-version }}.epub
path: artifacts/release
- name: Show Release Artifacts - name: Show Release Artifacts
run: | run: |
tree -a artifacts/release tree -a artifacts/release

View file

@ -124,12 +124,6 @@ concurrency:
name: salt-${{ needs.prepare-workflow.outputs.salt-version }}-docs-html.tar.xz name: salt-${{ needs.prepare-workflow.outputs.salt-version }}-docs-html.tar.xz
path: artifacts/release path: artifacts/release
- name: Download Release Documentation (ePub)
uses: actions/download-artifact@v4
with:
name: Salt-${{ needs.prepare-workflow.outputs.salt-version }}.epub
path: artifacts/release
- name: Show Release Artifacts - name: Show Release Artifacts
run: | run: |
tree -a artifacts/release tree -a artifacts/release

View file

@ -374,8 +374,8 @@ jobs:
if: always() && inputs.skip-code-coverage == false && steps.download-coverage-artifacts.outcome == 'success' && job.status != 'cancelled' if: always() && inputs.skip-code-coverage == false && steps.download-coverage-artifacts.outcome == 'success' && job.status != 'cancelled'
run: | run: |
nox --force-color -e create-xml-coverage-reports nox --force-color -e create-xml-coverage-reports
mv artifacts/coverage/salt.xml artifacts/coverage/salt..${{ inputs.distro-slug }}..${{ inputs.nox-session }}.xml mv artifacts/coverage/salt.xml artifacts/coverage/salt..${{ inputs.distro-slug }}..${{ inputs.nox-session }}.xml || true
mv artifacts/coverage/tests.xml artifacts/coverage/tests..${{ inputs.distro-slug }}..${{ inputs.nox-session }}.xml mv artifacts/coverage/tests.xml artifacts/coverage/tests..${{ inputs.distro-slug }}..${{ inputs.nox-session }}.xml || true
- name: Report Salt Code Coverage - name: Report Salt Code Coverage
if: always() && inputs.skip-code-coverage == false && steps.download-coverage-artifacts.outcome == 'success' if: always() && inputs.skip-code-coverage == false && steps.download-coverage-artifacts.outcome == 'success'

View file

@ -0,0 +1,38 @@
---
name: Test Windows Installer
on: pull_request
permissions:
contents: read
jobs:
Test-Windows-Installer:
runs-on:
- windows-latest
steps:
- name: Checkout Salt
uses: actions/checkout@v4
- name: Set Up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install NSIS
run: .\pkg\windows\install_nsis.cmd -CICD
shell: cmd
- name: Build Test Installer
run: .\pkg\windows\nsis\tests\setup.cmd -CICD
shell: cmd
- name: Run Stress Test
run: .\pkg\windows\nsis\tests\test.cmd -CICD .\stress_tests
shell: cmd
- name: Run Config Tests
run: .\pkg\windows\nsis\tests\test.cmd -CICD .\config_tests
shell: cmd

View file

@ -192,12 +192,6 @@ jobs:
run: | run: |
tools --timestamps vm decompress-dependencies ${{ inputs.distro-slug }} tools --timestamps vm decompress-dependencies ${{ inputs.distro-slug }}
- name: Downgrade importlib-metadata
if: ${{ contains(fromJSON('["amazonlinux-2", "centos-7"]'), inputs.distro-slug) && contains(fromJSON('["upgrade-classic", "downgrade-classic"]'), matrix.tests-chunk) }}
run: |
# This step can go away once we stop testing classic packages upgrade/downgrades to/from 3005.x
tools --timestamps vm ssh ${{ inputs.distro-slug }} -- "sudo python3 -m pip install -U 'importlib-metadata<=4.13.0' 'virtualenv<=20.21.1'"
- name: Show System Info - name: Show System Info
run: | run: |
tools --timestamps --timeout-secs=1800 vm test --skip-requirements-install --print-system-information-only \ tools --timestamps --timeout-secs=1800 vm test --skip-requirements-install --print-system-information-only \

View file

@ -105,7 +105,7 @@ jobs:
test: test:
name: Test name: Test
runs-on: ${{ inputs.runner }} runs-on: ${{ inputs.runner }}
timeout-minutes: 120 # 2 Hours - More than this and something is wrong timeout-minutes: 150 # 2 & 1/2 Hours - More than this and something is wrong (MacOS needs a little more time)
needs: needs:
- generate-matrix - generate-matrix
strategy: strategy:

View file

@ -191,12 +191,6 @@ jobs:
run: | run: |
tools --timestamps vm decompress-dependencies ${{ inputs.distro-slug }} tools --timestamps vm decompress-dependencies ${{ inputs.distro-slug }}
- name: Downgrade importlib-metadata
if: ${{ contains(fromJSON('["amazonlinux-2", "centos-7"]'), inputs.distro-slug) && contains(fromJSON('["upgrade-classic", "downgrade-classic"]'), matrix.tests-chunk) }}
run: |
# This step can go away once we stop testing classic packages upgrade/downgrades to/from 3005.x
tools --timestamps vm ssh ${{ inputs.distro-slug }} -- "sudo python3 -m pip install -U 'importlib-metadata<=4.13.0' 'virtualenv<=20.21.1'"
- name: Show System Info - name: Show System Info
run: | run: |
tools --timestamps --timeout-secs=1800 vm test --skip-requirements-install --print-system-information-only \ tools --timestamps --timeout-secs=1800 vm test --skip-requirements-install --print-system-information-only \

View file

@ -13,10 +13,23 @@ Versions are `MAJOR.PATCH`.
### Removed ### Removed
- The ``salt.utils.psutil_compat`` was deprecated and now removed in Salt 3008. Please use the ``psutil`` module directly. [#66160](https://github.com/saltstack/salt/issues/66160) - The ``salt.utils.psutil_compat`` was deprecated and now removed in Salt 3008. Please use the ``psutil`` module directly. [#66160](https://github.com/saltstack/salt/issues/66160)
## 3006.9 (2024-07-29)
### Deprecated
- Drop CentOS 7 support [#66623](https://github.com/saltstack/salt/issues/66623)
- No longer build RPM packages with CentOS Stream 9 [#66624](https://github.com/saltstack/salt/issues/66624)
### Fixed ### Fixed
- Made slsutil.renderer work with salt-ssh [#50196](https://github.com/saltstack/salt/issues/50196)
- Fixed defaults.merge is not available when using salt-ssh [#51605](https://github.com/saltstack/salt/issues/51605)
- Fixed config.get does not support merge option with salt-ssh [#56441](https://github.com/saltstack/salt/issues/56441)
- Update to include croniter in pkg requirements [#57649](https://github.com/saltstack/salt/issues/57649)
- Fixed state.test does not work with salt-ssh [#61100](https://github.com/saltstack/salt/issues/61100)
- Made slsutil.findup work with salt-ssh [#61143](https://github.com/saltstack/salt/issues/61143)
- Fixes multiple issues with the cmd module on Windows. Scripts are called using - Fixes multiple issues with the cmd module on Windows. Scripts are called using
the ``-File`` parameter to the ``powershell.exe`` binary. ``CLIXML`` data in the ``-File`` parameter to the ``powershell.exe`` binary. ``CLIXML`` data in
stderr is now removed (only applies to encoded commands). Commands can now be stderr is now removed (only applies to encoded commands). Commands can now be
@ -35,6 +48,38 @@ Versions are `MAJOR.PATCH`.
- Change log level of successful master cluster key exchange from error to info. [#66266](https://github.com/saltstack/salt/issues/66266) - Change log level of successful master cluster key exchange from error to info. [#66266](https://github.com/saltstack/salt/issues/66266)
- Made `file.managed` skip download of a remote source if the managed file already exists with the correct hash [#66342](https://github.com/saltstack/salt/issues/66342) - Made `file.managed` skip download of a remote source if the managed file already exists with the correct hash [#66342](https://github.com/saltstack/salt/issues/66342)
- Fixed nftables.build_rule breaks ipv6 rules by using the wrong syntax for source and destination addresses [#66382](https://github.com/saltstack/salt/issues/66382) - Fixed nftables.build_rule breaks ipv6 rules by using the wrong syntax for source and destination addresses [#66382](https://github.com/saltstack/salt/issues/66382)
- file.replace and file.search work properly with /proc files [#63102](https://github.com/saltstack/salt/issues/63102)
- Fix utf8 handling in 'pass' renderer [#64300](https://github.com/saltstack/salt/issues/64300)
- Fixed incorrect version argument will be ignored for multiple package targets warning when using pkgs argument to yumpkg module. [#64563](https://github.com/saltstack/salt/issues/64563)
- salt-cloud honors root_dir config setting for log_file location and fixes for root_dir locations on windows. [#64728](https://github.com/saltstack/salt/issues/64728)
- Fixed slsutil.update with salt-ssh during template rendering [#65067](https://github.com/saltstack/salt/issues/65067)
- Fix config.items when called on minion [#65251](https://github.com/saltstack/salt/issues/65251)
- Ensure on rpm and deb systems, that user and group for existing Salt, is maintained on upgrade [#65264](https://github.com/saltstack/salt/issues/65264)
- Fix typo in nftables module to ensure unique nft family values [#65295](https://github.com/saltstack/salt/issues/65295)
- pkg.installed state aggregate does not honors requires requisite [#65304](https://github.com/saltstack/salt/issues/65304)
- Added SSH wrapper for logmod [#65630](https://github.com/saltstack/salt/issues/65630)
- Fix for GitFS failure to unlock lock file, and resource cleanup for process SIGTERM [#65816](https://github.com/saltstack/salt/issues/65816)
- Corrected x509_v2 CRL creation `last_update` and `next_update` values when system timezone is not UTC [#65837](https://github.com/saltstack/salt/issues/65837)
- Make sure the root minion process handles SIGUSR1 and emits a traceback like it's child processes [#66095](https://github.com/saltstack/salt/issues/66095)
- Replaced pyvenv with builtin venv for virtualenv_mod [#66132](https://github.com/saltstack/salt/issues/66132)
- Made `file.managed` skip download of a remote source if the managed file already exists with the correct hash [#66342](https://github.com/saltstack/salt/issues/66342)
- Fix win_task ExecutionTimeLimit and result/error code interpretation [#66347](https://github.com/saltstack/salt/issues/66347), [#66441](https://github.com/saltstack/salt/issues/66441)
- Fixed nftables.build_rule breaks ipv6 rules by using the wrong syntax for source and destination addresses [#66382](https://github.com/saltstack/salt/issues/66382)
- Fixed x509_v2 certificate.managed crash for locally signed certificates if the signing policy defines signing_private_key [#66414](https://github.com/saltstack/salt/issues/66414)
- Fixed parallel state execution with Salt-SSH [#66514](https://github.com/saltstack/salt/issues/66514)
- Fix support for FIPS approved encryption and signing algorithms. [#66579](https://github.com/saltstack/salt/issues/66579)
- Fix relative file_roots paths [#66588](https://github.com/saltstack/salt/issues/66588)
- Fixed an issue with cmd.run with requirements when the shell is not the
default [#66596](https://github.com/saltstack/salt/issues/66596)
- Fix RPM package provides [#66604](https://github.com/saltstack/salt/issues/66604)
- Upgrade relAenv to 0.16.1. This release fixes several package installs for salt-pip [#66632](https://github.com/saltstack/salt/issues/66632)
- Upgrade relenv to 0.17.0 (https://github.com/saltstack/relenv/blob/v0.17.0/CHANGELOG.md) [#66663](https://github.com/saltstack/salt/issues/66663)
- Upgrade dependencies due to security issues:
- pymysql>=1.1.1
- requests>=2.32.0
- docker>=7.1.0 [#66666](https://github.com/saltstack/salt/issues/66666)
- Corrected missed line in branch 3006.x when backporting from PR 61620 and 65044 [#66683](https://github.com/saltstack/salt/issues/66683)
- Remove debug output from shell scripts for packaging [#66747](https://github.com/saltstack/salt/issues/66747)
### Added ### Added
@ -44,12 +89,18 @@ Versions are `MAJOR.PATCH`.
unbootstrap chocolatey. [#64722](https://github.com/saltstack/salt/issues/64722) unbootstrap chocolatey. [#64722](https://github.com/saltstack/salt/issues/64722)
- Add Ubuntu 24.04 support [#66180](https://github.com/saltstack/salt/issues/66180) - Add Ubuntu 24.04 support [#66180](https://github.com/saltstack/salt/issues/66180)
- Add Fedora 40 support, replacing Fedora 39 [#66300](https://github.com/saltstack/salt/issues/66300) - Add Fedora 40 support, replacing Fedora 39 [#66300](https://github.com/saltstack/salt/issues/66300)
- Add Ubuntu 24.04 support [#66180](https://github.com/saltstack/salt/issues/66180)
- Add Fedora 40 support, replacing Fedora 39 [#66300](https://github.com/saltstack/salt/issues/66300)
- Build RPM packages with Rocky Linux 9 (instead of CentOS Stream 9) [#66624](https://github.com/saltstack/salt/issues/66624)
### Security ### Security
- Bump to `pydantic==2.6.4` due to https://github.com/advisories/GHSA-mr82-8j83-vxmv [#66433](https://github.com/saltstack/salt/issues/66433) - Bump to `pydantic==2.6.4` due to https://github.com/advisories/GHSA-mr82-8j83-vxmv [#66433](https://github.com/saltstack/salt/issues/66433)
- Bump to ``jinja2==3.1.4`` due to https://github.com/advisories/GHSA-h75v-3vvj-5mfj [#66488](https://github.com/saltstack/salt/issues/66488) - Bump to ``jinja2==3.1.4`` due to https://github.com/advisories/GHSA-h75v-3vvj-5mfj [#66488](https://github.com/saltstack/salt/issues/66488)
- Bump to ``jinja2==3.1.4`` due to https://github.com/advisories/GHSA-h75v-3vvj-5mfj [#66488](https://github.com/saltstack/salt/issues/66488)
- CVE-2024-37088 salt-call will fail with exit code 1 if bad pillar data is
encountered. [#66702](https://github.com/saltstack/salt/issues/66702)
## 3006.8 (2024-04-29) ## 3006.8 (2024-04-29)

3
changelog/33669.added.md Normal file
View file

@ -0,0 +1,3 @@
Issue #33669: Fixes an issue with the ``ini_managed`` execution module
where it would always wrap the separator with spaces. Adds a new parameter
named ``no_spaces`` that will not warp the separator with spaces.

View file

@ -1 +0,0 @@
Made slsutil.renderer work with salt-ssh

View file

@ -1 +0,0 @@
Fixed defaults.merge is not available when using salt-ssh

View file

@ -1 +0,0 @@
Fixed config.get does not support merge option with salt-ssh

View file

@ -1 +0,0 @@
Update to include croniter in pkg requirements

View file

@ -1 +0,0 @@
Fixed state.test does not work with salt-ssh

View file

@ -1 +0,0 @@
Made slsutil.findup work with salt-ssh

View file

@ -1 +0,0 @@
Fix utf8 handling in 'pass' renderer

View file

@ -1 +0,0 @@
Fixed incorrect version argument will be ignored for multiple package targets warning when using pkgs argument to yumpkg module.

View file

@ -1 +0,0 @@
salt-cloud honors root_dir config setting for log_file location and fixes for root_dir locations on windows.

View file

@ -1 +0,0 @@
Fixed slsutil.update with salt-ssh during template rendering

1
changelog/65104.fixed.md Normal file
View file

@ -0,0 +1 @@
The 'profile' outputter does not crash with incorrectly formatted data

View file

@ -1 +0,0 @@
Fix config.items when called on minion

View file

@ -1 +0,0 @@
pkg.installed state aggregate does not honors requires requisite

View file

@ -1 +0,0 @@
Added SSH wrapper for logmod

View file

@ -1 +0,0 @@
Fix for GitFS failure to unlock lock file, and resource cleanup for process SIGTERM

1
changelog/66249.fixed.md Normal file
View file

@ -0,0 +1 @@
Fix batch mode hang indefinitely in some scenarios

View file

@ -1 +0,0 @@
Fix win_task ExecutionTimeLimit and result/error code interpretation

View file

@ -1 +0,0 @@
Fixed x509_v2 certificate.managed crash for locally signed certificates if the signing policy defines signing_private_key

View file

@ -1 +0,0 @@
Fix win_task ExecutionTimeLimit and result/error code interpretation

View file

@ -0,0 +1 @@
Remove psutil_compat.py file, which should have been removed when RHEL 6 EOL

View file

@ -1 +0,0 @@
Fix support for FIPS approved encryption and signing algorithms.

View file

@ -1 +0,0 @@
Fix RPM package provides

View file

@ -1 +0,0 @@
Drop CentOS 7 support

View file

@ -1 +0,0 @@
Build RPM packages with Rocky Linux 9 (instead of CentOS Stream 9)

View file

@ -1 +0,0 @@
No longer build RPM packages with CentOS Stream 9

View file

@ -1 +0,0 @@
Upgrade relAenv to 0.16.1. This release fixes several package installs for salt-pip

View file

@ -1 +0,0 @@
Upgrade relenv to 0.17.0 (https://github.com/saltstack/relenv/blob/v0.17.0/CHANGELOG.md)

View file

@ -1,4 +0,0 @@
Upgrade dependencies due to security issues:
- pymysql>=1.1.1
- requests>=2.32.0
- docker>=7.1.0

View file

@ -1 +0,0 @@
Corrected missed line in branch 3006.x when backporting from PR 61620 and 65044

2
changelog/66716.fixed.md Normal file
View file

@ -0,0 +1,2 @@
Fixed an issue where ``status.master`` wasn't detecting a connection to the
specified master properly

2
changelog/66718.fixed.md Normal file
View file

@ -0,0 +1,2 @@
Fixed ``win_wua.available`` when some of the update objects are empty CDispatch
objects. The ``available`` function no longer crashes

1
changelog/66726.fixed.md Normal file
View file

@ -0,0 +1 @@
Clean up multiprocessing file handles on minion

2
changelog/66786.fixed.md Normal file
View file

@ -0,0 +1,2 @@
Fix an issue where files created using `salt.utils.atomicile.atomic_open()`
were created with restrictive permissions instead of respecting the umask.

1
changelog/66789.fixed.md Normal file
View file

@ -0,0 +1 @@
Fix bad async_method name on AsyncPubClient class

1
changelog/66796.fixed.md Normal file
View file

@ -0,0 +1 @@
Ensure Manjaro ARM reports the correct os_family of Arch.

View file

@ -16,7 +16,7 @@ ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
# the i18n builder cannot share the environment and doctrees with the others # the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
.PHONY: help clean check_sphinx-build html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest .PHONY: help clean check_sphinx-build html dirhtml singlehtml pickle json htmlhelp qthelp devhelp latex latexpdf text man changes linkcheck doctest
help: help:
@echo "Please use \`make <target>' where <target> is one of" @echo "Please use \`make <target>' where <target> is one of"
@ -28,7 +28,6 @@ help:
@echo " htmlhelp to make HTML files and a HTML help project" @echo " htmlhelp to make HTML files and a HTML help project"
@echo " qthelp to make HTML files and a qthelp project" @echo " qthelp to make HTML files and a qthelp project"
@echo " devhelp to make HTML files and a Devhelp project" @echo " devhelp to make HTML files and a Devhelp project"
@echo " epub to make an epub"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " pdf to make Salt-all.pdf and splitted pdf using xelatex" @echo " pdf to make Salt-all.pdf and splitted pdf using xelatex"
@echo " cheatsheet to create salt-cheatsheet.pdf" @echo " cheatsheet to create salt-cheatsheet.pdf"
@ -101,11 +100,6 @@ devhelp: check_sphinx-build
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Salt" @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Salt"
@echo "# devhelp" @echo "# devhelp"
epub: check_sphinx-build
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
@echo
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
latex: check_sphinx-build latex: check_sphinx-build
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo @echo

View file

@ -193,10 +193,8 @@
{% if not (build_type == repo_primary_branch or build_type == "next") and on_saltstack %} {% if not (build_type == repo_primary_branch or build_type == "next") and on_saltstack %}
<li><a class="icon-dl" href="/en/pdf/Salt-{{ release }}.pdf"><img height="25" width="25" class="nolightbox" src="{{ pathto('_static/images/pdf_icon.svg', 1) }}"></a></li> <li><a class="icon-dl" href="/en/pdf/Salt-{{ release }}.pdf"><img height="25" width="25" class="nolightbox" src="{{ pathto('_static/images/pdf_icon.svg', 1) }}"></a></li>
<li><a class="icon-dl" href="/en/epub/Salt-{{ release }}.epub"><img height="25" width="18" class="nolightbox" src="{{ pathto('_static/images/epub_icon.svg', 1) }}"></a></li>
{% elif build_type == repo_primary_branch and on_saltstack %} {% elif build_type == repo_primary_branch and on_saltstack %}
<li><a class="icon-dl" href="/en/pdf/Salt-{{ repo_primary_branch }}.pdf"><img height="25" width="25" class="nolightbox" src="{{ pathto('_static/images/pdf_icon.svg', 1) }}"></a></li> <li><a class="icon-dl" href="/en/pdf/Salt-{{ repo_primary_branch }}.pdf"><img height="25" width="25" class="nolightbox" src="{{ pathto('_static/images/pdf_icon.svg', 1) }}"></a></li>
<li><a class="icon-dl" href="/en/epub/Salt-{{ repo_primary_branch }}.epub"><img height="25" width="18" class="nolightbox" src="{{ pathto('_static/images/epub_icon.svg', 1) }}"></a></li>
{% endif %} {% endif %}
</ul> </ul>
</nav> </nav>

View file

@ -1,25 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 15.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Ebene_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="600px" height="800px" viewBox="0 0 600 800" enable-background="new 0 0 600 800" xml:space="preserve">
<g>
<path fill="#86B918" d="M131.969,755.898c11.244,0,19.199-4.599,25.85-11.573l7.591,6.827c-8.227,9.192-18.222,15.376-33.76,15.376
c-22.534,0-40.906-17.294-40.906-42.824c0-23.777,16.649-42.815,39.333-42.815c24.237,0,38.203,19.347,38.203,43.453
c0,1.113,0,2.381-0.15,3.803h-65.031C104.838,745.921,117.536,755.898,131.969,755.898z M155.927,719.111
c-1.277-14.907-9.844-27.916-26.194-27.916c-14.242,0-25.043,11.909-26.639,27.916H155.927z"/>
<path fill="#41281B" d="M231.23,725.461h-26.957v39.177H191.75V653.616h41.562c25.043,0,41.542,13.331,41.542,35.373
C274.854,713.096,254.87,725.461,231.23,725.461z M232.333,665.196h-28.062v48.839h27.447c18.386,0,30.441-9.823,30.441-24.577
C262.163,673.444,250.28,665.196,232.333,665.196z"/>
<path fill="#41281B" d="M388.377,717.193c0,32.363-18.535,49.174-46.3,49.174c-27.424,0-46.134-16.811-46.134-48.208v-64.543
h12.518v63.752c0,23.939,12.693,37.425,33.954,37.425c20.453,0,33.462-12.378,33.462-36.634v-64.543h12.5V717.193z"/>
<path fill="#41281B" d="M500.202,681.379c0,14.584-8.885,22.034-17.602,25.85c13.163,3.95,23.771,11.561,23.771,26.958
c0,19.172-16.014,30.451-40.269,30.451h-50.112V653.616h48.048C485.92,653.616,500.202,664.392,500.202,681.379z M487.51,683.122
c0-11.112-8.739-18.24-24.573-18.24h-34.59v38.229h33.63C477.033,703.104,487.51,696.277,487.51,683.122z M493.698,733.388
c0-12.218-10.162-19.192-29.513-19.192h-35.839v39.163h38.076C483.238,753.358,493.698,745.921,493.698,733.388z"/>
</g>
<path fill="#86B918" d="M298.549,467.913L129.228,298.579L298.549,129.27l56.446,56.435L242.104,298.579l56.441,56.443
l169.323-169.308L320.366,38.217c-12.043-12.055-31.579-12.055-43.634,0L38.169,276.781c-12.044,12.043-12.044,31.58,0,43.633
l238.563,238.557c12.055,12.05,31.591,12.05,43.634,0l238.565-238.557c12.044-12.053,12.044-31.59,0-43.633l-34.631-34.622
L298.549,467.913z"/>
</svg>

Before

Width:  |  Height:  |  Size: 2.3 KiB

View file

@ -383,19 +383,6 @@ man_pages = [
] ]
### epub options
epub_title = "Salt Documentation"
epub_author = "VMware, Inc."
epub_publisher = epub_author
epub_copyright = copyright
epub_scheme = "URL"
epub_identifier = "http://saltproject.io/"
epub_tocdup = False
# epub_tocdepth = 3
def skip_mod_init_member(app, what, name, obj, skip, options): def skip_mod_init_member(app, what, name, obj, skip, options):
# pylint: disable=too-many-arguments,unused-argument # pylint: disable=too-many-arguments,unused-argument
if name.startswith("_"): if name.startswith("_"):

View file

@ -0,0 +1,87 @@
(release-3006.9)=
# Salt 3006.9 release notes
<!---
Do not edit this file. This is auto generated.
Edit the templates in doc/topics/releases/templates/
for a given release.
-->
<!--
Add release specific details below
-->
<!--
Do not edit the changelog below.
This is auto generated.
-->
## Changelog
### Deprecated
- Drop CentOS 7 support [#66623](https://github.com/saltstack/salt/issues/66623)
- No longer build RPM packages with CentOS Stream 9 [#66624](https://github.com/saltstack/salt/issues/66624)
### Fixed
- Made slsutil.renderer work with salt-ssh [#50196](https://github.com/saltstack/salt/issues/50196)
- Fixed defaults.merge is not available when using salt-ssh [#51605](https://github.com/saltstack/salt/issues/51605)
- Fixed config.get does not support merge option with salt-ssh [#56441](https://github.com/saltstack/salt/issues/56441)
- Update to include croniter in pkg requirements [#57649](https://github.com/saltstack/salt/issues/57649)
- Fixed state.test does not work with salt-ssh [#61100](https://github.com/saltstack/salt/issues/61100)
- Made slsutil.findup work with salt-ssh [#61143](https://github.com/saltstack/salt/issues/61143)
- Fixes multiple issues with the cmd module on Windows. Scripts are called using
the ``-File`` parameter to the ``powershell.exe`` binary. ``CLIXML`` data in
stderr is now removed (only applies to encoded commands). Commands can now be
sent to ``cmd.powershell`` as a list. Makes sure JSON data returned is valid.
Strips whitespace from the return when using ``runas``. [#61166](https://github.com/saltstack/salt/issues/61166)
- Fixed the win_lgpo_netsh salt util to handle non-English systems. This was a
rewrite to use PowerShell instead of netsh to make the changes on the system [#61534](https://github.com/saltstack/salt/issues/61534)
- file.replace and file.search work properly with /proc files [#63102](https://github.com/saltstack/salt/issues/63102)
- Fix utf8 handling in 'pass' renderer [#64300](https://github.com/saltstack/salt/issues/64300)
- Fixed incorrect version argument will be ignored for multiple package targets warning when using pkgs argument to yumpkg module. [#64563](https://github.com/saltstack/salt/issues/64563)
- salt-cloud honors root_dir config setting for log_file location and fixes for root_dir locations on windows. [#64728](https://github.com/saltstack/salt/issues/64728)
- Fixed slsutil.update with salt-ssh during template rendering [#65067](https://github.com/saltstack/salt/issues/65067)
- Fix config.items when called on minion [#65251](https://github.com/saltstack/salt/issues/65251)
- Ensure on rpm and deb systems, that user and group for existing Salt, is maintained on upgrade [#65264](https://github.com/saltstack/salt/issues/65264)
- Fix typo in nftables module to ensure unique nft family values [#65295](https://github.com/saltstack/salt/issues/65295)
- pkg.installed state aggregate does not honors requires requisite [#65304](https://github.com/saltstack/salt/issues/65304)
- Added SSH wrapper for logmod [#65630](https://github.com/saltstack/salt/issues/65630)
- Fix for GitFS failure to unlock lock file, and resource cleanup for process SIGTERM [#65816](https://github.com/saltstack/salt/issues/65816)
- Corrected x509_v2 CRL creation `last_update` and `next_update` values when system timezone is not UTC [#65837](https://github.com/saltstack/salt/issues/65837)
- Make sure the root minion process handles SIGUSR1 and emits a traceback like it's child processes [#66095](https://github.com/saltstack/salt/issues/66095)
- Replaced pyvenv with builtin venv for virtualenv_mod [#66132](https://github.com/saltstack/salt/issues/66132)
- Made `file.managed` skip download of a remote source if the managed file already exists with the correct hash [#66342](https://github.com/saltstack/salt/issues/66342)
- Fix win_task ExecutionTimeLimit and result/error code interpretation [#66347](https://github.com/saltstack/salt/issues/66347), [#66441](https://github.com/saltstack/salt/issues/66441)
- Fixed nftables.build_rule breaks ipv6 rules by using the wrong syntax for source and destination addresses [#66382](https://github.com/saltstack/salt/issues/66382)
- Fixed x509_v2 certificate.managed crash for locally signed certificates if the signing policy defines signing_private_key [#66414](https://github.com/saltstack/salt/issues/66414)
- Fixed parallel state execution with Salt-SSH [#66514](https://github.com/saltstack/salt/issues/66514)
- Fix support for FIPS approved encryption and signing algorithms. [#66579](https://github.com/saltstack/salt/issues/66579)
- Fix relative file_roots paths [#66588](https://github.com/saltstack/salt/issues/66588)
- Fixed an issue with cmd.run with requirements when the shell is not the
default [#66596](https://github.com/saltstack/salt/issues/66596)
- Fix RPM package provides [#66604](https://github.com/saltstack/salt/issues/66604)
- Upgrade relAenv to 0.16.1. This release fixes several package installs for salt-pip [#66632](https://github.com/saltstack/salt/issues/66632)
- Upgrade relenv to 0.17.0 (https://github.com/saltstack/relenv/blob/v0.17.0/CHANGELOG.md) [#66663](https://github.com/saltstack/salt/issues/66663)
- Upgrade dependencies due to security issues:
- pymysql>=1.1.1
- requests>=2.32.0
- docker>=7.1.0 [#66666](https://github.com/saltstack/salt/issues/66666)
- Corrected missed line in branch 3006.x when backporting from PR 61620 and 65044 [#66683](https://github.com/saltstack/salt/issues/66683)
- Remove debug output from shell scripts for packaging [#66747](https://github.com/saltstack/salt/issues/66747)
### Added
- Add Ubuntu 24.04 support [#66180](https://github.com/saltstack/salt/issues/66180)
- Add Fedora 40 support, replacing Fedora 39 [#66300](https://github.com/saltstack/salt/issues/66300)
- Build RPM packages with Rocky Linux 9 (instead of CentOS Stream 9) [#66624](https://github.com/saltstack/salt/issues/66624)
### Security
- Bump to ``jinja2==3.1.4`` due to https://github.com/advisories/GHSA-h75v-3vvj-5mfj [#66488](https://github.com/saltstack/salt/issues/66488)
- CVE-2024-37088 salt-call will fail with exit code 1 if bad pillar data is
encountered. [#66702](https://github.com/saltstack/salt/issues/66702)

View file

@ -0,0 +1,14 @@
(release-3006.9)=
# Salt 3006.9 release notes{{ unreleased }}
{{ warning }}
<!--
Add release specific details below
-->
<!--
Do not edit the changelog below.
This is auto generated.
-->
## Changelog
{{ changelog }}

View file

@ -1870,18 +1870,10 @@ def ci_test_onedir_pkgs(session):
"--upgrade", "--upgrade",
"--no-uninstall", "--no-uninstall",
], ],
"upgrade-classic": [
"--upgrade",
"--no-uninstall",
],
"downgrade": [ "downgrade": [
"--downgrade", "--downgrade",
"--no-uninstall", "--no-uninstall",
], ],
"downgrade-classic": [
"--downgrade",
"--no-uninstall",
],
"download-pkgs": [ "download-pkgs": [
"--download-pkgs", "--download-pkgs",
], ],
@ -1912,9 +1904,6 @@ def ci_test_onedir_pkgs(session):
"PKG_TEST_TYPE": chunk, "PKG_TEST_TYPE": chunk,
} }
if chunk in ("upgrade-classic", "downgrade-classic"):
cmd_args.append("--classic")
pytest_args = ( pytest_args = (
common_pytest_args[:] common_pytest_args[:]
+ cmd_args[:] + cmd_args[:]
@ -1982,8 +1971,6 @@ def ci_test_onedir_pkgs(session):
) )
if "downgrade" in chunk: if "downgrade" in chunk:
pytest_args.append("--use-prev-version") pytest_args.append("--use-prev-version")
if chunk in ("upgrade-classic", "downgrade-classic"):
pytest_args.append("--classic")
if append_tests_path: if append_tests_path:
pytest_args.append("tests/pytests/pkg/") pytest_args.append("tests/pytests/pkg/")
try: try:
@ -2006,8 +1993,6 @@ def ci_test_onedir_pkgs(session):
) )
if "downgrade" in chunk: if "downgrade" in chunk:
pytest_args.append("--use-prev-version") pytest_args.append("--use-prev-version")
if chunk in ("upgrade-classic", "downgrade-classic"):
pytest_args.append("--classic")
if append_tests_path: if append_tests_path:
pytest_args.append("tests/pytests/pkg/") pytest_args.append("tests/pytests/pkg/")
_pytest( _pytest(

View file

@ -42,6 +42,70 @@ salt (3007.1) stable; urgency=medium
-- Salt Project Packaging <saltproject-packaging@vmware.com> Sun, 19 May 2024 12:48:59 +0000 -- Salt Project Packaging <saltproject-packaging@vmware.com> Sun, 19 May 2024 12:48:59 +0000
salt (3006.9) stable; urgency=medium
# Deprecated
* Drop CentOS 7 support [#66623](https://github.com/saltstack/salt/issues/66623)
* No longer build RPM packages with CentOS Stream 9 [#66624](https://github.com/saltstack/salt/issues/66624)
# Fixed
* Made slsutil.renderer work with salt-ssh [#50196](https://github.com/saltstack/salt/issues/50196)
* Fixed defaults.merge is not available when using salt-ssh [#51605](https://github.com/saltstack/salt/issues/51605)
* Fixed config.get does not support merge option with salt-ssh [#56441](https://github.com/saltstack/salt/issues/56441)
* Update to include croniter in pkg requirements [#57649](https://github.com/saltstack/salt/issues/57649)
* Fixed state.test does not work with salt-ssh [#61100](https://github.com/saltstack/salt/issues/61100)
* Made slsutil.findup work with salt-ssh [#61143](https://github.com/saltstack/salt/issues/61143)
* file.replace and file.search work properly with /proc files [#63102](https://github.com/saltstack/salt/issues/63102)
* Fix utf8 handling in 'pass' renderer [#64300](https://github.com/saltstack/salt/issues/64300)
* Fixed incorrect version argument will be ignored for multiple package targets warning when using pkgs argument to yumpkg module. [#64563](https://github.com/saltstack/salt/issues/64563)
* salt-cloud honors root_dir config setting for log_file location and fixes for root_dir locations on windows. [#64728](https://github.com/saltstack/salt/issues/64728)
* Fixed slsutil.update with salt-ssh during template rendering [#65067](https://github.com/saltstack/salt/issues/65067)
* Fix config.items when called on minion [#65251](https://github.com/saltstack/salt/issues/65251)
* Ensure on rpm and deb systems, that user and group for existing Salt, is maintained on upgrade [#65264](https://github.com/saltstack/salt/issues/65264)
* Fix typo in nftables module to ensure unique nft family values [#65295](https://github.com/saltstack/salt/issues/65295)
* pkg.installed state aggregate does not honors requires requisite [#65304](https://github.com/saltstack/salt/issues/65304)
* Added SSH wrapper for logmod [#65630](https://github.com/saltstack/salt/issues/65630)
* Fix for GitFS failure to unlock lock file, and resource cleanup for process SIGTERM [#65816](https://github.com/saltstack/salt/issues/65816)
* Corrected x509_v2 CRL creation `last_update` and `next_update` values when system timezone is not UTC [#65837](https://github.com/saltstack/salt/issues/65837)
* Make sure the root minion process handles SIGUSR1 and emits a traceback like it's child processes [#66095](https://github.com/saltstack/salt/issues/66095)
* Replaced pyvenv with builtin venv for virtualenv_mod [#66132](https://github.com/saltstack/salt/issues/66132)
* Made `file.managed` skip download of a remote source if the managed file already exists with the correct hash [#66342](https://github.com/saltstack/salt/issues/66342)
* Fix win_task ExecutionTimeLimit and result/error code interpretation [#66347](https://github.com/saltstack/salt/issues/66347), [#66441](https://github.com/saltstack/salt/issues/66441)
* Fixed nftables.build_rule breaks ipv6 rules by using the wrong syntax for source and destination addresses [#66382](https://github.com/saltstack/salt/issues/66382)
* Fixed x509_v2 certificate.managed crash for locally signed certificates if the signing policy defines signing_private_key [#66414](https://github.com/saltstack/salt/issues/66414)
* Fixed parallel state execution with Salt-SSH [#66514](https://github.com/saltstack/salt/issues/66514)
* Fix support for FIPS approved encryption and signing algorithms. [#66579](https://github.com/saltstack/salt/issues/66579)
* Fix relative file_roots paths [#66588](https://github.com/saltstack/salt/issues/66588)
* Fixed an issue with cmd.run with requirements when the shell is not the
default [#66596](https://github.com/saltstack/salt/issues/66596)
* Fix RPM package provides [#66604](https://github.com/saltstack/salt/issues/66604)
* Upgrade relAenv to 0.16.1. This release fixes several package installs for salt-pip [#66632](https://github.com/saltstack/salt/issues/66632)
* Upgrade relenv to 0.17.0 (https://github.com/saltstack/relenv/blob/v0.17.0/CHANGELOG.md) [#66663](https://github.com/saltstack/salt/issues/66663)
* Upgrade dependencies due to security issues:
* pymysql>=1.1.1
* requests>=2.32.0
* docker>=7.1.0 [#66666](https://github.com/saltstack/salt/issues/66666)
* Corrected missed line in branch 3006.x when backporting from PR 61620 and 65044 [#66683](https://github.com/saltstack/salt/issues/66683)
* Remove debug output from shell scripts for packaging [#66747](https://github.com/saltstack/salt/issues/66747)
# Added
* Add Ubuntu 24.04 support [#66180](https://github.com/saltstack/salt/issues/66180)
* Add Fedora 40 support, replacing Fedora 39 [#66300](https://github.com/saltstack/salt/issues/66300)
* Build RPM packages with Rocky Linux 9 (instead of CentOS Stream 9) [#66624](https://github.com/saltstack/salt/issues/66624)
# Security
* Bump to ``jinja2==3.1.4`` due to https://github.com/advisories/GHSA-h75v-3vvj-5mfj [#66488](https://github.com/saltstack/salt/issues/66488)
* CVE-2024-37088 salt-call will fail with exit code 1 if bad pillar data is
encountered. [#66702](https://github.com/saltstack/salt/issues/66702)
-- Salt Project Packaging <saltproject-packaging@vmware.com> Mon, 29 Jul 2024 07:42:36 +0000
salt (3006.8) stable; urgency=medium salt (3006.8) stable; urgency=medium

View file

@ -1,10 +1,37 @@
#!/bin/sh
. /usr/share/debconf/confmodule
case "$1" in case "$1" in
configure) configure)
if [ ! -e "/var/log/salt/api" ]; then db_get salt-api/user
touch /var/log/salt/api if [ "$RET" != "root" ]; then
chmod 640 /var/log/salt/api if [ ! -e "/var/log/salt/api" ]; then
touch /var/log/salt/api
chmod 640 /var/log/salt/api
fi
chown $RET:$RET /var/log/salt/api
fi
if command -v systemctl; then
db_get salt-api/active
RESLT=$(echo "$RET" | cut -d ' ' -f 1)
if [ "$RESLT" != 10 ]; then
systemctl daemon-reload
if [ "$RESLT" = "active" ]; then
systemctl restart salt-api
fi
db_get salt-api/enabled
RESLT=$(echo "$RET" | cut -d ' ' -f 1)
if [ "$RESLT" = "disabled" ]; then
systemctl disable salt-api
else
systemctl enable salt-api
fi
else
systemctl daemon-reload
systemctl restart salt-api
systemctl enable salt-api
fi
fi fi
chown salt:salt /var/log/salt/api
if command -v systemctl; then systemctl enable salt-api; fi
;; ;;
esac esac

View file

@ -0,0 +1,28 @@
#!/bin/sh
. /usr/share/debconf/confmodule
case "$1" in
upgrade)
[ -z "$SALT_HOME" ] && SALT_HOME=/opt/saltstack/salt
[ -z "$SALT_USER" ] && SALT_USER=salt
[ -z "$SALT_NAME" ] && SALT_NAME="Salt"
[ -z "$SALT_GROUP" ] && SALT_GROUP=salt
# Reset permissions to fix previous installs
CUR_USER=$(ls -dl /run/salt-api.pid | cut -d ' ' -f 3)
CUR_GROUP=$(ls -dl /run/salt-api.pid | cut -d ' ' -f 4)
db_set salt-api/user $CUR_USER
chown -R $CUR_USER:$CUR_GROUP /var/log/salt/api
if command -v systemctl; then
SM_ENABLED=$(systemctl show -p UnitFileState salt-api | cut -d '=' -f 2)
db_set salt-api/enabled $SM_ENABLED
SM_ACTIVE=$(systemctl is-active salt-api)
db_set salt-api/active $SM_ACTIVE
else
db_set salt-api/enabled enabled
db_set salt-api/active active
fi
;;
esac

View file

@ -0,0 +1,17 @@
Template: salt-api/user
Type: string
Default: salt
Description: User for salt-api
User to run the salt-api process as
Template: salt-api/enabled
Type: string
Default: enabled
Description: Systemd enable state for salt-api
default enable state for salt-api systemd state
Template: salt-api/active
Type: string
Default: active
Description: Systemd active state for salt-api
default active state for salt-api systemd state

View file

@ -1,6 +1,13 @@
#!/bin/sh
. /usr/share/debconf/confmodule
case "$1" in case "$1" in
configure) configure)
PY_VER=$(/opt/saltstack/salt/bin/python3 -c "import sys; sys.stdout.write('{}.{}'.format(*sys.version_info)); sys.stdout.flush;") db_get salt-master/user
chown -R salt:salt /etc/salt/cloud.deploy.d /opt/saltstack/salt/lib/python${PY_VER}/site-packages/salt/cloud/deploy if [ "$RET" != "root" ]; then
PY_VER=$(/opt/saltstack/salt/bin/python3 -c "import sys; sys.stdout.write('{}.{}'.format(*sys.version_info)); sys.stdout.flush;")
chown -R $RET:$RET /etc/salt/cloud.deploy.d /opt/saltstack/salt/lib/python${PY_VER}/site-packages/salt/cloud/deploy
fi
;; ;;
esac esac

View file

@ -1,14 +1,41 @@
#!/bin/sh
. /usr/share/debconf/confmodule
case "$1" in case "$1" in
configure) configure)
if [ ! -e "/var/log/salt/master" ]; then db_get salt-master/user
touch /var/log/salt/master if [ "$RET" != "root" ]; then
chmod 640 /var/log/salt/master if [ ! -e "/var/log/salt/master" ]; then
touch /var/log/salt/master
chmod 640 /var/log/salt/master
fi
if [ ! -e "/var/log/salt/key" ]; then
touch /var/log/salt/key
chmod 640 /var/log/salt/key
fi
chown -R $RET:$RET /etc/salt/pki/master /etc/salt/master.d /var/log/salt/master /var/log/salt/key /var/cache/salt/master /var/run/salt/master
fi fi
if [ ! -e "/var/log/salt/key" ]; then if command -v systemctl; then
touch /var/log/salt/key db_get salt-master/active
chmod 640 /var/log/salt/key RESLT=$(echo "$RET" | cut -d ' ' -f 1)
if [ "$RESLT" != 10 ]; then
systemctl daemon-reload
if [ "$RESLT" = "active" ]; then
systemctl restart salt-master
fi
db_get salt-master/enabled
RESLT=$(echo "$RET" | cut -d ' ' -f 1)
if [ "$RESLT" = "disabled" ]; then
systemctl disable salt-master
else
systemctl enable salt-master
fi
else
systemctl daemon-reload
systemctl restart salt-master
systemctl enable salt-master
fi
fi fi
chown -R salt:salt /etc/salt/pki/master /etc/salt/master.d /var/log/salt/master /var/log/salt/key /var/cache/salt/master /var/run/salt/master
if command -v systemctl; then systemctl enable salt-master; fi
;; ;;
esac esac

View file

@ -1,5 +1,9 @@
#!/bin/sh
. /usr/share/debconf/confmodule
case "$1" in case "$1" in
install|upgrade) install)
[ -z "$SALT_HOME" ] && SALT_HOME=/opt/saltstack/salt [ -z "$SALT_HOME" ] && SALT_HOME=/opt/saltstack/salt
[ -z "$SALT_USER" ] && SALT_USER=salt [ -z "$SALT_USER" ] && SALT_USER=salt
[ -z "$SALT_NAME" ] && SALT_NAME="Salt" [ -z "$SALT_NAME" ] && SALT_NAME="Salt"
@ -8,11 +12,37 @@ case "$1" in
# Reset permissions to fix previous installs # Reset permissions to fix previous installs
find ${SALT_HOME} /etc/salt /var/log/salt /var/cache/salt /var/run/salt \ find ${SALT_HOME} /etc/salt /var/log/salt /var/cache/salt /var/run/salt \
\! \( -path /etc/salt/cloud.deploy.d\* -o -path /var/log/salt/cloud -o -path /opt/saltstack/salt/lib/python${PY_VER}/site-packages/salt/cloud/deploy\* \) -a \ \! \( -path /etc/salt/cloud.deploy.d\* -o -path /var/log/salt/cloud -o -path \
\( -user ${SALT_USER} -o -group ${SALT_GROUP} \) -exec chown root:root \{\} \; /opt/saltstack/salt/lib/python${PY_VER}/site-packages/salt/cloud/deploy\* \) -a \( -user ${SALT_USER} \
-o -group ${SALT_GROUP} \) -exec chown ${SALT_USER}:${SALT_GROUP} \{\} \;
# remove incorrectly installed ufw salt-master directory - issue 57712 ;;
test -d /etc/ufw/applications.d/salt-master && rm -rf /etc/ufw/applications.d/salt-master || /bin/true
;; upgrade)
[ -z "$SALT_HOME" ] && SALT_HOME=/opt/saltstack/salt
[ -z "$SALT_USER" ] && SALT_USER=salt
[ -z "$SALT_NAME" ] && SALT_NAME="Salt"
[ -z "$SALT_GROUP" ] && SALT_GROUP=salt
PY_VER=$(/opt/saltstack/salt/bin/python3 -c "import sys; sys.stdout.write('{}.{}'.format(*sys.version_info)); sys.stdout.flush();")
# Reset permissions to fix previous installs
CUR_USER=$(ls -dl /run/salt/master | cut -d ' ' -f 3)
CUR_GROUP=$(ls -dl /run/salt/master | cut -d ' ' -f 4)
db_set salt-master/user $CUR_USER
chown -R $CUR_USER:$CUR_GROUP /etc/salt/pki/master /etc/salt/master.d /var/log/salt/master \
/var/log/salt/key /var/cache/salt/master /var/run/salt/master
if command -v systemctl; then
SM_ENABLED=$(systemctl show -p UnitFileState salt-master | cut -d '=' -f 2)
db_set salt-master/enabled $SM_ENABLED
SM_ACTIVE=$(systemctl is-active salt-master)
db_set salt-master/active $SM_ACTIVE
else
db_set salt-master/enabled enabled
db_set salt-master/active active
fi
;;
esac esac
# remove incorrectly installed ufw salt-master directory - issue 57712
test -d /etc/ufw/applications.d/salt-master && rm -rf /etc/ufw/applications.d/salt-master || /bin/true

View file

@ -0,0 +1,17 @@
Template: salt-master/user
Type: string
Default: salt
Description: User for salt-master
User to run the salt-master process as
Template: salt-master/enabled
Type: string
Default: enabled
Description: Systemd enable state for salt-master
default enable state for salt-master systemd state
Template: salt-master/active
Type: string
Default: active
Description: Systemd active state for salt-master
default active state for salt-master systemd state

View file

@ -0,0 +1,41 @@
#!/bin/sh
. /usr/share/debconf/confmodule
case "$1" in
configure)
db_get salt-minion/user
if [ "$RET" != "root" ]; then
if [ ! -e "/var/log/salt/minion" ]; then
touch /var/log/salt/minion
chmod 640 /var/log/salt/minion
fi
if [ ! -e "/var/log/salt/key" ]; then
touch /var/log/salt/key
chmod 640 /var/log/salt/key
fi
chown -R $RET:$RET /etc/salt/pki/minion /etc/salt/minion.d /var/log/salt/minion /var/cache/salt/minion /var/run/salt/minion
fi
if command -v systemctl; then
db_get salt-minion/active
RESLT=$(echo "$RET" | cut -d ' ' -f 1)
if [ "$RESLT" != 10 ]; then
systemctl daemon-reload
if [ "$RESLT" = "active" ]; then
systemctl restart salt-minion
fi
db_get salt-minion/enabled
RESLT=$(echo "$RET" | cut -d ' ' -f 1)
if [ "$RESLT" = "disabled" ]; then
systemctl disable salt-minion
else
systemctl enable salt-minion
fi
else
systemctl daemon-reload
systemctl restart salt-minion
systemctl enable salt-minion
fi
fi
;;
esac

View file

@ -0,0 +1,30 @@
#!/bin/sh
. /usr/share/debconf/confmodule
case "$1" in
upgrade)
[ -z "$SALT_HOME" ] && SALT_HOME=/opt/saltstack/salt
[ -z "$SALT_USER" ] && SALT_USER=salt
[ -z "$SALT_NAME" ] && SALT_NAME="Salt"
[ -z "$SALT_GROUP" ] && SALT_GROUP=salt
PY_VER=$(/opt/saltstack/salt/bin/python3 -c "import sys; sys.stdout.write('{}.{}'.format(*sys.version_info)); sys.stdout.flush();")
# Reset permissions to fix previous installs
CUR_USER=$(ls -dl /run/salt/minion | cut -d ' ' -f 3)
CUR_GROUP=$(ls -dl /run/salt/minion | cut -d ' ' -f 4)
db_set salt-minion/user $CUR_USER
chown -R $CUR_USER:$CUR_GROUP /etc/salt/pki/minion /etc/salt/minion.d /var/log/salt/minion \
/var/cache/salt/minion /var/run/salt/minion
if command -v systemctl; then
SM_ENABLED=$(systemctl show -p UnitFileState salt-minion | cut -d '=' -f 2)
db_set salt-minion/enabled $SM_ENABLED
SM_ACTIVE=$(systemctl is-active salt-minion)
db_set salt-minion/active $SM_ACTIVE
else
db_set salt-minion/enabled enabled
db_set salt-minion/active active
fi
;;
esac

View file

@ -0,0 +1,17 @@
Template: salt-minion/user
Type: string
Default: root
Description: User for salt-minion
User to run the salt-minion process as
Template: salt-minion/enabled
Type: string
Default: enabled
Description: Systemd enable state for salt-minion
default enable state for salt-minion systemd state
Template: salt-minion/active
Type: string
Default: active
Description: Systemd active state for salt-minion
default active state for salt-minion systemd state

View file

@ -15,10 +15,18 @@
%global __requires_exclude_from ^.*$ %global __requires_exclude_from ^.*$
%define _source_payload w2.gzdio %define _source_payload w2.gzdio
%define _binary_payload w2.gzdio %define _binary_payload w2.gzdio
%define _SALT_GROUP salt %global _SALT_GROUP salt
%define _SALT_USER salt %global _SALT_USER salt
%define _SALT_NAME Salt %global _SALT_NAME Salt
%define _SALT_HOME /opt/saltstack/salt %global _SALT_HOME /opt/saltstack/salt
# salt-master current user and group
%global _MS_CUR_USER %{_SALT_USER}
%global _MS_CUR_GROUP %{_SALT_GROUP}
# salt-minion current user and group
%global _MN_CUR_USER %{_SALT_USER}
%global _MN_CUR_GROUP %{_SALT_GROUP}
# Disable debugsource template # Disable debugsource template
%define _debugsource_template %{nil} %define _debugsource_template %{nil}
@ -425,11 +433,22 @@ usermod -c "%{_SALT_NAME}" \
%{_SALT_USER} %{_SALT_USER}
%pre master %pre master
# Reset permissions to fix previous installs if [ $1 -gt 1 ] ; then
PY_VER=$(/opt/saltstack/salt/bin/python3 -c "import sys; sys.stdout.write('{}.{}'.format(*sys.version_info)); sys.stdout.flush();") # Reset permissions to match previous installs - performing upgrade
find /etc/salt /opt/saltstack/salt /var/log/salt /var/cache/salt /var/run/salt \ _MS_LCUR_USER=$(ls -dl /run/salt/master | cut -d ' ' -f 3)
\! \( -path /etc/salt/cloud.deploy.d\* -o -path /var/log/salt/cloud -o -path /opt/saltstack/salt/lib/python${PY_VER}/site-packages/salt/cloud/deploy\* \) -a \ _MS_LCUR_GROUP=$(ls -dl /run/salt/master | cut -d ' ' -f 4)
\( -user salt -o -group salt \) -exec chown root:root \{\} \; %global _MS_CUR_USER %{_MS_LCUR_USER}
%global _MS_CUR_GROUP %{_MS_LCUR_GROUP}
fi
%pre minion
if [ $1 -gt 1 ] ; then
# Reset permissions to match previous installs - performing upgrade
_MN_LCUR_USER=$(ls -dl /run/salt/minion | cut -d ' ' -f 3)
_MN_LCUR_GROUP=$(ls -dl /run/salt/minion | cut -d ' ' -f 4)
%global _MN_CUR_USER %{_MN_LCUR_USER}
%global _MN_CUR_GROUP %{_MN_LCUR_GROUP}
fi
# assumes systemd for RHEL 7 & 8 & 9 # assumes systemd for RHEL 7 & 8 & 9
@ -558,7 +577,12 @@ if [ ! -e "/var/log/salt/cloud" ]; then
touch /var/log/salt/cloud touch /var/log/salt/cloud
chmod 640 /var/log/salt/cloud chmod 640 /var/log/salt/cloud
fi fi
chown -R %{_SALT_USER}:%{_SALT_GROUP} /etc/salt/cloud.deploy.d /var/log/salt/cloud /opt/saltstack/salt/lib/python${PY_VER}/site-packages/salt/cloud/deploy if [ $1 -gt 1 ] ; then
# Reset permissions to match previous installs - performing upgrade
chown -R %{_MS_CUR_USER}:%{_MS_CUR_GROUP} /etc/salt/cloud.deploy.d /var/log/salt/cloud /opt/saltstack/salt/lib/python${PY_VER}/site-packages/salt/cloud/deploy
else
chown -R %{_SALT_USER}:%{_SALT_GROUP} /etc/salt/cloud.deploy.d /var/log/salt/cloud /opt/saltstack/salt/lib/python${PY_VER}/site-packages/salt/cloud/deploy
fi
%posttrans master %posttrans master
@ -570,7 +594,12 @@ if [ ! -e "/var/log/salt/key" ]; then
touch /var/log/salt/key touch /var/log/salt/key
chmod 640 /var/log/salt/key chmod 640 /var/log/salt/key
fi fi
chown -R %{_SALT_USER}:%{_SALT_GROUP} /etc/salt/pki/master /etc/salt/master.d /var/log/salt/master /var/log/salt/key /var/cache/salt/master /var/run/salt/master if [ $1 -gt 1 ] ; then
# Reset permissions to match previous installs - performing upgrade
chown -R %{_MS_CUR_USER}:%{_MS_CUR_GROUP} /etc/salt/pki/master /etc/salt/master.d /var/log/salt/master /var/log/salt/key /var/cache/salt/master /var/run/salt/master
else
chown -R %{_SALT_USER}:%{_SALT_GROUP} /etc/salt/pki/master /etc/salt/master.d /var/log/salt/master /var/log/salt/key /var/cache/salt/master /var/run/salt/master
fi
%posttrans api %posttrans api
@ -578,7 +607,26 @@ if [ ! -e "/var/log/salt/api" ]; then
touch /var/log/salt/api touch /var/log/salt/api
chmod 640 /var/log/salt/api chmod 640 /var/log/salt/api
fi fi
chown %{_SALT_USER}:%{_SALT_GROUP} /var/log/salt/api if [ $1 -gt 1 ] ; then
# Reset permissions to match previous installs - performing upgrade
chown -R %{_MS_CUR_USER}:%{_MS_CUR_GROUP} /var/log/salt/api
else
chown -R %{_SALT_USER}:%{_SALT_GROUP} /var/log/salt/api
fi
%posttrans minion
if [ ! -e "/var/log/salt/minion" ]; then
touch /var/log/salt/minion
chmod 640 /var/log/salt/minion
fi
if [ ! -e "/var/log/salt/key" ]; then
touch /var/log/salt/key
chmod 640 /var/log/salt/key
fi
if [ $1 -gt 1 ] ; then
# Reset permissions to match previous installs - performing upgrade
chown -R %{_MN_CUR_USER}:%{_MN_CUR_GROUP} /etc/salt/pki/minion /etc/salt/minion.d /var/log/salt/minion /var/cache/salt/minion /var/run/salt/minion
fi
%preun %preun
@ -688,6 +736,74 @@ fi
- Bump to ``jinja2==3.1.4`` due to https://github.com/advisories/GHSA-h75v-3vvj-5mfj [#66488](https://github.com/saltstack/salt/issues/66488) - Bump to ``jinja2==3.1.4`` due to https://github.com/advisories/GHSA-h75v-3vvj-5mfj [#66488](https://github.com/saltstack/salt/issues/66488)
* Mon Jul 29 2024 Salt Project Packaging <saltproject-packaging@vmware.com> - 3006.9
# Deprecated
- Drop CentOS 7 support [#66623](https://github.com/saltstack/salt/issues/66623)
- No longer build RPM packages with CentOS Stream 9 [#66624](https://github.com/saltstack/salt/issues/66624)
# Fixed
- Made slsutil.renderer work with salt-ssh [#50196](https://github.com/saltstack/salt/issues/50196)
- Fixed defaults.merge is not available when using salt-ssh [#51605](https://github.com/saltstack/salt/issues/51605)
- Fixed config.get does not support merge option with salt-ssh [#56441](https://github.com/saltstack/salt/issues/56441)
- Update to include croniter in pkg requirements [#57649](https://github.com/saltstack/salt/issues/57649)
- Fixed state.test does not work with salt-ssh [#61100](https://github.com/saltstack/salt/issues/61100)
- Made slsutil.findup work with salt-ssh [#61143](https://github.com/saltstack/salt/issues/61143)
- Fixes multiple issues with the cmd module on Windows. Scripts are called using
the ``-File`` parameter to the ``powershell.exe`` binary. ``CLIXML`` data in
stderr is now removed (only applies to encoded commands). Commands can now be
sent to ``cmd.powershell`` as a list. Makes sure JSON data returned is valid.
Strips whitespace from the return when using ``runas``. [#61166](https://github.com/saltstack/salt/issues/61166)
- Fixed the win_lgpo_netsh salt util to handle non-English systems. This was a
rewrite to use PowerShell instead of netsh to make the changes on the system [#61534](https://github.com/saltstack/salt/issues/61534)
- file.replace and file.search work properly with /proc files [#63102](https://github.com/saltstack/salt/issues/63102)
- Fix utf8 handling in 'pass' renderer [#64300](https://github.com/saltstack/salt/issues/64300)
- Fixed incorrect version argument will be ignored for multiple package targets warning when using pkgs argument to yumpkg module. [#64563](https://github.com/saltstack/salt/issues/64563)
- salt-cloud honors root_dir config setting for log_file location and fixes for root_dir locations on windows. [#64728](https://github.com/saltstack/salt/issues/64728)
- Fixed slsutil.update with salt-ssh during template rendering [#65067](https://github.com/saltstack/salt/issues/65067)
- Fix config.items when called on minion [#65251](https://github.com/saltstack/salt/issues/65251)
- Ensure on rpm and deb systems, that user and group for existing Salt, is maintained on upgrade [#65264](https://github.com/saltstack/salt/issues/65264)
- Fix typo in nftables module to ensure unique nft family values [#65295](https://github.com/saltstack/salt/issues/65295)
- pkg.installed state aggregate does not honors requires requisite [#65304](https://github.com/saltstack/salt/issues/65304)
- Added SSH wrapper for logmod [#65630](https://github.com/saltstack/salt/issues/65630)
- Fix for GitFS failure to unlock lock file, and resource cleanup for process SIGTERM [#65816](https://github.com/saltstack/salt/issues/65816)
- Corrected x509_v2 CRL creation `last_update` and `next_update` values when system timezone is not UTC [#65837](https://github.com/saltstack/salt/issues/65837)
- Make sure the root minion process handles SIGUSR1 and emits a traceback like it's child processes [#66095](https://github.com/saltstack/salt/issues/66095)
- Replaced pyvenv with builtin venv for virtualenv_mod [#66132](https://github.com/saltstack/salt/issues/66132)
- Made `file.managed` skip download of a remote source if the managed file already exists with the correct hash [#66342](https://github.com/saltstack/salt/issues/66342)
- Fix win_task ExecutionTimeLimit and result/error code interpretation [#66347](https://github.com/saltstack/salt/issues/66347), [#66441](https://github.com/saltstack/salt/issues/66441)
- Fixed nftables.build_rule breaks ipv6 rules by using the wrong syntax for source and destination addresses [#66382](https://github.com/saltstack/salt/issues/66382)
- Fixed x509_v2 certificate.managed crash for locally signed certificates if the signing policy defines signing_private_key [#66414](https://github.com/saltstack/salt/issues/66414)
- Fixed parallel state execution with Salt-SSH [#66514](https://github.com/saltstack/salt/issues/66514)
- Fix support for FIPS approved encryption and signing algorithms. [#66579](https://github.com/saltstack/salt/issues/66579)
- Fix relative file_roots paths [#66588](https://github.com/saltstack/salt/issues/66588)
- Fixed an issue with cmd.run with requirements when the shell is not the
default [#66596](https://github.com/saltstack/salt/issues/66596)
- Fix RPM package provides [#66604](https://github.com/saltstack/salt/issues/66604)
- Upgrade relAenv to 0.16.1. This release fixes several package installs for salt-pip [#66632](https://github.com/saltstack/salt/issues/66632)
- Upgrade relenv to 0.17.0 (https://github.com/saltstack/relenv/blob/v0.17.0/CHANGELOG.md) [#66663](https://github.com/saltstack/salt/issues/66663)
- Upgrade dependencies due to security issues:
- pymysql>=1.1.1
- requests>=2.32.0
- docker>=7.1.0 [#66666](https://github.com/saltstack/salt/issues/66666)
- Corrected missed line in branch 3006.x when backporting from PR 61620 and 65044 [#66683](https://github.com/saltstack/salt/issues/66683)
- Remove debug output from shell scripts for packaging [#66747](https://github.com/saltstack/salt/issues/66747)
# Added
- Add Ubuntu 24.04 support [#66180](https://github.com/saltstack/salt/issues/66180)
- Add Fedora 40 support, replacing Fedora 39 [#66300](https://github.com/saltstack/salt/issues/66300)
- Build RPM packages with Rocky Linux 9 (instead of CentOS Stream 9) [#66624](https://github.com/saltstack/salt/issues/66624)
# Security
- Bump to ``jinja2==3.1.4`` due to https://github.com/advisories/GHSA-h75v-3vvj-5mfj [#66488](https://github.com/saltstack/salt/issues/66488)
- CVE-2024-37088 salt-call will fail with exit code 1 if bad pillar data is
encountered. [#66702](https://github.com/saltstack/salt/issues/66702)
* Mon Apr 29 2024 Salt Project Packaging <saltproject-packaging@vmware.com> - 3006.8 * Mon Apr 29 2024 Salt Project Packaging <saltproject-packaging@vmware.com> - 3006.8
# Removed # Removed
@ -950,6 +1066,7 @@ fi
# Fixed # Fixed
- Fix issue with ownership on upgrade of master and minion files
- Fix an issue with mac_shadow that was causing a command execution error when - Fix an issue with mac_shadow that was causing a command execution error when
retrieving values that were not yet set. For example, retrieving last login retrieving values that were not yet set. For example, retrieving last login
before the user had logged in. [#34658](https://github.com/saltstack/salt/issues/34658) before the user had logged in. [#34658](https://github.com/saltstack/salt/issues/34658)

View file

@ -0,0 +1,52 @@
#------------------------------------------------------------------------------
# StrContains
#
# This function does a case sensitive searches for an occurrence of a substring in a string.
# It returns the substring if it is found.
# Otherwise it returns null("").
# Written by kenglish_hi
# Adapted from StrReplace written by dandaman32
#------------------------------------------------------------------------------
!define StrContains "!insertmacro StrContains"
!macro StrContains OUT NEEDLE HAYSTACK
Push "${HAYSTACK}"
Push "${NEEDLE}"
Call StrContains
Pop "${OUT}"
!macroend
Function StrContains
# Initialize variables
Var /GLOBAL STR_HAYSTACK
Var /GLOBAL STR_NEEDLE
Var /GLOBAL STR_CONTAINS_VAR_1
Var /GLOBAL STR_CONTAINS_VAR_2
Var /GLOBAL STR_CONTAINS_VAR_3
Var /GLOBAL STR_CONTAINS_VAR_4
Var /GLOBAL STR_RETURN_VAR
Exch $STR_NEEDLE
Exch 1
Exch $STR_HAYSTACK
# Uncomment to debug
#MessageBox MB_OK 'STR_NEEDLE = $STR_NEEDLE STR_HAYSTACK = $STR_HAYSTACK '
StrCpy $STR_RETURN_VAR ""
StrCpy $STR_CONTAINS_VAR_1 -1
StrLen $STR_CONTAINS_VAR_2 $STR_NEEDLE
StrLen $STR_CONTAINS_VAR_4 $STR_HAYSTACK
loop:
IntOp $STR_CONTAINS_VAR_1 $STR_CONTAINS_VAR_1 + 1
StrCpy $STR_CONTAINS_VAR_3 $STR_HAYSTACK $STR_CONTAINS_VAR_2 $STR_CONTAINS_VAR_1
StrCmp $STR_CONTAINS_VAR_3 $STR_NEEDLE found
StrCmp $STR_CONTAINS_VAR_1 $STR_CONTAINS_VAR_4 done
Goto loop
found:
StrCpy $STR_RETURN_VAR $STR_NEEDLE
Goto done
done:
Pop $STR_NEEDLE # Prevent "invalid opcode" errors and keep the stack clean
Exch $STR_RETURN_VAR
FunctionEnd

View file

@ -12,8 +12,17 @@ clean.ps1
clean.ps1 clean.ps1
#> #>
param(
[Parameter(Mandatory=$false)]
[Alias("c")]
# Don't pretify the output of the Write-Result
[Switch] $CICD
)
#-------------------------------------------------------------------------------
# Script Preferences # Script Preferences
#-------------------------------------------------------------------------------
$ProgressPreference = "SilentlyContinue" $ProgressPreference = "SilentlyContinue"
$ErrorActionPreference = "Stop" $ErrorActionPreference = "Stop"
@ -21,15 +30,22 @@ $ErrorActionPreference = "Stop"
# Script Variables # Script Variables
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
$SCRIPT_DIR = (Get-ChildItem "$($myInvocation.MyCommand.Definition)").DirectoryName $SCRIPT_DIR = (Get-ChildItem "$($myInvocation.MyCommand.Definition)").DirectoryName
$PROJECT_DIR = $(git rev-parse --show-toplevel)
$WINDOWS_DIR = "$PROJECT_DIR\pkg\windows"
$BUILDENV_DIR = "$WINDOWS_DIR\buildenv"
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# Script Functions # Script Functions
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
function Write-Result($result, $ForegroundColor="Green") { function Write-Result($result, $ForegroundColor="Green") {
$position = 80 - $result.Length - [System.Console]::CursorLeft if ( $CICD ) {
Write-Host -ForegroundColor $ForegroundColor ("{0,$position}$result" -f "") Write-Host $result -ForegroundColor $ForegroundColor
} else {
$position = 80 - $result.Length - [System.Console]::CursorLeft
Write-Host -ForegroundColor $ForegroundColor ("{0,$position}$result" -f "")
}
} }
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
@ -61,6 +77,51 @@ if ( Test-Path -Path "$SCRIPT_DIR\venv" ) {
Write-Result "Success" -ForegroundColor Green Write-Result "Success" -ForegroundColor Green
} }
} }
#-------------------------------------------------------------------------------
# Remove buildenv directory
#-------------------------------------------------------------------------------
if ( Test-Path -Path "$BUILDENV_DIR" ) {
Write-Host "Removing buildenv directory: " -NoNewline
Remove-Item -Path "$BUILDENV_DIR" -Recurse -Force
if ( Test-Path -Path "$BUILDENV_DIR" ) {
Write-Result "Failed" -ForegroundColor Red
exit 1
} else {
Write-Result "Success" -ForegroundColor Green
}
}
#-------------------------------------------------------------------------------
# Make sure processes are not running
#-------------------------------------------------------------------------------
$processes = "test-setup",
"Un",
"Un_A",
"Un_B",
"Un_C",
"Un_D",
"Un_E",
"Un_F",
"Un_G"
$processes | ForEach-Object {
$proc = Get-Process -Name $_ -ErrorAction SilentlyContinue
if ( ($null -ne $proc) ) {
Write-Host "Killing $($_): " -NoNewline
$proc = Get-WmiObject -Class Win32_Process -Filter "Name='$_.exe'"
$proc.Terminate() *> $null
Start-Sleep -Seconds 5
$proc = Get-Process -Name $_ -ErrorAction SilentlyContinue
if ( ($null -eq $proc) ) {
Write-Result "Success" -ForegroundColor Green
} else {
Write-Result "Failed" -ForegroundColor Red
exit 1
}
}
}
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# Remove test-setup.exe # Remove test-setup.exe
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
@ -75,6 +136,92 @@ if ( Test-Path -Path "$SCRIPT_DIR\test-setup.exe" ) {
} }
} }
#-------------------------------------------------------------------------------
# Remove custom_conf
#-------------------------------------------------------------------------------
if ( Test-Path -Path "$SCRIPT_DIR\custom_conf" ) {
Write-Host "Removing custom_conf: " -NoNewline
Remove-Item -Path "$SCRIPT_DIR\custom_conf" -Recurse -Force
if ( Test-Path -Path "$SCRIPT_DIR\custom_conf" ) {
Write-Result "Failed" -ForegroundColor Red
exit 1
} else {
Write-Result "Success" -ForegroundColor Green
}
}
#-------------------------------------------------------------------------------
# Remove the salt-minion service
#-------------------------------------------------------------------------------
if ( $(Get-Service -Name salt-minion -ErrorAction SilentlyContinue).Name ) {
Write-Host "Removing salt-minion service" -NoNewline
Stop-Service -Name salt-minion
$service = Get-WmiObject -Class Win32_Service -Filter "Name='salt-minion'"
$service.delete() *> $null
if ( $(Get-Service -Name salt-minion -ErrorAction SilentlyContinue).Name ) {
Write-Result "Failed" -ForegroundColor Red
exit 1
} else {
Write-Result "Success" -ForegroundColor Green
}
}
#-------------------------------------------------------------------------------
# Remove Salt Project directory from Program Files
#-------------------------------------------------------------------------------
if ( Test-Path -Path "$env:ProgramFiles\Salt Project" ) {
Write-Host "Removing Salt Project from Program Files: " -NoNewline
Remove-Item -Path "$env:ProgramFiles\Salt Project" -Recurse -Force
if ( Test-Path -Path "$env:ProgramFiles\Salt Project" ) {
Write-Result "Failed" -ForegroundColor Red
exit 1
} else {
Write-Result "Success" -ForegroundColor Green
}
}
#-------------------------------------------------------------------------------
# Remove Salt Project directory from ProgramData
#-------------------------------------------------------------------------------
if ( Test-Path -Path "$env:ProgramData\Salt Project" ) {
Write-Host "Removing Salt Project from ProgramData: " -NoNewline
Remove-Item -Path "$env:ProgramData\Salt Project" -Recurse -Force
if ( Test-Path -Path "$env:ProgramData\Salt Project" ) {
Write-Result "Failed" -ForegroundColor Red
exit 1
} else {
Write-Result "Success" -ForegroundColor Green
}
}
#-------------------------------------------------------------------------------
# Remove Salt Project from Registry
#-------------------------------------------------------------------------------
if ( Test-Path -Path "HKLM:SOFTWARE\Salt Project" ) {
Write-Host "Removing Salt Project from Software: " -NoNewline
Remove-Item -Path "HKLM:SOFTWARE\Salt Project" -Recurse -Force
if ( Test-Path -Path "HKLM:SOFTWARE\Salt Project" ) {
Write-Result "Failed" -ForegroundColor Red
exit 1
} else {
Write-Result "Success" -ForegroundColor Green
}
}
#-------------------------------------------------------------------------------
# Remove Salt Minion directory from Registry
#-------------------------------------------------------------------------------
if ( Test-Path -Path "HKLM:SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Salt Minion" ) {
Write-Host "Removing Salt Minion from the Uninstall: " -NoNewline
Remove-Item -Path "HKLM:SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Salt Minion" -Recurse -Force
if ( Test-Path -Path "HKLM:SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Salt Minion" ) {
Write-Result "Failed" -ForegroundColor Red
exit 1
} else {
Write-Result "Success" -ForegroundColor Green
}
}
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# Script Completed # Script Completed
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------

View file

@ -6,32 +6,38 @@ import pytest
@pytest.fixture(scope="module") @pytest.fixture(scope="module")
def install(): def install():
pytest.helpers.clean_env() pytest.helpers.clean_env()
# Create a custom config # Create a custom config
pytest.helpers.custom_config() full_path_conf = pytest.helpers.custom_config()
# Install salt with custom config
full_path_conf = rf"{pytest.REPO_DIR}\custom_conf" args = ["/S", f"/custom-config={full_path_conf}"]
pytest.helpers.install_salt(args)
pytest.helpers.run_command( yield args
[pytest.INST_BIN, "/S", f"/custom-config={full_path_conf}"]
)
yield
pytest.helpers.clean_env() pytest.helpers.clean_env()
def test_binaries_present(install): def test_binaries_present(install):
assert os.path.exists(rf"{pytest.INST_DIR}\ssm.exe") # This will show the contents of the directory on failure
inst_dir = pytest.INST_DIR
inst_dir_exists = os.path.exists(inst_dir)
dir_contents = os.listdir(inst_dir)
assert os.path.exists(rf"{inst_dir}\ssm.exe")
def test_config_present(install): def test_config_present(install):
assert os.path.exists(rf"{pytest.DATA_DIR}\conf\minion") data_dir = pytest.DATA_DIR
data_dir_exists = os.path.exists(data_dir)
assert os.path.exists(rf"{data_dir}\conf\minion")
def test_config_correct(install): def test_config_correct(install):
# The config file should be the custom config, unchanged # The config file should be the custom config, unchanged
with open(rf"{pytest.REPO_DIR}\custom_conf") as f: script_dir = pytest.SCRIPT_DIR
script_dir_exists = os.path.exists(script_dir)
with open(rf"{script_dir}\custom_conf") as f:
expected = f.readlines() expected = f.readlines()
data_dir = pytest.DATA_DIR
data_dir_exists = os.path.exists(data_dir)
with open(rf"{pytest.DATA_DIR}\conf\minion") as f: with open(rf"{pytest.DATA_DIR}\conf\minion") as f:
result = f.readlines() result = f.readlines()

View file

@ -6,19 +6,21 @@ import pytest
@pytest.fixture(scope="module") @pytest.fixture(scope="module")
def install(): def install():
pytest.helpers.clean_env() pytest.helpers.clean_env()
# Create a custom config # Create a custom config
pytest.helpers.custom_config() pytest.helpers.custom_config()
# Install salt with custom config
pytest.helpers.run_command( args = ["/S", "/custom-config=custom_conf", "/master=cli_master"]
[pytest.INST_BIN, "/S", "/custom-config=custom_conf", "/master=cli_master"] pytest.helpers.install_salt(args)
) yield args
yield
pytest.helpers.clean_env() pytest.helpers.clean_env()
def test_binaries_present(install): def test_binaries_present(install):
assert os.path.exists(rf"{pytest.INST_DIR}\ssm.exe") # This will show the contents of the directory on failure
inst_dir = pytest.INST_DIR
inst_dir_exists = os.path.exists(inst_dir)
dir_contents = os.listdir(inst_dir)
assert os.path.exists(rf"{inst_dir}\ssm.exe")
def test_config_present(install): def test_config_present(install):

View file

@ -6,25 +6,26 @@ import pytest
@pytest.fixture(scope="module") @pytest.fixture(scope="module")
def install(): def install():
pytest.helpers.clean_env() pytest.helpers.clean_env()
# Create a custom config # Create a custom config
pytest.helpers.custom_config() pytest.helpers.custom_config()
# Install salt with custom config
pytest.helpers.run_command( args = [
[ "/S",
pytest.INST_BIN, "/custom-config=custom_conf",
"/S", "/master=cli_master",
"/custom-config=custom_conf", "/minion-name=cli_minion",
"/master=cli_master", ]
"/minion-name=cli_minion", pytest.helpers.install_salt(args)
] yield args
)
yield
pytest.helpers.clean_env() pytest.helpers.clean_env()
def test_binaries_present(install): def test_binaries_present(install):
assert os.path.exists(rf"{pytest.INST_DIR}\ssm.exe") # This will show the contents of the directory on failure
inst_dir = pytest.INST_DIR
inst_dir_exists = os.path.exists(inst_dir)
dir_contents = os.listdir(inst_dir)
assert os.path.exists(rf"{inst_dir}\ssm.exe")
def test_config_present(install): def test_config_present(install):

View file

@ -6,24 +6,21 @@ import pytest
@pytest.fixture(scope="module") @pytest.fixture(scope="module")
def install(): def install():
pytest.helpers.clean_env() pytest.helpers.clean_env()
# Create a custom config # Create a custom config
pytest.helpers.custom_config() pytest.helpers.custom_config()
# Install salt with custom config
pytest.helpers.run_command( args = ["/S", "/custom-config=custom_conf", "/minion-name=cli_minion"]
[ pytest.helpers.install_salt(args)
pytest.INST_BIN, yield args
"/S",
"/custom-config=custom_conf",
"/minion-name=cli_minion",
]
)
yield
pytest.helpers.clean_env() pytest.helpers.clean_env()
def test_binaries_present(install): def test_binaries_present(install):
assert os.path.exists(rf"{pytest.INST_DIR}\ssm.exe") # This will show the contents of the directory on failure
inst_dir = pytest.INST_DIR
inst_dir_exists = os.path.exists(inst_dir)
dir_contents = os.listdir(inst_dir)
assert os.path.exists(rf"{inst_dir}\ssm.exe")
def test_config_present(install): def test_config_present(install):

View file

@ -6,17 +6,21 @@ import pytest
@pytest.fixture(scope="module") @pytest.fixture(scope="module")
def install(): def install():
pytest.helpers.clean_env() pytest.helpers.clean_env()
# Create a custom config # Create a custom config
pytest.helpers.custom_config() pytest.helpers.custom_config()
# Install salt with custom config
pytest.helpers.run_command([pytest.INST_BIN, "/S", "/custom-config=custom_conf"]) args = ["/S", "/custom-config=custom_conf"]
yield pytest.helpers.install_salt(args)
yield args
pytest.helpers.clean_env() pytest.helpers.clean_env()
def test_binaries_present(install): def test_binaries_present(install):
assert os.path.exists(rf"{pytest.INST_DIR}\ssm.exe") # This will show the contents of the directory on failure
inst_dir = pytest.INST_DIR
inst_dir_exists = os.path.exists(inst_dir)
dir_contents = os.listdir(inst_dir)
assert os.path.exists(rf"{inst_dir}\ssm.exe")
def test_config_present(install): def test_config_present(install):
@ -25,7 +29,7 @@ def test_config_present(install):
def test_config_correct(install): def test_config_correct(install):
# The config file should be the custom config, unchanged # The config file should be the custom config, unchanged
with open(rf"{pytest.REPO_DIR}\custom_conf") as f: with open(rf"{pytest.SCRIPT_DIR}\custom_conf") as f:
expected = f.readlines() expected = f.readlines()
with open(rf"{pytest.DATA_DIR}\conf\minion") as f: with open(rf"{pytest.DATA_DIR}\conf\minion") as f:

View file

@ -6,13 +6,18 @@ import pytest
@pytest.fixture(scope="module") @pytest.fixture(scope="module")
def install(): def install():
pytest.helpers.clean_env() pytest.helpers.clean_env()
pytest.helpers.run_command([pytest.INST_BIN, "/S"]) args = ["/S"]
yield pytest.helpers.install_salt(args)
yield args
pytest.helpers.clean_env() pytest.helpers.clean_env()
def test_binaries_present(install): def test_binaries_present(install):
assert os.path.exists(rf"{pytest.INST_DIR}\ssm.exe") # This will show the contents of the directory on failure
inst_dir = pytest.INST_DIR
inst_dir_exists = os.path.exists(inst_dir)
dir_contents = os.listdir(inst_dir)
assert os.path.exists(rf"{inst_dir}\ssm.exe")
def test_config_present(install): def test_config_present(install):
@ -21,7 +26,7 @@ def test_config_present(install):
def test_config_correct(install): def test_config_correct(install):
# The config file should be the default config, unchanged # The config file should be the default config, unchanged
with open(rf"{pytest.REPO_DIR}\_files\minion") as f: with open(rf"{pytest.SCRIPT_DIR}\_files\minion") as f:
expected = f.readlines() expected = f.readlines()
with open(rf"{pytest.DATA_DIR}\conf\minion") as f: with open(rf"{pytest.DATA_DIR}\conf\minion") as f:

View file

@ -6,13 +6,18 @@ import pytest
@pytest.fixture(scope="module") @pytest.fixture(scope="module")
def install(): def install():
pytest.helpers.clean_env() pytest.helpers.clean_env()
pytest.helpers.run_command([pytest.INST_BIN, "/S", "/master=cli_master"]) args = ["/S", "/master=cli_master"]
yield pytest.helpers.install_salt(args)
yield args
pytest.helpers.clean_env() pytest.helpers.clean_env()
def test_binaries_present(install): def test_binaries_present(install):
assert os.path.exists(rf"{pytest.INST_DIR}\ssm.exe") # This will show the contents of the directory on failure
inst_dir = pytest.INST_DIR
inst_dir_exists = os.path.exists(inst_dir)
dir_contents = os.listdir(inst_dir)
assert os.path.exists(rf"{inst_dir}\ssm.exe")
def test_config_present(install): def test_config_present(install):

View file

@ -6,15 +6,18 @@ import pytest
@pytest.fixture(scope="module") @pytest.fixture(scope="module")
def install(): def install():
pytest.helpers.clean_env() pytest.helpers.clean_env()
pytest.helpers.run_command( args = ["/S", "/master=cli_master", "/minion-name=cli_minion"]
[pytest.INST_BIN, "/S", "/master=cli_master", "/minion-name=cli_minion"] pytest.helpers.install_salt(args)
) yield args
yield
pytest.helpers.clean_env() pytest.helpers.clean_env()
def test_binaries_present(install): def test_binaries_present(install):
assert os.path.exists(rf"{pytest.INST_DIR}\ssm.exe") # This will show the contents of the directory on failure
inst_dir = pytest.INST_DIR
inst_dir_exists = os.path.exists(inst_dir)
dir_contents = os.listdir(inst_dir)
assert os.path.exists(rf"{inst_dir}\ssm.exe")
def test_config_present(install): def test_config_present(install):

View file

@ -6,13 +6,18 @@ import pytest
@pytest.fixture(scope="module") @pytest.fixture(scope="module")
def install(): def install():
pytest.helpers.clean_env() pytest.helpers.clean_env()
pytest.helpers.run_command([pytest.INST_BIN, "/S", "/minion-name=cli_minion"]) args = ["/S", "/minion-name=cli_minion"]
yield pytest.helpers.install_salt(args)
yield args
pytest.helpers.clean_env() pytest.helpers.clean_env()
def test_binaries_present(install): def test_binaries_present(install):
assert os.path.exists(rf"{pytest.INST_DIR}\ssm.exe") # This will show the contents of the directory on failure
inst_dir = pytest.INST_DIR
inst_dir_exists = os.path.exists(inst_dir)
dir_contents = os.listdir(inst_dir)
assert os.path.exists(rf"{inst_dir}\ssm.exe")
def test_config_present(install): def test_config_present(install):

View file

@ -6,17 +6,20 @@ import pytest
@pytest.fixture(scope="module") @pytest.fixture(scope="module")
def install(): def install():
pytest.helpers.clean_env() pytest.helpers.clean_env()
# Create an existing config # Create an existing config
pytest.helpers.existing_config() pytest.helpers.existing_config()
args = ["/S"]
pytest.helpers.run_command([pytest.INST_BIN, "/S"]) pytest.helpers.install_salt(args)
yield yield args
pytest.helpers.clean_env() pytest.helpers.clean_env()
def test_binaries_present(install): def test_binaries_present(install):
assert os.path.exists(rf"{pytest.INST_DIR}\ssm.exe") # This will show the contents of the directory on failure
inst_dir = pytest.INST_DIR
inst_dir_exists = os.path.exists(inst_dir)
dir_contents = os.listdir(inst_dir)
assert os.path.exists(rf"{inst_dir}\ssm.exe")
def test_config_present(install): def test_config_present(install):

View file

@ -6,20 +6,22 @@ import pytest
@pytest.fixture(scope="module") @pytest.fixture(scope="module")
def install(): def install():
pytest.helpers.clean_env() pytest.helpers.clean_env()
# Create an existing config # Create an existing config
pytest.helpers.existing_config() pytest.helpers.existing_config()
# Create a custom config # Create a custom config
pytest.helpers.custom_config() pytest.helpers.custom_config()
args = ["/S", "/custom-config=custom_conf"]
pytest.helpers.run_command([pytest.INST_BIN, "/S", "/custom-config=custom_conf"]) pytest.helpers.install_salt(args)
yield yield args
pytest.helpers.clean_env() pytest.helpers.clean_env()
def test_binaries_present(install): def test_binaries_present(install):
assert os.path.exists(rf"{pytest.INST_DIR}\ssm.exe") # This will show the contents of the directory on failure
inst_dir = pytest.INST_DIR
inst_dir_exists = os.path.exists(inst_dir)
dir_contents = os.listdir(inst_dir)
assert os.path.exists(rf"{inst_dir}\ssm.exe")
def test_config_present(install): def test_config_present(install):
@ -28,7 +30,7 @@ def test_config_present(install):
def test_config_correct(install): def test_config_correct(install):
# The config file should be the custom config, unchanged # The config file should be the custom config, unchanged
with open(rf"{pytest.REPO_DIR}\custom_conf") as f: with open(rf"{pytest.SCRIPT_DIR}\custom_conf") as f:
expected = f.readlines() expected = f.readlines()
with open(rf"{pytest.DATA_DIR}\conf\minion") as f: with open(rf"{pytest.DATA_DIR}\conf\minion") as f:

View file

@ -6,22 +6,22 @@ import pytest
@pytest.fixture(scope="module") @pytest.fixture(scope="module")
def install(): def install():
pytest.helpers.clean_env() pytest.helpers.clean_env()
# Create an existing config # Create an existing config
pytest.helpers.existing_config() pytest.helpers.existing_config()
# Create a custom config # Create a custom config
pytest.helpers.custom_config() pytest.helpers.custom_config()
args = ["/S", "/custom-config=custom_conf", "/master=cli_master"]
pytest.helpers.run_command( pytest.helpers.install_salt(args)
[pytest.INST_BIN, "/S", "/custom-config=custom_conf", "/master=cli_master"] yield args
)
yield
pytest.helpers.clean_env() pytest.helpers.clean_env()
def test_binaries_present(install): def test_binaries_present(install):
assert os.path.exists(rf"{pytest.INST_DIR}\ssm.exe") # This will show the contents of the directory on failure
inst_dir = pytest.INST_DIR
inst_dir_exists = os.path.exists(inst_dir)
dir_contents = os.listdir(inst_dir)
assert os.path.exists(rf"{inst_dir}\ssm.exe")
def test_config_present(install): def test_config_present(install):

View file

@ -6,28 +6,27 @@ import pytest
@pytest.fixture(scope="module") @pytest.fixture(scope="module")
def install(): def install():
pytest.helpers.clean_env() pytest.helpers.clean_env()
# Create an existing config # Create an existing config
pytest.helpers.existing_config() pytest.helpers.existing_config()
# Create a custom config # Create a custom config
pytest.helpers.custom_config() pytest.helpers.custom_config()
args = [
pytest.helpers.run_command( "/S",
[ "/custom-config=custom_conf",
pytest.INST_BIN, "/master=cli_master",
"/S", "/minion-name=cli_minion",
"/custom-config=custom_conf", ]
"/master=cli_master", pytest.helpers.install_salt(args)
"/minion-name=cli_minion", yield args
]
)
yield
pytest.helpers.clean_env() pytest.helpers.clean_env()
def test_binaries_present(install): def test_binaries_present(install):
assert os.path.exists(rf"{pytest.INST_DIR}\ssm.exe") # This will show the contents of the directory on failure
inst_dir = pytest.INST_DIR
inst_dir_exists = os.path.exists(inst_dir)
dir_contents = os.listdir(inst_dir)
assert os.path.exists(rf"{inst_dir}\ssm.exe")
def test_config_present(install): def test_config_present(install):

View file

@ -8,24 +8,20 @@ def install():
pytest.helpers.clean_env() pytest.helpers.clean_env()
# Create an existing config # Create an existing config
pytest.helpers.existing_config() pytest.helpers.existing_config()
# Create a custom config # Create a custom config
pytest.helpers.custom_config() pytest.helpers.custom_config()
args = ["/S", "/custom-config=custom_conf", "/minion-name=cli_minion"]
pytest.helpers.run_command( pytest.helpers.install_salt(args)
[ yield args
pytest.INST_BIN,
"/S",
"/custom-config=custom_conf",
"/minion-name=cli_minion",
]
)
yield
pytest.helpers.clean_env() pytest.helpers.clean_env()
def test_binaries_present(install): def test_binaries_present(install):
assert os.path.exists(rf"{pytest.INST_DIR}\ssm.exe") # This will show the contents of the directory on failure
inst_dir = pytest.INST_DIR
inst_dir_exists = os.path.exists(inst_dir)
dir_contents = os.listdir(inst_dir)
assert os.path.exists(rf"{inst_dir}\ssm.exe")
def test_config_present(install): def test_config_present(install):

View file

@ -6,17 +6,20 @@ import pytest
@pytest.fixture(scope="module") @pytest.fixture(scope="module")
def install(): def install():
pytest.helpers.clean_env() pytest.helpers.clean_env()
# Create an existing config # Create an existing config
pytest.helpers.existing_config() pytest.helpers.existing_config()
args = ["/S", "/default-config"]
pytest.helpers.run_command([pytest.INST_BIN, "/S", "/default-config"]) pytest.helpers.install_salt(args)
yield yield args
pytest.helpers.clean_env() pytest.helpers.clean_env()
def test_binaries_present(install): def test_binaries_present(install):
assert os.path.exists(rf"{pytest.INST_DIR}\ssm.exe") # This will show the contents of the directory on failure
inst_dir = pytest.INST_DIR
inst_dir_exists = os.path.exists(inst_dir)
dir_contents = os.listdir(inst_dir)
assert os.path.exists(rf"{inst_dir}\ssm.exe")
def test_config_present(install): def test_config_present(install):
@ -25,7 +28,7 @@ def test_config_present(install):
def test_config_correct(install): def test_config_correct(install):
# The config file should be the default config, unchanged # The config file should be the default config, unchanged
with open(rf"{pytest.REPO_DIR}\_files\minion") as f: with open(rf"{pytest.SCRIPT_DIR}\_files\minion") as f:
expected = f.readlines() expected = f.readlines()
with open(rf"{pytest.DATA_DIR}\conf\minion") as f: with open(rf"{pytest.DATA_DIR}\conf\minion") as f:

View file

@ -6,19 +6,20 @@ import pytest
@pytest.fixture(scope="module") @pytest.fixture(scope="module")
def install(): def install():
pytest.helpers.clean_env() pytest.helpers.clean_env()
# Create an existing config # Create an existing config
pytest.helpers.existing_config() pytest.helpers.existing_config()
args = ["/S", "/default-config", "/master=cli_master"]
pytest.helpers.run_command( pytest.helpers.install_salt(args)
[pytest.INST_BIN, "/S", "/default-config", "/master=cli_master"] yield args
)
yield
pytest.helpers.clean_env() pytest.helpers.clean_env()
def test_binaries_present(install): def test_binaries_present(install):
assert os.path.exists(rf"{pytest.INST_DIR}\ssm.exe") # This will show the contents of the directory on failure
inst_dir = pytest.INST_DIR
inst_dir_exists = os.path.exists(inst_dir)
dir_contents = os.listdir(inst_dir)
assert os.path.exists(rf"{inst_dir}\ssm.exe")
def test_config_present(install): def test_config_present(install):

View file

@ -6,25 +6,20 @@ import pytest
@pytest.fixture(scope="module") @pytest.fixture(scope="module")
def install(): def install():
pytest.helpers.clean_env() pytest.helpers.clean_env()
# Create an existing config # Create an existing config
pytest.helpers.existing_config() pytest.helpers.existing_config()
args = ["/S", "/default-config", "/master=cli_master", "/minion-name=cli_minion"]
pytest.helpers.run_command( pytest.helpers.install_salt(args)
[ yield args
pytest.INST_BIN,
"/S",
"/default-config",
"/master=cli_master",
"/minion-name=cli_minion",
]
)
yield
pytest.helpers.clean_env() pytest.helpers.clean_env()
def test_binaries_present(install): def test_binaries_present(install):
assert os.path.exists(rf"{pytest.INST_DIR}\ssm.exe") # This will show the contents of the directory on failure
inst_dir = pytest.INST_DIR
inst_dir_exists = os.path.exists(inst_dir)
dir_contents = os.listdir(inst_dir)
assert os.path.exists(rf"{inst_dir}\ssm.exe")
def test_config_present(install): def test_config_present(install):

View file

@ -6,19 +6,20 @@ import pytest
@pytest.fixture(scope="module") @pytest.fixture(scope="module")
def install(): def install():
pytest.helpers.clean_env() pytest.helpers.clean_env()
# Create an existing config # Create an existing config
pytest.helpers.existing_config() pytest.helpers.existing_config()
args = ["/S", "/default-config", "/minion-name=cli_minion"]
pytest.helpers.run_command( pytest.helpers.install_salt(args)
[pytest.INST_BIN, "/S", "/default-config", "/minion-name=cli_minion"] yield args
)
yield
pytest.helpers.clean_env() pytest.helpers.clean_env()
def test_binaries_present(install): def test_binaries_present(install):
assert os.path.exists(rf"{pytest.INST_DIR}\ssm.exe") # This will show the contents of the directory on failure
inst_dir = pytest.INST_DIR
inst_dir_exists = os.path.exists(inst_dir)
dir_contents = os.listdir(inst_dir)
assert os.path.exists(rf"{inst_dir}\ssm.exe")
def test_config_present(install): def test_config_present(install):

View file

@ -10,24 +10,19 @@ def inst_dir():
@pytest.fixture(scope="module") @pytest.fixture(scope="module")
def install(inst_dir): def install(inst_dir):
pytest.helpers.clean_env(inst_dir) pytest.helpers.clean_env()
# Create a custom config # Create a custom config
pytest.helpers.custom_config() pytest.helpers.custom_config()
args = ["/S", f"/install-dir={inst_dir}", "/custom-config=custom_conf"]
pytest.helpers.run_command( pytest.helpers.install_salt(args)
[ yield args
pytest.INST_BIN,
"/S",
f"/install-dir={inst_dir}",
"/custom-config=custom_conf",
]
)
yield
pytest.helpers.clean_env(inst_dir) pytest.helpers.clean_env(inst_dir)
def test_binaries_present(install, inst_dir): def test_binaries_present(install, inst_dir):
# This will show the contents of the directory on failure
inst_dir_exists = os.path.exists(inst_dir)
dir_contents = os.listdir(inst_dir)
assert os.path.exists(rf"{inst_dir}\ssm.exe") assert os.path.exists(rf"{inst_dir}\ssm.exe")
@ -37,7 +32,7 @@ def test_config_present(install):
def test_config_correct(install): def test_config_correct(install):
# The config file should be the custom config, unchanged # The config file should be the custom config, unchanged
with open(rf"{pytest.REPO_DIR}\custom_conf") as f: with open(rf"{pytest.SCRIPT_DIR}\custom_conf") as f:
expected = f.readlines() expected = f.readlines()
with open(rf"{pytest.DATA_DIR}\conf\minion") as f: with open(rf"{pytest.DATA_DIR}\conf\minion") as f:

View file

@ -10,25 +10,24 @@ def inst_dir():
@pytest.fixture(scope="module") @pytest.fixture(scope="module")
def install(inst_dir): def install(inst_dir):
pytest.helpers.clean_env(inst_dir) pytest.helpers.clean_env()
# Create a custom config # Create a custom config
pytest.helpers.custom_config() pytest.helpers.custom_config()
args = [
pytest.helpers.run_command( "/S",
[ f"/install-dir={inst_dir}",
pytest.INST_BIN, "/custom-config=custom_conf",
"/S", "/master=cli_master",
f"/install-dir={inst_dir}", ]
"/custom-config=custom_conf", pytest.helpers.install_salt(args)
"/master=cli_master", yield args
]
)
yield
pytest.helpers.clean_env(inst_dir) pytest.helpers.clean_env(inst_dir)
def test_binaries_present(install, inst_dir): def test_binaries_present(install, inst_dir):
# This will show the contents of the directory on failure
inst_dir_exists = os.path.exists(inst_dir)
dir_contents = os.listdir(inst_dir)
assert os.path.exists(rf"{inst_dir}\ssm.exe") assert os.path.exists(rf"{inst_dir}\ssm.exe")

View file

@ -10,26 +10,25 @@ def inst_dir():
@pytest.fixture(scope="module") @pytest.fixture(scope="module")
def install(inst_dir): def install(inst_dir):
pytest.helpers.clean_env(inst_dir) pytest.helpers.clean_env()
# Create a custom config # Create a custom config
pytest.helpers.custom_config() pytest.helpers.custom_config()
args = [
pytest.helpers.run_command( "/S",
[ f"/install-dir={inst_dir}",
pytest.INST_BIN, "/custom-config=custom_conf",
"/S", "/master=cli_master",
f"/install-dir={inst_dir}", "/minion-name=cli_minion",
"/custom-config=custom_conf", ]
"/master=cli_master", pytest.helpers.install_salt(args)
"/minion-name=cli_minion", yield args
]
)
yield
pytest.helpers.clean_env(inst_dir) pytest.helpers.clean_env(inst_dir)
def test_binaries_present(install, inst_dir): def test_binaries_present(install, inst_dir):
# This will show the contents of the directory on failure
inst_dir_exists = os.path.exists(inst_dir)
dir_contents = os.listdir(inst_dir)
assert os.path.exists(rf"{inst_dir}\ssm.exe") assert os.path.exists(rf"{inst_dir}\ssm.exe")

View file

@ -10,25 +10,24 @@ def inst_dir():
@pytest.fixture(scope="module") @pytest.fixture(scope="module")
def install(inst_dir): def install(inst_dir):
pytest.helpers.clean_env(inst_dir) pytest.helpers.clean_env()
# Create a custom config # Create a custom config
pytest.helpers.custom_config() pytest.helpers.custom_config()
args = [
pytest.helpers.run_command( "/S",
[ f"/install-dir={inst_dir}",
pytest.INST_BIN, "/custom-config=custom_conf",
"/S", "/minion-name=cli_minion",
f"/install-dir={inst_dir}", ]
"/custom-config=custom_conf", pytest.helpers.install_salt(args)
"/minion-name=cli_minion", yield args
]
)
yield
pytest.helpers.clean_env(inst_dir) pytest.helpers.clean_env(inst_dir)
def test_binaries_present(install, inst_dir): def test_binaries_present(install, inst_dir):
# This will show the contents of the directory on failure
inst_dir_exists = os.path.exists(inst_dir)
dir_contents = os.listdir(inst_dir)
assert os.path.exists(rf"{inst_dir}\ssm.exe") assert os.path.exists(rf"{inst_dir}\ssm.exe")

View file

@ -10,13 +10,17 @@ def inst_dir():
@pytest.fixture(scope="module") @pytest.fixture(scope="module")
def install(inst_dir): def install(inst_dir):
pytest.helpers.clean_env(inst_dir) pytest.helpers.clean_env()
pytest.helpers.run_command([pytest.INST_BIN, "/S", f"/install-dir={inst_dir}"]) args = ["/S", f"/install-dir={inst_dir}"]
yield pytest.helpers.install_salt(args)
yield args
pytest.helpers.clean_env(inst_dir) pytest.helpers.clean_env(inst_dir)
def test_binaries_present(install, inst_dir): def test_binaries_present(install, inst_dir):
# This will show the contents of the directory on failure
inst_dir_exists = os.path.exists(inst_dir)
dir_contents = os.listdir(inst_dir)
assert os.path.exists(rf"{inst_dir}\ssm.exe") assert os.path.exists(rf"{inst_dir}\ssm.exe")
@ -26,7 +30,7 @@ def test_config_present(install):
def test_config_correct(install): def test_config_correct(install):
# The config file should be the default config, unchanged # The config file should be the default config, unchanged
with open(rf"{pytest.REPO_DIR}\_files\minion") as f: with open(rf"{pytest.SCRIPT_DIR}\_files\minion") as f:
expected = f.readlines() expected = f.readlines()
with open(rf"{pytest.DATA_DIR}\conf\minion") as f: with open(rf"{pytest.DATA_DIR}\conf\minion") as f:

View file

@ -5,20 +5,22 @@ import pytest
@pytest.fixture(scope="module") @pytest.fixture(scope="module")
def inst_dir(): def inst_dir():
return r"C:\custom_location" return "C:\\custom_location"
@pytest.fixture(scope="module") @pytest.fixture(scope="module")
def install(inst_dir): def install(inst_dir):
pytest.helpers.clean_env(inst_dir) pytest.helpers.clean_env()
pytest.helpers.run_command( args = ["/S", f"/install-dir={inst_dir}", "/master=cli_master"]
[pytest.INST_BIN, "/S", f"/install-dir={inst_dir}", "/master=cli_master"] pytest.helpers.install_salt(args)
) yield args
yield
pytest.helpers.clean_env(inst_dir) pytest.helpers.clean_env(inst_dir)
def test_binaries_present(install, inst_dir): def test_binaries_present(install, inst_dir):
# This will show the contents of the directory on failure
inst_dir_exists = os.path.exists(inst_dir)
dir_contents = os.listdir(inst_dir)
assert os.path.exists(rf"{inst_dir}\ssm.exe") assert os.path.exists(rf"{inst_dir}\ssm.exe")

View file

@ -5,26 +5,27 @@ import pytest
@pytest.fixture(scope="module") @pytest.fixture(scope="module")
def inst_dir(): def inst_dir():
return r"C:\custom_location" return "C:\\custom_location"
@pytest.fixture(scope="module") @pytest.fixture(scope="module")
def install(inst_dir): def install(inst_dir):
pytest.helpers.clean_env(inst_dir) pytest.helpers.clean_env()
pytest.helpers.run_command( args = [
[ "/S",
pytest.INST_BIN, f"/install-dir={inst_dir}",
"/S", "/master=cli_master",
f"/install-dir={inst_dir}", "/minion-name=cli_minion",
"/master=cli_master", ]
"/minion-name=cli_minion", pytest.helpers.install_salt(args)
] yield args
)
yield
pytest.helpers.clean_env(inst_dir) pytest.helpers.clean_env(inst_dir)
def test_binaries_present(install, inst_dir): def test_binaries_present(install, inst_dir):
# This will show the contents of the directory on failure
inst_dir_exists = os.path.exists(inst_dir)
dir_contents = os.listdir(inst_dir)
assert os.path.exists(rf"{inst_dir}\ssm.exe") assert os.path.exists(rf"{inst_dir}\ssm.exe")

View file

@ -5,20 +5,22 @@ import pytest
@pytest.fixture(scope="module") @pytest.fixture(scope="module")
def inst_dir(): def inst_dir():
return r"C:\custom_location" return "C:\\custom_location"
@pytest.fixture(scope="module") @pytest.fixture(scope="module")
def install(inst_dir): def install(inst_dir):
pytest.helpers.clean_env(inst_dir) pytest.helpers.clean_env()
pytest.helpers.run_command( args = ["/S", f"/install-dir={inst_dir}", "/minion-name=cli_minion"]
[pytest.INST_BIN, "/S", f"/install-dir={inst_dir}", "/minion-name=cli_minion"] pytest.helpers.install_salt(args)
) yield args
yield {"inst_dir": inst_dir}
pytest.helpers.clean_env(inst_dir) pytest.helpers.clean_env(inst_dir)
def test_binaries_present(install, inst_dir): def test_binaries_present(install, inst_dir):
# This will show the contents of the directory on failure
inst_dir_exists = os.path.exists(inst_dir)
dir_contents = os.listdir(inst_dir)
assert os.path.exists(rf"{inst_dir}\ssm.exe") assert os.path.exists(rf"{inst_dir}\ssm.exe")

View file

@ -5,22 +5,24 @@ import pytest
@pytest.fixture(scope="module") @pytest.fixture(scope="module")
def inst_dir(): def inst_dir():
return r"C:\custom_location" return "C:\\custom_location"
@pytest.fixture(scope="module") @pytest.fixture(scope="module")
def install(inst_dir): def install(inst_dir):
pytest.helpers.clean_env(inst_dir) pytest.helpers.clean_env()
# Create an existing config # Create an existing config
pytest.helpers.existing_config() pytest.helpers.existing_config()
args = ["/S", f"/install-dir={inst_dir}"]
pytest.helpers.run_command([pytest.INST_BIN, "/S", f"/install-dir={inst_dir}"]) pytest.helpers.install_salt(args)
yield yield args
pytest.helpers.clean_env(inst_dir) pytest.helpers.clean_env(inst_dir)
def test_binaries_present(install, inst_dir): def test_binaries_present(install, inst_dir):
# This will show the contents of the directory on failure
inst_dir_exists = os.path.exists(inst_dir)
dir_contents = os.listdir(inst_dir)
assert os.path.exists(rf"{inst_dir}\ssm.exe") assert os.path.exists(rf"{inst_dir}\ssm.exe")

View file

@ -5,24 +5,23 @@ import pytest
@pytest.fixture(scope="module") @pytest.fixture(scope="module")
def inst_dir(): def inst_dir():
return r"C:\custom_location" return "C:\\custom_location"
@pytest.fixture(scope="module") @pytest.fixture(scope="module")
def install(inst_dir): def install(inst_dir):
pytest.helpers.clean_env() pytest.helpers.clean_env()
# Create old install # Create old install
pytest.helpers.old_install() pytest.helpers.old_install()
args = ["/S", f"/install-dir={inst_dir}", "/move-config"]
pytest.helpers.run_command( pytest.helpers.install_salt(args)
[pytest.INST_BIN, "/S", f"/install-dir={inst_dir}", "/move-config"] yield args
)
yield
pytest.helpers.clean_env() pytest.helpers.clean_env()
def test_binaries_present_old_location(install): def test_binaries_present_old_location(install):
# This will show the contents of the directory on failure
dir_contents = os.listdir(rf"{pytest.OLD_DIR}\bin")
# Apparently we don't move the binaries even if they pass install-dir # Apparently we don't move the binaries even if they pass install-dir
# TODO: Decide if this is expected behavior # TODO: Decide if this is expected behavior
assert os.path.exists(rf"{pytest.OLD_DIR}\bin\ssm.exe") assert os.path.exists(rf"{pytest.OLD_DIR}\bin\ssm.exe")

View file

@ -6,20 +6,20 @@ import pytest
@pytest.fixture(scope="module") @pytest.fixture(scope="module")
def install(): def install():
pytest.helpers.clean_env() pytest.helpers.clean_env()
# Create old config # Create old config
pytest.helpers.old_install() pytest.helpers.old_install()
args = ["/S"]
pytest.helpers.run_command([pytest.INST_BIN, "/S"]) pytest.helpers.install_salt(args)
yield yield args
pytest.helpers.clean_env() pytest.helpers.clean_env()
def test_ssm_present_old_location(install):
assert os.path.exists(rf"{pytest.OLD_DIR}\bin\ssm.exe")
def test_binaries_present_old_location(install): def test_binaries_present_old_location(install):
# This will show the contents of the directory on failure
dir_contents = os.listdir(rf"{pytest.OLD_DIR}\bin")
# Apparently we don't move the binaries even if they pass install-dir
# TODO: Decide if this is expected behavior
assert os.path.exists(rf"{pytest.OLD_DIR}\bin\ssm.exe")
assert os.path.exists(rf"{pytest.OLD_DIR}\bin\python.exe") assert os.path.exists(rf"{pytest.OLD_DIR}\bin\python.exe")

View file

@ -6,23 +6,22 @@ import pytest
@pytest.fixture(scope="module") @pytest.fixture(scope="module")
def install(): def install():
pytest.helpers.clean_env() pytest.helpers.clean_env()
# Create old config # Create old config
pytest.helpers.old_install() pytest.helpers.old_install()
# Create a custom config # Create a custom config
pytest.helpers.custom_config() pytest.helpers.custom_config()
args = ["/S", "/custom-config=custom_conf"]
pytest.helpers.run_command([pytest.INST_BIN, "/S", "/custom-config=custom_conf"]) pytest.helpers.install_salt(args)
yield yield args
pytest.helpers.clean_env() pytest.helpers.clean_env()
def test_ssm_present_old_location(install):
assert os.path.exists(rf"{pytest.OLD_DIR}\bin\ssm.exe")
def test_binaries_present_old_location(install): def test_binaries_present_old_location(install):
# This will show the contents of the directory on failure
dir_contents = os.listdir(rf"{pytest.OLD_DIR}\bin")
# Apparently we don't move the binaries even if they pass install-dir
# TODO: Decide if this is expected behavior
assert os.path.exists(rf"{pytest.OLD_DIR}\bin\ssm.exe")
assert os.path.exists(rf"{pytest.OLD_DIR}\bin\python.exe") assert os.path.exists(rf"{pytest.OLD_DIR}\bin\python.exe")
@ -32,7 +31,7 @@ def test_config_present_old_location(install):
def test_config_correct(install): def test_config_correct(install):
# The config file should be the custom config, unchanged # The config file should be the custom config, unchanged
with open(rf"{pytest.REPO_DIR}\custom_conf") as f: with open(rf"{pytest.SCRIPT_DIR}\custom_conf") as f:
expected = f.readlines() expected = f.readlines()
with open(rf"{pytest.OLD_DIR}\conf\minion") as f: with open(rf"{pytest.OLD_DIR}\conf\minion") as f:

View file

@ -6,25 +6,22 @@ import pytest
@pytest.fixture(scope="module") @pytest.fixture(scope="module")
def install(): def install():
pytest.helpers.clean_env() pytest.helpers.clean_env()
# Create old config # Create old config
pytest.helpers.old_install() pytest.helpers.old_install()
# Create a custom config # Create a custom config
pytest.helpers.custom_config() pytest.helpers.custom_config()
args = ["/S", "/custom-config=custom_conf", "/master=cli_master"]
pytest.helpers.run_command( pytest.helpers.install_salt(args)
[pytest.INST_BIN, "/S", "/custom-config=custom_conf", "/master=cli_master"] yield args
)
yield
pytest.helpers.clean_env() pytest.helpers.clean_env()
def test_ssm_present_old_location(install):
assert os.path.exists(rf"{pytest.OLD_DIR}\bin\ssm.exe")
def test_binaries_present_old_location(install): def test_binaries_present_old_location(install):
# This will show the contents of the directory on failure
dir_contents = os.listdir(rf"{pytest.OLD_DIR}\bin")
# Apparently we don't move the binaries even if they pass install-dir
# TODO: Decide if this is expected behavior
assert os.path.exists(rf"{pytest.OLD_DIR}\bin\ssm.exe")
assert os.path.exists(rf"{pytest.OLD_DIR}\bin\python.exe") assert os.path.exists(rf"{pytest.OLD_DIR}\bin\python.exe")

View file

@ -6,31 +6,27 @@ import pytest
@pytest.fixture(scope="module") @pytest.fixture(scope="module")
def install(): def install():
pytest.helpers.clean_env() pytest.helpers.clean_env()
# Create old config # Create old config
pytest.helpers.old_install() pytest.helpers.old_install()
# Create a custom config # Create a custom config
pytest.helpers.custom_config() pytest.helpers.custom_config()
args = [
pytest.helpers.run_command( "/S",
[ "/custom-config=custom_conf",
pytest.INST_BIN, "/master=cli_master",
"/S", "/minion-name=cli_minion",
"/custom-config=custom_conf", ]
"/master=cli_master", pytest.helpers.install_salt(args)
"/minion-name=cli_minion", yield args
]
)
yield
pytest.helpers.clean_env() pytest.helpers.clean_env()
def test_ssm_present_old_location(install):
assert os.path.exists(rf"{pytest.OLD_DIR}\bin\ssm.exe")
def test_binaries_present_old_location(install): def test_binaries_present_old_location(install):
# This will show the contents of the directory on failure
dir_contents = os.listdir(rf"{pytest.OLD_DIR}\bin")
# Apparently we don't move the binaries even if they pass install-dir
# TODO: Decide if this is expected behavior
assert os.path.exists(rf"{pytest.OLD_DIR}\bin\ssm.exe")
assert os.path.exists(rf"{pytest.OLD_DIR}\bin\python.exe") assert os.path.exists(rf"{pytest.OLD_DIR}\bin\python.exe")

View file

@ -6,25 +6,22 @@ import pytest
@pytest.fixture(scope="module") @pytest.fixture(scope="module")
def install(): def install():
pytest.helpers.clean_env() pytest.helpers.clean_env()
# Create old config # Create old config
pytest.helpers.old_install() pytest.helpers.old_install()
# Create a custom config # Create a custom config
pytest.helpers.custom_config() pytest.helpers.custom_config()
args = ["/S", "/custom-config=custom_conf", "/minion-name=cli_minion"]
pytest.helpers.run_command( pytest.helpers.install_salt(args)
[pytest.INST_BIN, "/S", "/custom-config=custom_conf", "/minion-name=cli_minion"] yield args
)
yield
pytest.helpers.clean_env() pytest.helpers.clean_env()
def test_ssm_present_old_location(install):
assert os.path.exists(rf"{pytest.OLD_DIR}\bin\ssm.exe")
def test_binaries_present_old_location(install): def test_binaries_present_old_location(install):
# This will show the contents of the directory on failure
dir_contents = os.listdir(rf"{pytest.OLD_DIR}\bin")
# Apparently we don't move the binaries even if they pass install-dir
# TODO: Decide if this is expected behavior
assert os.path.exists(rf"{pytest.OLD_DIR}\bin\ssm.exe")
assert os.path.exists(rf"{pytest.OLD_DIR}\bin\python.exe") assert os.path.exists(rf"{pytest.OLD_DIR}\bin\python.exe")

Some files were not shown because too many files have changed in this diff Show more