mirror of
https://github.com/saltstack/salt-bootstrap.git
synced 2025-04-17 10:10:25 +00:00
Compare commits
89 commits
v2024.11.2
...
develop
Author | SHA1 | Date | |
---|---|---|---|
![]() |
dd49d607b9 | ||
![]() |
b5c92f7a28 | ||
![]() |
420dc293c6 | ||
![]() |
4498c20596 | ||
![]() |
911349a8d3 | ||
![]() |
fba522c464 | ||
![]() |
bb988c99d6 | ||
![]() |
b626403ace | ||
![]() |
b58596dec3 | ||
![]() |
a2b422512d | ||
![]() |
82faed1938 | ||
![]() |
2058991403 | ||
![]() |
db07164315 | ||
![]() |
e85ff18bbc | ||
![]() |
73475d2505 | ||
![]() |
1040775f56 | ||
![]() |
316e65a979 | ||
![]() |
0075aa9902 | ||
![]() |
651d50aa05 | ||
![]() |
f47986ffd5 | ||
![]() |
dc01eea317 | ||
![]() |
d4cc7c1184 | ||
![]() |
a3971ee993 | ||
![]() |
b6683d5e5e | ||
![]() |
9d69e8a49d | ||
![]() |
a0285f3e6e | ||
![]() |
852a98fce4 | ||
![]() |
ac14d1d0fe | ||
![]() |
fa5ae443bc | ||
![]() |
a4c84236d8 | ||
![]() |
e5c03a53aa | ||
![]() |
54243fea9c | ||
![]() |
0bd577de50 | ||
![]() |
04c959b723 | ||
![]() |
644dfd1c57 | ||
![]() |
1b98100152 | ||
![]() |
e4b43b099b | ||
![]() |
c4fdafaef3 | ||
![]() |
bbaa32a888 | ||
![]() |
ce687f4066 | ||
![]() |
1a016b6ed7 | ||
![]() |
5689a93c79 | ||
![]() |
670c0bfdd6 | ||
![]() |
777c3ad055 | ||
![]() |
ab523a74dc | ||
![]() |
5b183f4111 | ||
![]() |
eaf75272b7 | ||
![]() |
72254edd67 | ||
![]() |
578ee0eeeb | ||
![]() |
70219648f8 | ||
![]() |
677ecee801 | ||
![]() |
ff5d46dddd | ||
![]() |
535a53ea36 | ||
![]() |
5339251d59 | ||
![]() |
fdcfec993b | ||
![]() |
7492ff27f3 | ||
![]() |
bd9d776046 | ||
![]() |
3c0f302b77 | ||
![]() |
d0bd4612a6 | ||
![]() |
9b3055b1bd | ||
![]() |
e4b3164136 | ||
![]() |
a79cd05fa0 | ||
![]() |
b96a669d39 | ||
![]() |
124e62e9fa | ||
![]() |
7a445852b4 | ||
![]() |
8e3f5e1c83 | ||
![]() |
a336478623 | ||
![]() |
40e91846d8 | ||
![]() |
13e00e0bbc | ||
![]() |
ba0a5f2759 | ||
![]() |
6629b40bfc | ||
![]() |
6b27fc3e97 | ||
![]() |
d7d03738da | ||
![]() |
f8da32f34b | ||
![]() |
6360fd19f2 | ||
![]() |
543d831312 | ||
![]() |
8fa55b714e | ||
![]() |
86d1bb9662 | ||
![]() |
344b942c28 | ||
![]() |
320b3b787e | ||
![]() |
c2071bd443 | ||
![]() |
b5d70f024c | ||
![]() |
d0d73fa9f4 | ||
![]() |
360a923190 | ||
![]() |
6c22d58dac | ||
![]() |
e894ebce3e | ||
![]() |
0e00e1d3ca | ||
![]() |
6ac1dcddaa | ||
![]() |
699ade0c04 |
12 changed files with 989 additions and 553 deletions
77
.github/workflows/ci.yml
vendored
77
.github/workflows/ci.yml
vendored
|
@ -114,22 +114,6 @@ jobs:
|
|||
|
||||
|
||||
|
||||
macos-12:
|
||||
name: macOS 12
|
||||
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
|
||||
uses: ./.github/workflows/test-macos.yml
|
||||
needs:
|
||||
- lint
|
||||
- generate-actions-workflow
|
||||
with:
|
||||
distro-slug: macos-12
|
||||
display-name: macOS 12
|
||||
container-slug: macos-12
|
||||
timeout: 20
|
||||
runs-on: macos-12
|
||||
instances: '["stable-3006", "stable-3006-8", "stable-3007", "stable-3007-1", "latest"]'
|
||||
|
||||
|
||||
macos-13:
|
||||
name: macOS 13
|
||||
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
|
||||
|
@ -180,6 +164,51 @@ jobs:
|
|||
|
||||
|
||||
|
||||
amazonlinux-2023:
|
||||
name: Amazon 2023
|
||||
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
|
||||
uses: ./.github/workflows/test-linux.yml
|
||||
needs:
|
||||
- lint
|
||||
- generate-actions-workflow
|
||||
with:
|
||||
distro-slug: amazonlinux-2023
|
||||
display-name: Amazon 2023
|
||||
container-slug: amazonlinux-2023
|
||||
timeout: 20
|
||||
instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "latest", "default"]'
|
||||
|
||||
|
||||
debian-11:
|
||||
name: Debian 11
|
||||
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
|
||||
uses: ./.github/workflows/test-linux.yml
|
||||
needs:
|
||||
- lint
|
||||
- generate-actions-workflow
|
||||
with:
|
||||
distro-slug: debian-11
|
||||
display-name: Debian 11
|
||||
container-slug: debian-11
|
||||
timeout: 20
|
||||
instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "latest", "default"]'
|
||||
|
||||
|
||||
debian-12:
|
||||
name: Debian 12
|
||||
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
|
||||
uses: ./.github/workflows/test-linux.yml
|
||||
needs:
|
||||
- lint
|
||||
- generate-actions-workflow
|
||||
with:
|
||||
distro-slug: debian-12
|
||||
display-name: Debian 12
|
||||
container-slug: debian-12
|
||||
timeout: 20
|
||||
instances: '["stable-3007", "git-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]'
|
||||
|
||||
|
||||
photon-5:
|
||||
name: Photon OS 5
|
||||
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
|
||||
|
@ -190,9 +219,9 @@ jobs:
|
|||
with:
|
||||
distro-slug: photon-5
|
||||
display-name: Photon OS 5
|
||||
container-slug: systemd-photon-5
|
||||
container-slug: photon-5
|
||||
timeout: 20
|
||||
instances: '["stable-3006", "onedir-3006", "stable-3006-8", "latest", "default"]'
|
||||
instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "latest", "default"]'
|
||||
|
||||
|
||||
rockylinux-8:
|
||||
|
@ -205,7 +234,7 @@ jobs:
|
|||
with:
|
||||
distro-slug: rockylinux-8
|
||||
display-name: Rocky Linux 8
|
||||
container-slug: systemd-rockylinux-8
|
||||
container-slug: rockylinux-8
|
||||
timeout: 20
|
||||
instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "latest", "default"]'
|
||||
|
||||
|
@ -220,7 +249,7 @@ jobs:
|
|||
with:
|
||||
distro-slug: rockylinux-9
|
||||
display-name: Rocky Linux 9
|
||||
container-slug: systemd-rockylinux-9
|
||||
container-slug: rockylinux-9
|
||||
timeout: 20
|
||||
instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "latest", "default"]'
|
||||
|
||||
|
@ -235,9 +264,9 @@ jobs:
|
|||
with:
|
||||
distro-slug: ubuntu-2204
|
||||
display-name: Ubuntu 22.04
|
||||
container-slug: systemd-ubuntu-22.04
|
||||
container-slug: ubuntu-22.04
|
||||
timeout: 20
|
||||
instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]'
|
||||
instances: '["stable-3006", "git-3006", "onedir-3006", "stable-3006-8", "stable-3007", "git-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]'
|
||||
|
||||
|
||||
set-pipeline-exit-status:
|
||||
|
@ -248,10 +277,12 @@ jobs:
|
|||
needs:
|
||||
- lint
|
||||
- generate-actions-workflow
|
||||
- macos-12
|
||||
- macos-13
|
||||
- macos-14
|
||||
- windows-2022
|
||||
- amazonlinux-2023
|
||||
- debian-11
|
||||
- debian-12
|
||||
- photon-5
|
||||
- rockylinux-8
|
||||
- rockylinux-9
|
||||
|
|
97
.github/workflows/templates/generate.py
vendored
97
.github/workflows/templates/generate.py
vendored
|
@ -6,18 +6,16 @@ import pathlib
|
|||
|
||||
os.chdir(os.path.abspath(os.path.dirname(__file__)))
|
||||
|
||||
# only test against current containers with systemd
|
||||
# will add these when they become available with systemd
|
||||
# "amazonlinux-2",
|
||||
# "amazonlinux-2023",
|
||||
# "debian-11",
|
||||
# "debian-12",
|
||||
# "debian-13",
|
||||
# "fedora-40",
|
||||
# "photon-4",
|
||||
# "ubuntu-2004",
|
||||
# "ubuntu-2404",
|
||||
LINUX_DISTROS = [
|
||||
"amazonlinux-2023",
|
||||
"debian-11",
|
||||
"debian-12",
|
||||
"photon-5",
|
||||
"rockylinux-8",
|
||||
"rockylinux-9",
|
||||
|
@ -29,58 +27,50 @@ WINDOWS = [
|
|||
]
|
||||
|
||||
OSX = [
|
||||
"macos-12",
|
||||
"macos-13",
|
||||
"macos-14",
|
||||
]
|
||||
|
||||
# only test against current containers with systemd
|
||||
# will add these when they become available with systemd
|
||||
# "amazonlinux-2",
|
||||
# "amazonlinux-2023",
|
||||
# "centos-stream9",
|
||||
# "debian-11",
|
||||
# "debian-12",
|
||||
# "debian-13",
|
||||
# "fedora-40",
|
||||
# "photon-4",
|
||||
# "ubuntu-2004",
|
||||
# "ubuntu-2404",
|
||||
STABLE_DISTROS = [
|
||||
"amazonlinux-2023",
|
||||
"debian-11",
|
||||
"debian-12",
|
||||
"photon-5",
|
||||
"rockylinux-8",
|
||||
"rockylinux-9",
|
||||
"ubuntu-2204",
|
||||
]
|
||||
|
||||
# only test against current containers with systemd
|
||||
# will add these when they become available with systemd
|
||||
# "amazonlinux-2",
|
||||
# "amazonlinux-2023",
|
||||
# "debian-11",
|
||||
# "debian-12",
|
||||
# "debian-13",
|
||||
# "fedora-40",
|
||||
# "photon-4",
|
||||
# "ubuntu-2004",
|
||||
# "ubuntu-2404",
|
||||
ONEDIR_DISTROS = [
|
||||
"amazonlinux-2023",
|
||||
"debian-11",
|
||||
"debian-12",
|
||||
"photon-5",
|
||||
"rockylinux-8",
|
||||
"rockylinux-9",
|
||||
"ubuntu-2204",
|
||||
]
|
||||
|
||||
# only test against current containers with systemd
|
||||
# will add these when they become available with systemd
|
||||
# "amazonlinux-2",
|
||||
# "amazonlinux-2023",
|
||||
# "debian-12",
|
||||
# "photon-4",
|
||||
# "photon-5",
|
||||
# "rockylinux-9",
|
||||
# "rockylinux-8",
|
||||
# "ubuntu-2404",
|
||||
ONEDIR_RC_DISTROS = [
|
||||
"debian-12",
|
||||
"photon-5",
|
||||
"rockylinux-9",
|
||||
"ubuntu-2204",
|
||||
|
@ -92,26 +82,13 @@ BLACKLIST_3006 = [
|
|||
"ubuntu-2404",
|
||||
]
|
||||
|
||||
# "photon-5",
|
||||
BLACKLIST_3007 = [
|
||||
"photon-4",
|
||||
"photon-5",
|
||||
]
|
||||
|
||||
# "ubuntu-2204",
|
||||
BLACKLIST_GIT_3006 = [
|
||||
"amazonlinux-2",
|
||||
"amazonlinux-2023",
|
||||
"debian-11",
|
||||
"debian-12",
|
||||
"fedora-40",
|
||||
"photon-4",
|
||||
"photon-5",
|
||||
"rockylinux-9",
|
||||
"ubuntu-2004",
|
||||
"ubuntu-2204",
|
||||
"ubuntu-2404",
|
||||
]
|
||||
|
||||
BLACKLIST_GIT_3007 = [
|
||||
"amazonlinux-2",
|
||||
"amazonlinux-2023",
|
||||
"debian-11",
|
||||
|
@ -122,13 +99,31 @@ BLACKLIST_GIT_3007 = [
|
|||
"photon-5",
|
||||
"rockylinux-9",
|
||||
"ubuntu-2004",
|
||||
"ubuntu-2204",
|
||||
"ubuntu-2404",
|
||||
]
|
||||
|
||||
# "debian-12",
|
||||
# "ubuntu-2204",
|
||||
BLACKLIST_GIT_3007 = [
|
||||
"amazonlinux-2",
|
||||
"amazonlinux-2023",
|
||||
"debian-11",
|
||||
"debian-13",
|
||||
"fedora-40",
|
||||
"photon-4",
|
||||
"photon-5",
|
||||
"rockylinux-9",
|
||||
"ubuntu-2004",
|
||||
"ubuntu-2404",
|
||||
]
|
||||
|
||||
# "debian-12",
|
||||
BLACKLIST_GIT_MASTER = [
|
||||
"amazonlinux-2",
|
||||
"amazonlinux-2023",
|
||||
"debian-11",
|
||||
"debian-13",
|
||||
"fedora-40",
|
||||
"photon-4",
|
||||
"photon-5",
|
||||
"rockylinux-9",
|
||||
|
@ -207,27 +202,25 @@ DISTRO_DISPLAY_NAMES = {
|
|||
"ubuntu-2004": "Ubuntu 20.04",
|
||||
"ubuntu-2204": "Ubuntu 22.04",
|
||||
"ubuntu-2404": "Ubuntu 24.04",
|
||||
"macos-12": "macOS 12",
|
||||
"macos-13": "macOS 13",
|
||||
"macos-14": "macOS 14",
|
||||
"windows-2022": "Windows 2022",
|
||||
}
|
||||
|
||||
CONTAINER_SLUG_NAMES = {
|
||||
"amazonlinux-2": "systemd-amazonlinux-2",
|
||||
"amazonlinux-2023": "systemd-amazonlinux-2023",
|
||||
"debian-11": "systemd-debian-11",
|
||||
"debian-12": "systemd-debian-12",
|
||||
"debian-13": "systemd-debian-13",
|
||||
"fedora-40": "systemd-fedora-40",
|
||||
"photon-4": "systemd-photon-4",
|
||||
"photon-5": "systemd-photon-5",
|
||||
"rockylinux-8": "systemd-rockylinux-8",
|
||||
"rockylinux-9": "systemd-rockylinux-9",
|
||||
"ubuntu-2004": "systemd-ubuntu-20.04",
|
||||
"ubuntu-2204": "systemd-ubuntu-22.04",
|
||||
"ubuntu-2404": "systemd-ubuntu-24.04",
|
||||
"macos-12": "macos-12",
|
||||
"amazonlinux-2": "amazonlinux-2",
|
||||
"amazonlinux-2023": "amazonlinux-2023",
|
||||
"debian-11": "debian-11",
|
||||
"debian-12": "debian-12",
|
||||
"debian-13": "debian-13",
|
||||
"fedora-40": "fedora-40",
|
||||
"photon-4": "photon-4",
|
||||
"photon-5": "photon-5",
|
||||
"rockylinux-8": "rockylinux-8",
|
||||
"rockylinux-9": "rockylinux-9",
|
||||
"ubuntu-2004": "ubuntu-20.04",
|
||||
"ubuntu-2204": "ubuntu-22.04",
|
||||
"ubuntu-2404": "ubuntu-24.04",
|
||||
"macos-13": "macos-13",
|
||||
"macos-14": "macOS 14",
|
||||
"windows-2022": "windows-2022",
|
||||
|
|
40
.github/workflows/test-linux.yml
vendored
40
.github/workflows/test-linux.yml
vendored
|
@ -32,10 +32,6 @@ jobs:
|
|||
Test:
|
||||
name: ${{ matrix.instance }}
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: ghcr.io/saltstack/salt-ci-containers/testing:${{ inputs.container-slug }}
|
||||
options: --privileged
|
||||
|
||||
timeout-minutes: ${{ inputs.timeout }}
|
||||
strategy:
|
||||
max-parallel: 2
|
||||
|
@ -46,16 +42,6 @@ jobs:
|
|||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install Python Dependencies with pip breakage
|
||||
if: ${{ ( inputs.distro-slug == 'debian-11' ) || ( inputs.distro-slug == 'debian-12' ) || ( inputs.distro-slug == 'debian-13' ) || ( inputs.distro-slug == 'ubuntu-2404' ) }}
|
||||
run: |
|
||||
python3 -m pip install --break-system-packages -r tests/requirements.txt
|
||||
|
||||
- name: Install Python Dependencies without pip breakage
|
||||
if: ${{ ( inputs.distro-slug != 'debian-11' ) && ( inputs.distro-slug != 'debian-12' ) && ( inputs.distro-slug != 'debian-13' ) && ( inputs.distro-slug != 'ubuntu-2404' ) }}
|
||||
run: |
|
||||
python3 -m pip install -r tests/requirements.txt
|
||||
|
||||
- name: Get Version
|
||||
run: |
|
||||
# We need to get the version here and make it an environment variable
|
||||
|
@ -65,17 +51,39 @@ jobs:
|
|||
vt_parm_ver=$(echo "${{ matrix.instance }}" | sed 's/-/ /' | sed 's/-/./' | awk -F ' ' '{print $2}')
|
||||
echo "SaltVersion=$vt_parm_ver" >> $GITHUB_ENV
|
||||
|
||||
- name: "Pull container ${{ inputs.container-slug }}"
|
||||
run: |
|
||||
docker pull ghcr.io/saltstack/salt-ci-containers/testing:${{ inputs.container-slug }}
|
||||
|
||||
- name: "Create container ${{ inputs.container-slug }}"
|
||||
run: |
|
||||
/usr/bin/docker create --name ${{ github.run_id }}_salt-test --workdir /_w/ --privileged -e "HOME=/github/home" -e GITHUB_ACTIONS=true -e CI=true -e $GITHUB_ENV -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work":"/__w" -v "/home/runner/work/_temp":"/__w/_temp" -v "/home/runner/work/_actions":"/__w/_actions" -v "/opt/hostedtoolcache":"/__t" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/salt-bootstrap/salt-bootstrap":"/_w/btstrap" --entrypoint "/usr/lib/systemd/systemd" ghcr.io/saltstack/salt-ci-containers/testing:${{ inputs.container-slug }} --systemd --unit rescue.target
|
||||
|
||||
- name: "Start container ${{ inputs.container-slug }}"
|
||||
run: |
|
||||
/usr/bin/docker start ${{ github.run_id }}_salt-test
|
||||
|
||||
- name: "Install Python Dependencies with pip breakage in container ${{ inputs.container-slug }}"
|
||||
if: ${{ ( inputs.distro-slug == 'debian-12' ) || ( inputs.distro-slug == 'debian-13' ) || ( inputs.distro-slug == 'ubuntu-2404' ) }}
|
||||
run: |
|
||||
docker exec ${{ github.run_id}}_salt-test python3 -m pip install --break-system-packages -r /_w/btstrap/tests/requirements.txt
|
||||
|
||||
- name: "Install Python Dependencies without pip breakage in container ${{ inputs.container-slug }}"
|
||||
if: ${{ ( inputs.distro-slug != 'debian-12' ) && ( inputs.distro-slug != 'debian-13' ) && ( inputs.distro-slug != 'ubuntu-2404' ) }}
|
||||
run: |
|
||||
docker exec ${{ github.run_id}}_salt-test python3 -m pip install -r /_w/btstrap/tests/requirements.txt
|
||||
|
||||
- name: Bootstrap Salt
|
||||
run: |
|
||||
# sed 1st - becomes space, 2nd - becomes dot
|
||||
bt_arg1=$(echo "${{ matrix.instance }}" | sed 's/-/ /' | sed 's/-/./' | awk -F ' ' '{print $1}')
|
||||
bt_arg2=$(echo "${{ matrix.instance }}" | sed 's/-/ /' | sed 's/-/./' | awk -F ' ' '{print $2}')
|
||||
echo "bt parms ,$bt_parms, bt_arg1 ,$bt_arg1, bt_arg2 ,$bt_arg2,"
|
||||
sh -x ./bootstrap-salt.sh "$bt_arg1" "$bt_arg2"
|
||||
docker exec ${{ github.run_id}}_salt-test sh -x /_w/btstrap/bootstrap-salt.sh "$bt_arg1" "$bt_arg2"
|
||||
|
||||
- name: Test Bootstrap
|
||||
run: |
|
||||
pytest --cache-clear -v -s -ra --log-cli-level=debug tests/integration/
|
||||
docker exec ${{ github.run_id}}_salt-test pytest --cache-clear -v -s -ra --log-cli-level=debug /_w/btstrap/tests/integration/
|
||||
|
||||
- name: Set Exit Status
|
||||
if: always()
|
||||
|
|
4
.github/workflows/test-macos.yml
vendored
4
.github/workflows/test-macos.yml
vendored
|
@ -48,12 +48,12 @@ jobs:
|
|||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install Python Dependencies with pip breakage
|
||||
if: ${{ ( inputs.distro-slug != 'macos-12' ) && ( inputs.distro-slug != 'macos-13' ) }}
|
||||
if: ${{ inputs.distro-slug != 'macos-13' }}
|
||||
run: |
|
||||
python3 -m pip install --break-system-packages -r tests/requirements.txt
|
||||
|
||||
- name: Install Python Dependencies without pip breakage
|
||||
if: ${{ ( inputs.distro-slug == 'macos-12' ) || ( inputs.distro-slug == 'macos-13' ) }}
|
||||
if: ${{ inputs.distro-slug == 'macos-13' }}
|
||||
run: |
|
||||
python3 -m pip install -r tests/requirements.txt
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ repos:
|
|||
- actionlint
|
||||
|
||||
- repo: https://github.com/jazzband/pip-tools
|
||||
rev: 7.3.0
|
||||
rev: 7.4.1
|
||||
hooks:
|
||||
- id: pip-compile
|
||||
files: ^requirements/release\.(in|txt)$
|
||||
|
@ -41,8 +41,10 @@ repos:
|
|||
rev: v3.15.0
|
||||
hooks:
|
||||
- id: pyupgrade
|
||||
name: Rewrite Code to be Py3.9+
|
||||
args: [--py39-plus]
|
||||
name: Rewrite Code to be Py3.6+
|
||||
args: [--py36-plus]
|
||||
## DGM name: Rewrite Code to be Py3.9+
|
||||
## DGM args: [--py39-plus]
|
||||
|
||||
- repo: https://github.com/asottile/reorder_python_imports
|
||||
rev: v3.12.0
|
||||
|
|
73
CHANGELOG.md
73
CHANGELOG.md
|
@ -1,3 +1,76 @@
|
|||
# v2025.02.24
|
||||
|
||||
## What's Changed
|
||||
|
||||
- Update requirements to address security issues by @twangboy in https://github.com/saltstack/salt-bootstrap/pull/2073
|
||||
- Use treeless clone to 'shallow' clone again. by @mrichar1 in https://github.com/saltstack/salt-bootstrap/pull/2022
|
||||
- Fix powershell instructions by @twangboy in https://github.com/saltstack/salt-bootstrap/pull/2074
|
||||
- Remove support for macos-12, as deprecated by github by @dmurphy18 in https://github.com/saltstack/salt-bootstrap/pull/2076
|
||||
|
||||
**Full Changelog**: https://github.com/saltstack/salt-bootstrap/compare/v2024.12.12...v2025.02.24
|
||||
|
||||
# v2024.12.12
|
||||
|
||||
## What's Changed
|
||||
|
||||
- Restrict use of dnf to Fedora only, otherwise use yum when dealing with RedHat family by @dmurphy18 in https://github.com/saltstack/salt-bootstrap/pull/2070
|
||||
- Updating container usage to that used in new Salt pipelines for CI/CD, fix Amazon Linux by @dmurphy18 in https://github.com/saltstack/salt-bootstrap/pull/2071
|
||||
|
||||
**Full Changelog**: https://github.com/saltstack/salt-bootstrap/compare/v2024.12.09...v2024.12.12
|
||||
|
||||
# v2024.12.09
|
||||
|
||||
## What's Changed
|
||||
|
||||
- Fix quickstart for Windows with new repo by @twangboy in https://github.com/saltstack/salt-bootstrap/pull/2065
|
||||
- Utilize salt-project packages with SUSE by @dmurphy18 in https://github.com/saltstack/salt-bootstrap/pull/2066
|
||||
|
||||
**Full Changelog**: https://github.com/saltstack/salt-bootstrap/compare/v2024.11.29...v2024.12.09
|
||||
|
||||
# v2024.11.29
|
||||
|
||||
## What's Changed
|
||||
|
||||
- Updated date to overcome issue with existing tag for 2024.11.27 by @dmurphy18 in https://github.com/saltstack/salt-bootstrap/pull/2058
|
||||
- Fix date tag by @dmurphy18 in https://github.com/saltstack/salt-bootstrap/pull/2059
|
||||
- Revert forcing git tag, other issues with check sums calculated, easiest solution is wait a day to release by @dmurphy18 in https://github.com/saltstack/salt-bootstrap/pull/2060
|
||||
- Updated date by @dmurphy18 in https://github.com/saltstack/salt-bootstrap/pull/2061
|
||||
|
||||
**Full Changelog**: https://github.com/saltstack/salt-bootstrap/compare/v2024.11.27...v2024.11.29
|
||||
|
||||
# v2024.11.27
|
||||
|
||||
**Full Changelog**: https://github.com/saltstack/salt-bootstrap/compare/v2024.11.27...v2024.11.27
|
||||
|
||||
# v2024.11.27
|
||||
|
||||
**Full Changelog**: https://github.com/saltstack/salt-bootstrap/compare/v2024.11.27...v2024.11.27
|
||||
|
||||
# v2024.11.27
|
||||
|
||||
## What's Changed
|
||||
|
||||
- Testing git install methods by @dmurphy18 in https://github.com/saltstack/salt-bootstrap/pull/2057
|
||||
|
||||
**Full Changelog**: https://github.com/saltstack/salt-bootstrap/compare/v2024.11.26...v2024.11.27
|
||||
|
||||
# v2024.11.27
|
||||
|
||||
## What's Changed
|
||||
|
||||
- Testing git install methods by @dmurphy18 in https://github.com/saltstack/salt-bootstrap/pull/2057
|
||||
|
||||
**Full Changelog**: https://github.com/saltstack/salt-bootstrap/compare/v2024.11.26...v2024.11.27
|
||||
|
||||
# v2024.11.26
|
||||
|
||||
## What's Changed
|
||||
|
||||
- Updated URLs in README, and fix deps download issue on RedHat family by @dmurphy18 in https://github.com/saltstack/salt-bootstrap/pull/2052
|
||||
- Update README script help output and scriptversions by @ScriptAutomate in https://github.com/saltstack/salt-bootstrap/pull/2056
|
||||
|
||||
**Full Changelog**: https://github.com/saltstack/salt-bootstrap/compare/v2024.11.21...v2024.11.26
|
||||
|
||||
# v2024.11.21
|
||||
|
||||
## What's Changed
|
||||
|
|
234
README.rst
234
README.rst
|
@ -37,6 +37,13 @@ sum** of the downloaded ``bootstrap-salt.sh`` file.
|
|||
|
||||
The SHA256 sum of the ``bootstrap-salt.sh`` file, per release, is:
|
||||
|
||||
- 2025.02.24: ``a0e3a58fc6358a7c6f708ee4910229e72fbdab7161819514b0696146a2edb62d``
|
||||
- 2024.12.12: ``7cc91adfa5a15ff57d203dc2b79608c773efc639d4e9bf03861198903e11becd``
|
||||
- 2024.12.09: ``44f9405a6d9622ad8fa7c93e83a52e01ca328f27e4e9dea4a52268c6a22dbe6d``
|
||||
- 2024.11.29: ``0ac87384dee051aceded69704485a5de0e4a308551a462b10c262111b57acff0``
|
||||
- 2024.11.27: ``e972bd1ef01d09cd1d9294374ef974c9e3dd9a2aee37cf3859144585fd8bf1d0``
|
||||
- 2024.11.26: ``832c7a20b96e1df171d715323df9afff8a11aef42d15598c007f240bc89d723c``
|
||||
- 2024.11.21: ``ddf624c3a94d721da3f7629402a6c7ecc9dd96d13c1ead2a626314e97cee982a``
|
||||
- 2024.11.07: ``70a9783649e129985563d1a86cf28b8984499643e62ae1dc47dc008bd204fcbb``
|
||||
- 2024.09.24: ``88e4e4cad4b115a7b721dd9c21d5ee5df390b5b73b63de48f99399146f43f371``
|
||||
- 2024.07.23: ``7212b6b497b5c3d2bf15bfe5301625ec7bc1bf3e2949cd47d8e2073614935bf8``
|
||||
|
@ -58,8 +65,9 @@ If you're looking for a *one-liner* to install Salt, please scroll to the bottom
|
|||
instructions for `Installing via an Insecure One-Liner`_.
|
||||
|
||||
There are also .sha256 files for verifying against in the repo for the stable branch. You can also
|
||||
get the correct sha256 sum for the stable release from https://bootstrap.saltproject.io/sha256 and
|
||||
https://winbootstrap.saltproject.io/sha256
|
||||
get the correct sha256 sum for the stable release from
|
||||
https://github.com/saltstack/salt-bootstrap/releases/latest/download/bootstrap-salt.sh.sha256 and
|
||||
https://github.com/saltstack/salt-bootstrap/releases/latest/download/bootstrap-salt.ps1.sha256
|
||||
|
||||
Contributing
|
||||
------------
|
||||
|
@ -82,112 +90,123 @@ To view the latest options and descriptions for ``salt-bootstrap``, use ``-h`` a
|
|||
Usage : bootstrap-salt.sh [options] <install-type> [install-type-args]
|
||||
|
||||
Installation types:
|
||||
- stable Install latest stable release. This is the default
|
||||
install type
|
||||
- stable [branch] Install latest version on a branch. Only supported
|
||||
for packages available at repo.saltproject.io
|
||||
- stable [version] Install a specific version. Only supported for
|
||||
packages available at repo.saltproject.io
|
||||
To pin a 3xxx minor version, specify it as 3xxx.0
|
||||
- testing RHEL-family specific: configure EPEL testing repo
|
||||
- git Install from the head of the master branch
|
||||
- git [ref] Install from any git ref (such as a branch, tag, or
|
||||
commit)
|
||||
- stable Install latest stable release. This is the default
|
||||
install type
|
||||
- stable [branch] Install latest version on a branch. Only supported
|
||||
for packages available at packages.broadcom.com
|
||||
- stable [version] Install a specific version. Only supported for
|
||||
packages available at packages.broadcom.com
|
||||
To pin a 3xxx minor version, specify it as 3xxx.0
|
||||
- testing RHEL-family specific: configure EPEL testing repo
|
||||
- git Install from the head of the master branch
|
||||
- git [ref] Install from any git ref (such as a branch, tag, or
|
||||
commit)
|
||||
- onedir Install latest onedir release.
|
||||
- onedir [version] Install a specific version. Only supported for
|
||||
onedir packages available at packages.broadcom.com
|
||||
|
||||
- onedir_rc Install latest onedir RC release.
|
||||
- onedir_rc [version] Install a specific version. Only supported for
|
||||
onedir RC packages available at packages.broadcom.com
|
||||
|
||||
Examples:
|
||||
- bootstrap-salt.sh
|
||||
- bootstrap-salt.sh stable
|
||||
- bootstrap-salt.sh stable 3006.7
|
||||
- bootstrap-salt.sh stable v3006.8
|
||||
- bootstrap-salt.sh stable 3006
|
||||
- bootstrap-salt.sh stable 3006.1
|
||||
- bootstrap-salt.sh testing
|
||||
- bootstrap-salt.sh git
|
||||
- bootstrap-salt.sh git 3006.7
|
||||
- bootstrap-salt.sh git v3006.8
|
||||
- bootstrap-salt.sh git 3007.1
|
||||
- bootstrap-salt.sh git v3007.1
|
||||
- bootstrap-salt.sh git 06f249901a2e2f1ed310d58ea3921a129f214358
|
||||
- bootstrap-salt.sh onedir
|
||||
- bootstrap-salt.sh onedir 3006
|
||||
- bootstrap-salt.sh onedir_rc
|
||||
- bootstrap-salt.sh onedir_rc 3008
|
||||
|
||||
|
||||
Options:
|
||||
-h Display this message
|
||||
-v Display script version
|
||||
-n No colours
|
||||
-D Show debug output
|
||||
-a Pip install all Python pkg dependencies for Salt. Requires -V to install
|
||||
all pip pkgs into the virtualenv.
|
||||
(Only available for Ubuntu based distributions)
|
||||
-A Pass the salt-master DNS name or IP. This will be stored under
|
||||
\${BS_SALT_ETC_DIR}/minion.d/99-master-address.conf
|
||||
-b Assume that dependencies are already installed and software sources are
|
||||
set up. If git is selected, git tree is still checked out as dependency
|
||||
step.
|
||||
-c Temporary configuration directory
|
||||
-g Salt Git repository URL. Default: https://github.com/saltstack/salt.git
|
||||
-w Install packages from downstream package repository rather than
|
||||
upstream, saltstack package repository. This is currently only
|
||||
implemented for SUSE.
|
||||
-k Temporary directory holding the minion keys which will pre-seed
|
||||
the master.
|
||||
-s Sleep time used when waiting for daemons to start, restart and when
|
||||
checking for the services running. Default: 3
|
||||
-L Also install salt-cloud and required python-libcloud package
|
||||
-M Also install salt-master
|
||||
-S Also install salt-syndic
|
||||
-W Also install salt-api
|
||||
-N Do not install salt-minion
|
||||
-X Do not start daemons after installation
|
||||
-C Only run the configuration function. Implies -F (forced overwrite).
|
||||
To overwrite Master, Syndic or Api configs, -M,-S or -W, respectively, must
|
||||
also be specified. Salt installation will be ommitted, but some of the
|
||||
dependencies could be installed to write configuration with -j or -J.
|
||||
-d Disables checking if Salt services are enabled to start on system boot.
|
||||
You can also do this by touching /tmp/disable_salt_checks on the target
|
||||
host. Default: ${BS_FALSE}
|
||||
-P Allow pip based installations. On some distributions the required salt
|
||||
packages or its dependencies are not available as a package for that
|
||||
distribution. Using this flag allows the script to use pip as a last
|
||||
resort method. NOTE: This only works for functions which actually
|
||||
implement pip based installations.
|
||||
-U If set, fully upgrade the system prior to bootstrapping Salt
|
||||
host. Default: \${BS_FALSE}
|
||||
-D Show debug output
|
||||
-f Force shallow cloning for git installations.
|
||||
This may result in an "n/a" in the version number.
|
||||
-F Allow copied files to overwrite existing (config, init.d, etc)
|
||||
-g Salt Git repository URL. Default: https://github.com/saltstack/salt.git
|
||||
-h Display this message
|
||||
-H Use the specified HTTP proxy for all download URLs (including https://).
|
||||
For example: http://myproxy.example.com:3128
|
||||
-i Pass the salt-minion id. This will be stored under
|
||||
\${BS_SALT_ETC_DIR}/minion_id
|
||||
-I If set, allow insecure connections while downloading any files. For
|
||||
example, pass '--no-check-certificate' to 'wget' or '--insecure' to
|
||||
'curl'. On Debian and Ubuntu, using this option with -U allows obtaining
|
||||
GnuPG archive keys insecurely if distro has changed release signatures.
|
||||
-F Allow copied files to overwrite existing (config, init.d, etc)
|
||||
-K If set, keep the temporary files in the temporary directories specified
|
||||
with -c and -k
|
||||
-C Only run the configuration function. Implies -F (forced overwrite).
|
||||
To overwrite Master or Syndic configs, -M or -S, respectively, must
|
||||
also be specified. Salt installation will be ommitted, but some of the
|
||||
dependencies could be installed to write configuration with -j or -J.
|
||||
-A Pass the salt-master DNS name or IP. This will be stored under
|
||||
${BS_SALT_ETC_DIR}/minion.d/99-master-address.conf
|
||||
-i Pass the salt-minion id. This will be stored under
|
||||
${BS_SALT_ETC_DIR}/minion_id
|
||||
-p Extra-package to install while installing Salt dependencies. One package
|
||||
per -p flag. You are responsible for providing the proper package name.
|
||||
-H Use the specified HTTP proxy for all download URLs (including https://).
|
||||
For example: http://myproxy.example.com:3128
|
||||
-b Assume that dependencies are already installed and software sources are
|
||||
set up. If git is selected, git tree is still checked out as dependency
|
||||
step.
|
||||
-f Force shallow cloning for git installations.
|
||||
This may result in an "n/a" in the version number.
|
||||
-l Disable ssl checks. When passed, switches "https" calls to "http" where
|
||||
possible.
|
||||
-V Install Salt into virtualenv
|
||||
(only available for Ubuntu based distributions)
|
||||
-a Pip install all Python pkg dependencies for Salt. Requires -V to install
|
||||
all pip pkgs into the virtualenv.
|
||||
(Only available for Ubuntu based distributions)
|
||||
-r Disable all repository configuration performed by this script. This
|
||||
option assumes all necessary repository configuration is already present
|
||||
on the system.
|
||||
-R Specify a custom repository URL. Assumes the custom repository URL
|
||||
points to a repository that mirrors Salt packages located at
|
||||
repo.saltproject.io. The option passed with -R replaces the
|
||||
"repo.saltproject.io". If -R is passed, -r is also set. Currently only
|
||||
works on CentOS/RHEL and Debian based distributions.
|
||||
-J Replace the Master config file with data passed in as a JSON string. If
|
||||
a Master config file is found, a reasonable effort will be made to save
|
||||
the file with a ".bak" extension. If used in conjunction with -C or -F,
|
||||
no ".bak" file will be created as either of those options will force
|
||||
a complete overwrite of the file.
|
||||
-j Replace the Minion config file with data passed in as a JSON string. If
|
||||
a Minion config file is found, a reasonable effort will be made to save
|
||||
the file with a ".bak" extension. If used in conjunction with -C or -F,
|
||||
no ".bak" file will be created as either of those options will force
|
||||
a complete overwrite of the file.
|
||||
-J Replace the Master config file with data passed in as a JSON string. If
|
||||
a Master config file is found, a reasonable effort will be made to save
|
||||
the file with a ".bak" extension. If used in conjunction with -C or -F,
|
||||
no ".bak" file will be created as either of those options will force
|
||||
a complete overwrite of the file.
|
||||
-k Temporary directory holding the minion keys which will pre-seed
|
||||
the master.
|
||||
-K If set, keep the temporary files in the temporary directories specified
|
||||
with -c and -k
|
||||
-l Disable ssl checks. When passed, switches "https" calls to "http" where
|
||||
possible.
|
||||
-L Also install salt-cloud and required python-libcloud package
|
||||
-M Also install salt-master
|
||||
-n No colours
|
||||
-N Do not install salt-minion
|
||||
-p Extra-package to install while installing Salt dependencies. One package
|
||||
per -p flag. You are responsible for providing the proper package name.
|
||||
-P Allow pip based installations. On some distributions the required salt
|
||||
packages or its dependencies are not available as a package for that
|
||||
distribution. Using this flag allows the script to use pip as a last
|
||||
resort method. NOTE: This only works for functions which actually
|
||||
implement pip based installations.
|
||||
-q Quiet salt installation from git (setup.py install -q)
|
||||
-x Changes the Python version used to install Salt (default: Python 3)
|
||||
Python 2.7 is not longer supported.
|
||||
-Q Quickstart, install the Salt master and the Salt minion.
|
||||
And automatically accept the minion key.
|
||||
-R Specify a custom repository URL. Assumes the custom repository URL
|
||||
points to a repository that mirrors Salt packages located at
|
||||
packages.broadcom.com. The option passed with -R replaces the
|
||||
"packages.broadcom.com". If -R is passed, -r is also set. Currently only
|
||||
works on CentOS/RHEL and Debian based distributions and macOS.
|
||||
-s Sleep time used when waiting for daemons to start, restart and when
|
||||
checking for the services running. Default: 3
|
||||
-S Also install salt-syndic
|
||||
-r Disable all repository configuration performed by this script. This
|
||||
option assumes all necessary repository configuration is already present
|
||||
on the system.
|
||||
-U If set, fully upgrade the system prior to bootstrapping Salt
|
||||
-v Display script version
|
||||
-V Install Salt into virtualenv
|
||||
(only available for Ubuntu based distributions)
|
||||
-W Also install salt-api
|
||||
-x Changes the Python version used to install Salt (default: Python 3).
|
||||
Python 2.7 is no longer supported.
|
||||
-X Do not start daemons after installation
|
||||
|
||||
The Salt Bootstrap script has a wide variety of options that can be passed as
|
||||
well as several ways of obtaining the bootstrap script itself. Note that the use of ``sudo``
|
||||
|
@ -207,35 +226,35 @@ If you want to install a package of a specific release version, from the Salt Pr
|
|||
|
||||
.. code:: console
|
||||
|
||||
curl -o bootstrap-salt.sh -L https://bootstrap.saltproject.io
|
||||
curl -o bootstrap-salt.sh -L https://github.com/saltstack/salt-bootstrap/releases/latest/download/bootstrap-salt.sh
|
||||
sudo sh bootstrap-salt.sh -P stable 3006.1
|
||||
|
||||
If you want to install a specific release version, based on the Git tags:
|
||||
|
||||
.. code:: console
|
||||
|
||||
curl -o bootstrap-salt.sh -L https://bootstrap.saltproject.io
|
||||
curl -o bootstrap-salt.sh -L https://github.com/saltstack/salt-bootstrap/releases/latest/download/bootstrap-salt.sh
|
||||
sudo sh bootstrap-salt.sh git v3006.1
|
||||
|
||||
Using ``curl`` to install latest development version from GitHub:
|
||||
|
||||
.. code:: console
|
||||
|
||||
curl -o bootstrap-salt.sh -L https://bootstrap.saltproject.io
|
||||
curl -o bootstrap-salt.sh -L https://github.com/saltstack/salt-bootstrap/releases/latest/download/bootstrap-salt.sh
|
||||
sudo sh bootstrap-salt.sh git master
|
||||
|
||||
To install a specific branch from a Git fork:
|
||||
|
||||
.. code:: console
|
||||
|
||||
curl -o bootstrap-salt.sh -L https://bootstrap.saltproject.io
|
||||
curl -o bootstrap-salt.sh -L https://github.com/saltstack/salt-bootstrap/releases/latest/download/bootstrap-salt.sh
|
||||
sudo sh bootstrap-salt.sh -g https://github.com/myuser/salt.git git mybranch
|
||||
|
||||
If all you want is to install a ``salt-master`` using latest Git:
|
||||
|
||||
.. code:: console
|
||||
|
||||
curl -o bootstrap-salt.sh -L https://bootstrap.saltproject.io
|
||||
curl -o bootstrap-salt.sh -L https://github.com/saltstack/salt-bootstrap/releases/latest/download/bootstrap-salt.sh
|
||||
sudo sh bootstrap-salt.sh -M -N git master
|
||||
|
||||
If your host has Internet access only via HTTP proxy, from the Salt Project repo:
|
||||
|
@ -243,7 +262,7 @@ If your host has Internet access only via HTTP proxy, from the Salt Project repo
|
|||
.. code:: console
|
||||
|
||||
PROXY='http://user:password@myproxy.example.com:3128'
|
||||
curl -o bootstrap-salt.sh -L -x "$PROXY" https://bootstrap.saltproject.io
|
||||
curl -o bootstrap-salt.sh -L -x "$PROXY" https://github.com/saltstack/salt-bootstrap/releases/latest/download/bootstrap-salt.sh
|
||||
sudo sh bootstrap-salt.sh -P -H "$PROXY" stable
|
||||
|
||||
If your host has Internet access only via HTTP proxy, installing via Git:
|
||||
|
@ -251,7 +270,7 @@ If your host has Internet access only via HTTP proxy, installing via Git:
|
|||
.. code:: console
|
||||
|
||||
PROXY='http://user:password@myproxy.example.com:3128'
|
||||
curl -o bootstrap-salt.sh -L -x "$PROXY" https://bootstrap.saltproject.io
|
||||
curl -o bootstrap-salt.sh -L -x "$PROXY" https://github.com/saltstack/salt-bootstrap/releases/latest/download/bootstrap-salt.sh
|
||||
sudo sh bootstrap-salt.sh -H "$PROXY" git
|
||||
|
||||
|
||||
|
@ -262,22 +281,22 @@ Using ``wget`` to install your distribution's stable packages:
|
|||
|
||||
.. code:: console
|
||||
|
||||
wget -O bootstrap-salt.sh https://bootstrap.saltproject.io
|
||||
wget -O bootstrap-salt.sh https://github.com/saltstack/salt-bootstrap/releases/latest/download/bootstrap-salt.sh
|
||||
sudo sh bootstrap-salt.sh
|
||||
|
||||
Installing a specific version from git using ``wget``:
|
||||
|
||||
.. code:: console
|
||||
|
||||
wget -O bootstrap-salt.sh https://bootstrap.saltproject.io
|
||||
sudo sh bootstrap-salt.sh git v3004.1
|
||||
wget -O bootstrap-salt.sh https://github.com/saltstack/salt-bootstrap/releases/latest/download/bootstrap-salt.sh
|
||||
sudo sh bootstrap-salt.sh git v3006.8
|
||||
|
||||
Installing a specific version package from the Salt Project repo using ``wget``:
|
||||
|
||||
.. code:: console
|
||||
|
||||
wget -O bootstrap-salt.sh https://bootstrap.saltproject.io
|
||||
sudo sh bootstrap-salt.sh -P stable 3006.1
|
||||
wget -O bootstrap-salt.sh https://github.com/saltstack/salt-bootstrap/releases/latest/download/bootstrap-salt.sh
|
||||
sudo sh bootstrap-salt.sh -P stable 3006.8
|
||||
|
||||
**NOTE**
|
||||
|
||||
|
@ -292,14 +311,14 @@ If you already have Python installed, ``python 3.10``, then it's as easy as:
|
|||
|
||||
.. code:: console
|
||||
|
||||
python -m urllib "https://bootstrap.saltproject.io" > bootstrap-salt.sh
|
||||
python -m urllib "https://github.com/saltstack/salt-bootstrap/releases/latest/download/bootstrap-salt.sh" > bootstrap-salt.sh
|
||||
sudo sh bootstrap-salt.sh -P stable 3006.1
|
||||
|
||||
With python version 3:
|
||||
|
||||
.. code:: console
|
||||
|
||||
python3 -c 'import urllib.request; print(urllib.request.urlopen("https://bootstrap.saltproject.io").read().decode("ascii"))' > bootstrap-salt.sh
|
||||
python3 -c 'import urllib.request; print(urllib.request.urlopen("https://github.com/saltstack/salt-bootstrap/releases/latest/download/bootstrap-salt.sh").read().decode("ascii"))' > bootstrap-salt.sh
|
||||
sudo sh bootstrap-salt.sh git v3006.1
|
||||
|
||||
Note: Python 2.x is no longer supported given it reached it's End-Of-Life Jan. 1st, 2020
|
||||
|
@ -322,25 +341,25 @@ Installing the latest stable release of Salt (default):
|
|||
|
||||
.. code:: console
|
||||
|
||||
curl -L https://bootstrap.saltproject.io | sudo sh
|
||||
curl -L https://github.com/saltstack/salt-bootstrap/releases/latest/download/bootstrap-salt.sh | sudo sh
|
||||
|
||||
Using ``wget`` to install your distribution's stable packages:
|
||||
|
||||
.. code:: console
|
||||
|
||||
wget -O - https://bootstrap.saltproject.io | sudo sh
|
||||
wget -O - https://github.com/saltstack/salt-bootstrap/releases/latest/download/bootstrap-salt.sh | sudo sh
|
||||
|
||||
Installing a target version package of Salt from the Salt Project repo:
|
||||
|
||||
.. code:: console
|
||||
|
||||
curl -L https://bootstrap.saltproject.io | sudo sh -s -- stable 3006.8
|
||||
curl -L https://github.com/saltstack/salt-bootstrap/releases/latest/download/bootstrap-salt.sh | sudo sh -s -- stable 3006.8
|
||||
|
||||
Installing the latest master branch of Salt from git:
|
||||
|
||||
.. code:: console
|
||||
|
||||
curl -L https://bootstrap.saltproject.io | sudo sh -s -- git master
|
||||
curl -L https://github.com/saltstack/salt-bootstrap/releases/latest/download/bootstrap-salt.sh | sudo sh -s -- git master
|
||||
|
||||
Note: use of git is recommended for development environments, for example: testing new features of
|
||||
Salt which have not yet been released.
|
||||
|
@ -355,9 +374,8 @@ Using ``PowerShell`` to install latest stable version:
|
|||
.. code:: powershell
|
||||
|
||||
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]'Tls12'
|
||||
Invoke-WebRequest -Uri https://winbootstrap.saltproject.io -OutFile "$env:TEMP\bootstrap-salt.ps1"
|
||||
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
|
||||
& "$env:TEMP\bootstrap-salt.ps1"
|
||||
Invoke-WebRequest -Uri https://github.com/saltstack/salt-bootstrap/releases/latest/download/bootstrap-salt.ps1 -OutFile "$env:TEMP\bootstrap-salt.ps1"
|
||||
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser -Force; & "$env:TEMP\bootstrap-salt.ps1"
|
||||
|
||||
Display information about the install script parameters:
|
||||
|
||||
|
@ -369,7 +387,7 @@ Using ``cygwin`` to install latest stable version:
|
|||
|
||||
.. code:: console
|
||||
|
||||
curl -o bootstrap-salt.ps1 -L https://winbootstrap.saltproject.io
|
||||
curl -o bootstrap-salt.ps1 -L https://github.com/saltstack/salt-bootstrap/releases/latest/download/bootstrap-salt.ps1
|
||||
"/cygdrive/c/WINDOWS/System32/WindowsPowerShell/v1.0/powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "[System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ./bootstrap-salt.ps1"
|
||||
|
||||
|
||||
|
@ -379,13 +397,13 @@ Supported Operating Systems
|
|||
The salt-bootstrap script officially supports the distributions outlined in
|
||||
`Salt's Supported Operating Systems
|
||||
<https://docs.saltproject.io/salt/install-guide/en/latest/topics/salt-supported-operating-systems.html>`_
|
||||
document, (BSD-based OSs, Solaris and AIX are no longer
|
||||
supported). The operating systems listed below should reflect this document but may become out of
|
||||
date. If an operating system is listed below, but is not listed on the official supported operating
|
||||
document, (BSD-based OSs, Solaris and AIX are no longer supported).
|
||||
The operating systems listed below should reflect this document but may become out of date.
|
||||
If an operating system is listed below, but is not listed on the official supported operating
|
||||
systems document, the level of support is "best-effort".
|
||||
|
||||
Since Salt is written in Python, the packages available from the `Salt Project's repository
|
||||
<https://repo.saltproject.io/salt/py3>`_ are
|
||||
<packages.broadcom.com>`_ are
|
||||
CPU architecture independent and could be installed on any hardware supported by Linux kernel.
|
||||
However, the Salt Project does package Salt's binary dependencies only for ``x86_64`` (``amd64``)
|
||||
and ``AArch64`` (``arm64``).
|
||||
|
|
|
@ -39,7 +39,8 @@
|
|||
Salt Bootstrap GitHub Project (script home) - https://github.com/saltstack/salt-bootstrap
|
||||
Original Vagrant Provisioner Project - https://github.com/saltstack/salty-vagrant
|
||||
Vagrant Project (utilizes this script) - https://github.com/mitchellh/vagrant
|
||||
Salt Download Location - https://repo.saltproject.io/salt/py3/windows
|
||||
Salt Download Location - https://packages.broadcom.com/artifactory/saltproject-generic/windows/
|
||||
Salt Manual Install Directions (Windows) - https://docs.saltproject.io/salt/install-guide/en/latest/topics/install-by-operating-system/windows.html
|
||||
#>
|
||||
|
||||
#===============================================================================
|
||||
|
@ -107,7 +108,7 @@ if ($help) {
|
|||
exit 0
|
||||
}
|
||||
|
||||
$__ScriptVersion = "2024.11.21"
|
||||
$__ScriptVersion = "2025.02.24"
|
||||
$ScriptName = $myInvocation.MyCommand.Name
|
||||
|
||||
# We'll check for the Version next, because it also has no requirements
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -4,27 +4,31 @@
|
|||
#
|
||||
# pip-compile requirements/release.in
|
||||
#
|
||||
attrs==23.1.0
|
||||
annotated-types==0.7.0
|
||||
# via pydantic
|
||||
attrs==24.3.0
|
||||
# via python-tools-scripts
|
||||
boto3==1.28.79
|
||||
boto3==1.35.98
|
||||
# via -r requirements/release.in
|
||||
botocore==1.31.79
|
||||
botocore==1.35.98
|
||||
# via
|
||||
# boto3
|
||||
# s3transfer
|
||||
certifi==2023.7.22
|
||||
certifi==2024.12.14
|
||||
# via requests
|
||||
cfgv==3.4.0
|
||||
# via pre-commit
|
||||
charset-normalizer==3.3.2
|
||||
charset-normalizer==3.4.1
|
||||
# via requests
|
||||
distlib==0.3.7
|
||||
distlib==0.3.9
|
||||
# via virtualenv
|
||||
filelock==3.13.1
|
||||
# via virtualenv
|
||||
identify==2.5.31
|
||||
filelock==3.16.1
|
||||
# via
|
||||
# python-tools-scripts
|
||||
# virtualenv
|
||||
identify==2.6.5
|
||||
# via pre-commit
|
||||
idna==3.4
|
||||
idna==3.10
|
||||
# via requests
|
||||
jmespath==1.0.1
|
||||
# via
|
||||
|
@ -34,36 +38,41 @@ markdown-it-py==3.0.0
|
|||
# via rich
|
||||
mdurl==0.1.2
|
||||
# via markdown-it-py
|
||||
nodeenv==1.8.0
|
||||
nodeenv==1.9.1
|
||||
# via pre-commit
|
||||
platformdirs==3.11.0
|
||||
platformdirs==4.3.6
|
||||
# via virtualenv
|
||||
pre-commit==3.5.0
|
||||
pre-commit==4.0.1
|
||||
# via -r requirements/release.in
|
||||
pygments==2.16.1
|
||||
pydantic==2.10.5
|
||||
# via python-tools-scripts
|
||||
pydantic-core==2.27.2
|
||||
# via pydantic
|
||||
pygments==2.19.1
|
||||
# via rich
|
||||
python-dateutil==2.8.2
|
||||
python-dateutil==2.9.0.post0
|
||||
# via botocore
|
||||
python-tools-scripts==0.18.6
|
||||
python-tools-scripts==0.20.5
|
||||
# via -r requirements/release.in
|
||||
pyyaml==6.0.1
|
||||
pyyaml==6.0.2
|
||||
# via pre-commit
|
||||
requests==2.31.0
|
||||
requests==2.32.3
|
||||
# via python-tools-scripts
|
||||
rich==13.6.0
|
||||
rich==13.9.4
|
||||
# via python-tools-scripts
|
||||
s3transfer==0.7.0
|
||||
s3transfer==0.10.4
|
||||
# via boto3
|
||||
six==1.16.0
|
||||
six==1.17.0
|
||||
# via python-dateutil
|
||||
typing-extensions==4.8.0
|
||||
# via python-tools-scripts
|
||||
urllib3==2.0.7
|
||||
typing-extensions==4.12.2
|
||||
# via
|
||||
# pydantic
|
||||
# pydantic-core
|
||||
# python-tools-scripts
|
||||
# rich
|
||||
urllib3==2.3.0
|
||||
# via
|
||||
# botocore
|
||||
# requests
|
||||
virtualenv==20.24.6
|
||||
virtualenv==20.28.1
|
||||
# via pre-commit
|
||||
|
||||
# The following packages are considered to be unsafe in a requirements file:
|
||||
# setuptools
|
||||
|
|
|
@ -1,39 +1,31 @@
|
|||
function Convert-PSObjectToHashtable {
|
||||
param (
|
||||
[Parameter(ValueFromPipeline)]
|
||||
$InputObject
|
||||
)
|
||||
if ($null -eq $InputObject) { return $null }
|
||||
<#
|
||||
.SYNOPSIS
|
||||
A simple Powershell script to quickly start using Salt.
|
||||
|
||||
$is_enum = $InputObject -is [System.Collections.IEnumerable]
|
||||
$not_string = $InputObject -isnot [string]
|
||||
if ($is_enum -and $not_string) {
|
||||
$collection = @(
|
||||
foreach ($object in $InputObject) {
|
||||
Convert-PSObjectToHashtable $object
|
||||
}
|
||||
)
|
||||
.DESCRIPTION
|
||||
This script will download the latest onedir version of Salt and extract it
|
||||
into the same directory where the script is run. The script sets up an
|
||||
environment that will allow you to run salt-call commands. To remove, just
|
||||
delete the `salt` directory. The environment variables will only be set for
|
||||
the current powershell session.
|
||||
|
||||
Write-Host -NoEnumerate $collection
|
||||
} elseif ($InputObject -is [PSObject]) {
|
||||
$hash = @{}
|
||||
.EXAMPLE
|
||||
./salt-quick-start.ps1
|
||||
|
||||
foreach ($property in $InputObject.PSObject.Properties) {
|
||||
$hash[$property.Name] = Convert-PSObjectToHashtable $property.Value
|
||||
}
|
||||
.LINK
|
||||
Salt Bootstrap GitHub Project (script home) - https://github.com/saltstack/salt-bootstrap
|
||||
Original Vagrant Provisioner Project - https://github.com/saltstack/salty-vagrant
|
||||
Vagrant Project (utilizes this script) - https://github.com/mitchellh/vagrant
|
||||
Salt Download Location - https://packages.broadcom.com/artifactory/saltproject-generic/windows/
|
||||
Salt Manual Install Directions (Windows) - https://docs.saltproject.io/salt/install-guide/en/latest/topics/install-by-operating-system/windows.html
|
||||
#>
|
||||
|
||||
$hash
|
||||
} else {
|
||||
$InputObject
|
||||
}
|
||||
}
|
||||
# This is so the -Verbose parameter will work
|
||||
[CmdletBinding()] param()
|
||||
|
||||
function Expand-ZipFile {
|
||||
# Extract a zip file
|
||||
#
|
||||
# Used by:
|
||||
# - Install-SaltMinion
|
||||
#
|
||||
# Args:
|
||||
# ZipFile (string): The file to extract
|
||||
# Destination (string): The location to extract to
|
||||
|
@ -81,60 +73,151 @@ function Expand-ZipFile {
|
|||
Write-Debug "Finished unzipping '$ZipFile' to '$Destination'"
|
||||
}
|
||||
|
||||
function Get-FileHash {
|
||||
# Get-FileHash is a built-in cmdlet in powershell 5+ but we need to support
|
||||
# powershell 3. This will overwrite the powershell 5 commandlet only for
|
||||
# this script. But it will provide the missing cmdlet for powershell 3
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
[Parameter(Mandatory=$true)]
|
||||
[String] $Path,
|
||||
|
||||
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]'Tls12'
|
||||
[Parameter(Mandatory=$false)]
|
||||
[ValidateSet(
|
||||
"SHA1",
|
||||
"SHA256",
|
||||
"SHA384",
|
||||
"SHA512",
|
||||
# https://serverfault.com/questions/820300/
|
||||
# why-isnt-mactripledes-algorithm-output-in-powershell-stable
|
||||
"MACTripleDES", # don't use
|
||||
"MD5",
|
||||
"RIPEMD160",
|
||||
IgnoreCase=$true)]
|
||||
[String] $Algorithm = "SHA256"
|
||||
)
|
||||
|
||||
$global:ProgressPreference = 'SilentlyContinue'
|
||||
|
||||
$RepoUrl = "https://repo.saltproject.io/salt/py3/onedir"
|
||||
|
||||
if ([IntPtr]::Size -eq 4) {
|
||||
$arch = "x86"
|
||||
} else {
|
||||
$arch = "amd64"
|
||||
}
|
||||
$enc = [System.Text.Encoding]::UTF8
|
||||
try {
|
||||
$response = Invoke-WebRequest -Uri "$RepoUrl/repo.json" -UseBasicParsing
|
||||
if ($response.Content.GetType().Name -eq "Byte[]") {
|
||||
$psobj = $enc.GetString($response.Content) | ConvertFrom-Json
|
||||
|
||||
} else {
|
||||
$psobj = $response.Content | ConvertFrom-Json
|
||||
if ( !(Test-Path $Path) ) {
|
||||
Write-Verbose "Invalid path for hashing: $Path"
|
||||
return @{}
|
||||
}
|
||||
$hash = Convert-PSObjectToHashtable $psobj
|
||||
} catch {
|
||||
Write-Host "repo.json not found at: $RepoUrl"
|
||||
$hash = @{}
|
||||
}
|
||||
$searchVersion = "latest"
|
||||
if ( $hash.Contains($searchVersion)) {
|
||||
foreach ($item in $hash.($searchVersion).Keys) {
|
||||
if ( $item.EndsWith(".zip") ) {
|
||||
if ( $item.Contains($arch) ) {
|
||||
$saltFileName = $hash.($searchVersion).($item).name
|
||||
$saltVersion = $hash.($searchVersion).($item).version
|
||||
$saltSha512 = $hash.($searchVersion).($item).SHA512
|
||||
}
|
||||
|
||||
if ( (Get-Item -Path $Path) -isnot [System.IO.FileInfo]) {
|
||||
Write-Verbose "Not a file for hashing: $Path"
|
||||
return @{}
|
||||
}
|
||||
|
||||
$Path = Resolve-Path -Path $Path
|
||||
|
||||
Switch ($Algorithm) {
|
||||
SHA1 {
|
||||
$hasher = [System.Security.Cryptography.SHA1CryptoServiceProvider]::Create()
|
||||
}
|
||||
SHA256 {
|
||||
$hasher = [System.Security.Cryptography.SHA256]::Create()
|
||||
}
|
||||
SHA384 {
|
||||
$hasher = [System.Security.Cryptography.SHA384]::Create()
|
||||
}
|
||||
SHA512 {
|
||||
$hasher = [System.Security.Cryptography.SHA512]::Create()
|
||||
}
|
||||
MACTripleDES {
|
||||
$hasher = [System.Security.Cryptography.MACTripleDES]::Create()
|
||||
}
|
||||
MD5 {
|
||||
$hasher = [System.Security.Cryptography.MD5]::Create()
|
||||
}
|
||||
RIPEMD160 {
|
||||
$hasher = [System.Security.Cryptography.RIPEMD160]::Create()
|
||||
}
|
||||
}
|
||||
|
||||
Write-Verbose "Hashing using $Algorithm algorithm"
|
||||
try {
|
||||
$data = [System.IO.File]::OpenRead($Path)
|
||||
$hash = $hasher.ComputeHash($data)
|
||||
$hash = [System.BitConverter]::ToString($hash) -replace "-",""
|
||||
return @{
|
||||
Path = $Path;
|
||||
Algorithm = $Algorithm.ToUpper();
|
||||
Hash = $hash
|
||||
}
|
||||
} catch {
|
||||
Write-Verbose "Error hashing: $Path"
|
||||
Write-Verbose "ERROR: $_"
|
||||
return @{}
|
||||
} finally {
|
||||
if ($null -ne $data) {
|
||||
$data.Close()
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( $saltFileName -and $saltVersion -and $saltSha512 ) {
|
||||
if ( $RepoUrl.Contains("minor") ) {
|
||||
$saltFileUrl = @($RepoUrl, $saltVersion, $saltFileName) -join "/"
|
||||
} else {
|
||||
$saltFileUrl = @($RepoUrl, "minor", $saltVersion, $saltFileName) -join "/"
|
||||
}
|
||||
|
||||
#===============================================================================
|
||||
# Script settings
|
||||
#===============================================================================
|
||||
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]'Tls12'
|
||||
$global:ProgressPreference = 'SilentlyContinue'
|
||||
|
||||
#===============================================================================
|
||||
# Declare Variables
|
||||
#===============================================================================
|
||||
$ApiUrl = "https://packages.broadcom.com/artifactory/api/storage/saltproject-generic/onedir"
|
||||
# Detect architecture ($arch)
|
||||
if ([IntPtr]::Size -eq 4) { $arch = "x86" } else { $arch = "amd64" }
|
||||
|
||||
#===============================================================================
|
||||
# Setting up quickstart environment
|
||||
#===============================================================================
|
||||
Write-Host ""
|
||||
Write-Host "Setting up quickstart environment for Salt" -ForegroundColor Cyan
|
||||
|
||||
Write-Verbose "Getting version information from Artifactory"
|
||||
$response = Invoke-WebRequest $ApiUrl -UseBasicParsing
|
||||
# Convert the output to a powershell object
|
||||
$psobj = $response.ToString() | ConvertFrom-Json
|
||||
$Version = $psobj.children[-1].uri.Trim("/")
|
||||
|
||||
Write-Verbose "Getting sha256 hash and download url from Artifactory"
|
||||
$saltFileName = "salt-$Version-onedir-windows-$arch.zip"
|
||||
$response = Invoke-WebRequest "$ApiUrl/$Version/$saltFileName" -UseBasicParsing
|
||||
$psobj = $response.ToString() | ConvertFrom-Json
|
||||
$saltFileUrl = $psobj.downloadUri
|
||||
$saltSha256 = $psobj.checksums.sha256
|
||||
|
||||
Write-Verbose "URL: $saltFileUrl"
|
||||
Write-Host "* INFO: Downloading Salt: " -NoNewline
|
||||
Invoke-WebRequest -Uri $saltFileUrl -OutFile .\salt.zip
|
||||
if ( Test-Path -Path .\salt.zip ) {
|
||||
Write-Host "Success" -ForegroundColor Green
|
||||
} else {
|
||||
Write-Host "Failed" -ForegroundColor Red
|
||||
exit 1
|
||||
}
|
||||
$localSha256 = (Get-FileHash -Path .\salt.zip -Algorithm SHA256).Hash
|
||||
Write-Verbose "Local Hash: $localSha256"
|
||||
Write-Verbose "Remote Hash: $saltSha256"
|
||||
|
||||
Write-Host "* INFO: Comparing Hash: " -NoNewline
|
||||
if ( $localSha256 -eq $saltSha256 ) {
|
||||
Write-Host "Success" -ForegroundColor Green
|
||||
} else {
|
||||
Write-Host "Failed" -ForegroundColor Red
|
||||
exit 1
|
||||
}
|
||||
|
||||
Write-Host "* INFO: Downloading Salt"
|
||||
Invoke-WebRequest -Uri $saltFileUrl -OutFile .\salt.zip
|
||||
|
||||
Write-Host "* INFO: Extracting Salt"
|
||||
Write-Host "* INFO: Extracting Salt: " -NoNewline
|
||||
Expand-ZipFile -ZipFile .\salt.zip -Destination .
|
||||
if ( Test-Path -Path .\salt\Scripts\python.exe ) {
|
||||
Write-Host "Success" -ForegroundColor Green
|
||||
} else {
|
||||
Write-Host "Failed" -ForegroundColor Red
|
||||
exit 1
|
||||
}
|
||||
|
||||
Write-Host "* INFO: Creating Saltfile: " -NoNewline
|
||||
$PATH = $(Get-Location).Path
|
||||
|
||||
$saltfile_contents = @"
|
||||
salt-call:
|
||||
local: True
|
||||
|
@ -143,20 +226,42 @@ salt-call:
|
|||
cachedir: $PATH\salt\var\cache\salt
|
||||
file_root: $PATH\salt\srv\salt
|
||||
"@
|
||||
|
||||
Set-Content -Path .\salt\Saltfile -Value $saltfile_contents
|
||||
if ( Test-Path -Path .\salt\Saltfile ) {
|
||||
Write-Host "Success" -ForegroundColor Green
|
||||
} else {
|
||||
Write-Host "Failed" -ForegroundColor Red
|
||||
exit 1
|
||||
}
|
||||
|
||||
New-Item -Path "$PATH\salt\var\log\salt" -Type Directory -Force | Out-Null
|
||||
New-Item -Path "$PATH\salt\conf" -Type Directory -Force | Out-Null
|
||||
New-Item -Path "$PATH\salt\var\cache\salt" -Type Directory -Force | Out-Null
|
||||
New-Item -Path "$PATH\salt\srv\salt" -Type Directory -Force | Out-Null
|
||||
|
||||
Write-Host "* INFO: Adding Salt to current path"
|
||||
Write-Host "* INFO: $PATH\salt"
|
||||
Write-Host "* INFO: Adding Salt to current path: " -NoNewline
|
||||
$env:Path = "$PATH\salt;$env:PATH"
|
||||
Write-Verbose $env:Path
|
||||
if ( $env:PATH -Like "*$PATH\salt*" ) {
|
||||
Write-Host "Success" -ForegroundColor Green
|
||||
} else {
|
||||
Write-Host "Failed" -ForegroundColor Red
|
||||
exit 1
|
||||
}
|
||||
Write-Host "* INFO: $PATH\salt"
|
||||
|
||||
Write-Host "* INFO: Setting the SALT_SALTFILE environment variable"
|
||||
Write-Host "* INFO: $PATH\salt\Saltfile"
|
||||
Write-Host "* INFO: Setting the SALT_SALTFILE environment variable: "-NoNewline
|
||||
$env:SALT_SALTFILE="$PATH\salt\Saltfile"
|
||||
if ( Test-Path -Path $env:SALT_SALTFILE ) {
|
||||
Write-Host "Success" -ForegroundColor Green
|
||||
} else {
|
||||
Write-Host "Failed" -ForegroundColor Red
|
||||
exit 1
|
||||
}
|
||||
Write-Host "* INFO: $PATH\salt\Saltfile"
|
||||
|
||||
Write-Host ""
|
||||
Write-Host "You can now run simple salt-call commands" -ForegroundColor Cyan
|
||||
Write-Host "* INFO: Create Salt states in $PATH\salt\srv\salt"
|
||||
Write-Host "* INFO: Try running salt-call test.ping"
|
||||
Write-Host ""
|
||||
|
|
|
@ -29,24 +29,27 @@ def run_salt_call(cmd):
|
|||
if platform.system() == "Windows":
|
||||
cmd.append("--out=json")
|
||||
result = subprocess.run(cmd, capture_output=True, text=True)
|
||||
print(
|
||||
f"DGM run_salt_call, cmd '{cmd}', result '{result}', stdout '{result.stdout}'",
|
||||
flush=True,
|
||||
)
|
||||
if 0 == result.returncode:
|
||||
json_data = json.loads(result.stdout)
|
||||
else:
|
||||
log.error(f"failed to produce output result, '{result}'")
|
||||
|
||||
else:
|
||||
cmdl = ["sudo"]
|
||||
if platform.system() == "Darwin":
|
||||
cmdl = ["sudo"]
|
||||
else:
|
||||
cmdl = []
|
||||
cmdl.extend(cmd)
|
||||
cmdl.append("--out=json")
|
||||
result = subprocess.run(cmdl, capture_output=True, text=True)
|
||||
print(
|
||||
f"DGM run_salt_call, cmdl '{cmdl}', result '{result}', stdout '{result.stdout}'",
|
||||
flush=True,
|
||||
)
|
||||
try:
|
||||
result = subprocess.run(cmdl, capture_output=True, text=True)
|
||||
except TypeError:
|
||||
result = subprocess.run(
|
||||
cmdl,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
universal_newlines=True,
|
||||
)
|
||||
if 0 == result.returncode:
|
||||
json_data = json.loads(result.stdout)
|
||||
else:
|
||||
|
@ -74,10 +77,6 @@ def test_target_salt_version(path, target_salt_version):
|
|||
pytest.skip(f"No target version specified")
|
||||
cmd = ["salt-call", "--local", "grains.item", "saltversion", "--timeout=120"]
|
||||
result = run_salt_call(cmd)
|
||||
dgm_saltversion = result["saltversion"]
|
||||
print(
|
||||
f"DGM test_target_salt_version, target_salt_version '{target_salt_version}', result saltversion '{dgm_saltversion }', result '{result}'",
|
||||
flush=True,
|
||||
)
|
||||
# Returns: {'saltversion': '3006.9+217.g53cfa53040'}
|
||||
assert result["saltversion"] == target_salt_version
|
||||
adj_saltversion = result["saltversion"].split("+")[0]
|
||||
assert adj_saltversion == target_salt_version
|
||||
|
|
Loading…
Add table
Reference in a new issue