mirror of
https://github.com/saltstack/salt-bootstrap.git
synced 2025-04-17 10:10:25 +00:00
Compare commits
65 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 | ||
![]() |
699ade0c04 |
12 changed files with 788 additions and 419 deletions
63
.github/workflows/ci.yml
vendored
63
.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,36 @@ 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'
|
||||
|
@ -190,9 +204,9 @@ jobs:
|
|||
with:
|
||||
distro-slug: debian-12
|
||||
display-name: Debian 12
|
||||
container-slug: systemd-debian-12
|
||||
container-slug: debian-12
|
||||
timeout: 20
|
||||
instances: '["stable-3007", "onedir-3007", "stable-3007-1", "latest", "default"]'
|
||||
instances: '["stable-3007", "git-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]'
|
||||
|
||||
|
||||
photon-5:
|
||||
|
@ -205,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:
|
||||
|
@ -220,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"]'
|
||||
|
||||
|
@ -235,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"]'
|
||||
|
||||
|
@ -250,7 +264,7 @@ 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", "git-3006", "onedir-3006", "stable-3006-8", "stable-3007", "git-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]'
|
||||
|
||||
|
@ -263,10 +277,11 @@ jobs:
|
|||
needs:
|
||||
- lint
|
||||
- generate-actions-workflow
|
||||
- macos-12
|
||||
- macos-13
|
||||
- macos-14
|
||||
- windows-2022
|
||||
- amazonlinux-2023
|
||||
- debian-11
|
||||
- debian-12
|
||||
- photon-5
|
||||
- rockylinux-8
|
||||
|
|
83
.github/workflows/templates/generate.py
vendored
83
.github/workflows/templates/generate.py
vendored
|
@ -6,18 +6,15 @@ 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",
|
||||
|
@ -30,22 +27,19 @@ 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",
|
||||
# "debian-11",
|
||||
# "debian-13",
|
||||
# "fedora-40",
|
||||
# "photon-4",
|
||||
# "ubuntu-2004",
|
||||
# "ubuntu-2404",
|
||||
STABLE_DISTROS = [
|
||||
"amazonlinux-2023",
|
||||
"debian-11",
|
||||
"debian-12",
|
||||
"photon-5",
|
||||
"rockylinux-8",
|
||||
|
@ -53,17 +47,15 @@ STABLE_DISTROS = [
|
|||
"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-13",
|
||||
# "fedora-40",
|
||||
# "photon-4",
|
||||
# "ubuntu-2004",
|
||||
# "ubuntu-2404",
|
||||
ONEDIR_DISTROS = [
|
||||
"amazonlinux-2023",
|
||||
"debian-11",
|
||||
"debian-12",
|
||||
"photon-5",
|
||||
"rockylinux-8",
|
||||
|
@ -71,8 +63,6 @@ ONEDIR_DISTROS = [
|
|||
"ubuntu-2204",
|
||||
]
|
||||
|
||||
# only test against current containers with systemd
|
||||
# will add these when they become available with systemd
|
||||
# "amazonlinux-2",
|
||||
# "amazonlinux-2023",
|
||||
# "photon-4",
|
||||
|
@ -92,27 +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-2404",
|
||||
]
|
||||
|
||||
# "ubuntu-2204",
|
||||
BLACKLIST_GIT_3007 = [
|
||||
"amazonlinux-2",
|
||||
"amazonlinux-2023",
|
||||
"debian-11",
|
||||
|
@ -126,11 +102,26 @@ BLACKLIST_GIT_3007 = [
|
|||
"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-12",
|
||||
"debian-13",
|
||||
"fedora-40",
|
||||
"photon-4",
|
||||
|
@ -211,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
|
||||
|
|
64
CHANGELOG.md
64
CHANGELOG.md
|
@ -1,3 +1,67 @@
|
|||
# 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
|
||||
|
|
|
@ -37,6 +37,12 @@ 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``
|
||||
|
@ -369,7 +375,7 @@ Using ``PowerShell`` to install latest stable version:
|
|||
|
||||
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]'Tls12'
|
||||
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 & "$env:TEMP\bootstrap-salt.ps1"
|
||||
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser -Force; & "$env:TEMP\bootstrap-salt.ps1"
|
||||
|
||||
Display information about the install script parameters:
|
||||
|
||||
|
|
|
@ -108,7 +108,7 @@ if ($help) {
|
|||
exit 0
|
||||
}
|
||||
|
||||
$__ScriptVersion = "2024.11.26"
|
||||
$__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 ""
|
||||
|
|
|
@ -35,10 +35,21 @@ def run_salt_call(cmd):
|
|||
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)
|
||||
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:
|
||||
|
|
Loading…
Add table
Reference in a new issue