From d142ed44f531dc3d1c6d7257dd09ac7c9c325167 Mon Sep 17 00:00:00 2001 From: Alexandr Reshetnikov Date: Sun, 25 Jun 2023 22:31:07 +0400 Subject: [PATCH] ansible 8.1.0 core 2.15.1, ansible-lint 6.17.2 (#68) add ansible-inventory entrypoint --- .github/workflows/ansible.yml | 2 +- README.md | 2 +- ansible/build_gnu.sh | 10 ++++++++-- ansible/release/__main__ansible-inventory.py | 8 ++++++++ ansible/release/ansible-inventory | 3 +++ ansible/test_docker.sh | 2 +- ansible/test_linux.sh | 20 ++++++++++++-------- 7 files changed, 34 insertions(+), 13 deletions(-) create mode 100644 ansible/release/__main__ansible-inventory.py create mode 100755 ansible/release/ansible-inventory diff --git a/.github/workflows/ansible.yml b/.github/workflows/ansible.yml index 96b6cc3c8..7f6a5ece2 100644 --- a/.github/workflows/ansible.yml +++ b/.github/workflows/ansible.yml @@ -52,7 +52,7 @@ jobs: uses: ./.github/workflows/release.yml with: workflow: ${{ github.workflow }} - tool_version: '8.0.0' + tool_version: '8.1.0' prepare_body: | bsdtar -Oxf ./build-docker/build-docker.tar.gz build-docker.md >> body.md bsdtar -Oxf ./build-gnu/build-gnu.tar.gz build-gnu.md >> body.md diff --git a/README.md b/README.md index f53cb44aa..a0cdf1426 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ | [![GitHub release (by tag)](https://img.shields.io/github/downloads/hemnstill/StandaloneTools/poetry-1.5.1/total?label=⭳%20poetry-1.5.1)](https://github.com/hemnstill/StandaloneTools/releases/tag/poetry-1.5.1) | [![GitHub Repo stars](https://img.shields.io/github/stars/python-poetry/poetry?style=social&label=poetry)](https://github.com/python-poetry/poetry) [![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/python-poetry/poetry)](https://python-poetry.org/docs/) | | [![GitHub release (by tag)](https://img.shields.io/github/downloads/hemnstill/StandaloneTools/pylint-2.17.0/total?label=⭳%20pylint-2.17.0)](https://github.com/hemnstill/StandaloneTools/releases/tag/pylint-2.17.0) | [![GitHub Repo stars](https://img.shields.io/github/stars/PyCQA/pylint?style=social&label=pylint)](https://github.com/PyCQA/pylint) [![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/PyCQA/pylint)](https://pylint.pycqa.org/en/latest/) | | [![GitHub release (by tag)](https://img.shields.io/github/downloads/hemnstill/StandaloneTools/mypy-1.1.1/total?label=⭳%20mypy-1.1.1)](https://github.com/hemnstill/StandaloneTools/releases/tag/mypy-1.1.1) | [![GitHub Repo stars](https://img.shields.io/github/stars/python/mypy?style=social&label=mypy)](https://github.com/python/mypy) [![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/python/mypy)](https://mypy.readthedocs.io/en/latest/) | -| [![GitHub release (by tag)](https://img.shields.io/github/downloads/hemnstill/StandaloneTools/ansible-8.0.0/total?label=⭳%20ansible-8.0.0-core-2.15.0)](https://github.com/hemnstill/StandaloneTools/releases/tag/ansible-8.0.0) | [![GitHub Repo stars](https://img.shields.io/github/stars/ansible/ansible?style=social&label=ansible)](https://github.com/ansible/ansible) [![PyPI](https://img.shields.io/pypi/v/ansible)](https://pypi.org/project/ansible/) [![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/ansible/ansible)](https://docs.ansible.com/ansible/devel/reference_appendices/release_and_maintenance.html) | +| [![GitHub release (by tag)](https://img.shields.io/github/downloads/hemnstill/StandaloneTools/ansible-8.1.0/total?label=⭳%20ansible-8.1.0-core-2.15.1)](https://github.com/hemnstill/StandaloneTools/releases/tag/ansible-8.1.0) | [![GitHub Repo stars](https://img.shields.io/github/stars/ansible/ansible?style=social&label=ansible)](https://github.com/ansible/ansible) [![PyPI](https://img.shields.io/pypi/v/ansible)](https://pypi.org/project/ansible/) [![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/ansible/ansible)](https://docs.ansible.com/ansible/devel/reference_appendices/release_and_maintenance.html) | | [![GitHub release (by tag)](https://img.shields.io/github/downloads/hemnstill/StandaloneTools/bsdtar-3.6.2/total?label=⭳%20bsdtar-3.6.2)](https://github.com/hemnstill/StandaloneTools/releases/tag/bsdtar-3.6.2) | [![GitHub Repo stars](https://img.shields.io/github/stars/libarchive/libarchive?style=social&label=libarchive)](https://github.com/libarchive/libarchive) [![GitHub release (latest by date including pre-releases)](https://img.shields.io/github/v/release/libarchive/libarchive)](https://github.com/libarchive/libarchive/releases/latest) | | [![GitHub release (by tag)](https://img.shields.io/github/downloads/hemnstill/StandaloneTools/pg_dump-15.1/total?label=⭳%20pg_dump-15.1)](https://github.com/hemnstill/StandaloneTools/releases/tag/pg_dump-15.1) | [![GitHub Repo stars](https://img.shields.io/github/stars/postgres/postgres?style=social&label=postgres)](https://github.com/postgres/postgres) [![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/postgres/postgres)](https://www.postgresql.org/docs/current/index.html) | | [![GitHub release (by tag)](https://img.shields.io/github/downloads/hemnstill/StandaloneTools/busybox-1.35.0-FRP-4784/total?label=⭳%20busybox-1.35.0-FRP-4784)](https://github.com/hemnstill/StandaloneTools/releases/tag/busybox-1.35.0-FRP-4784) | [![GitHub Repo stars](https://img.shields.io/github/stars/rmyorston/busybox-w32?style=social&label=busybox-w32)](https://github.com/rmyorston/busybox-w32) [![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/rmyorston/busybox-w32)](https://frippery.org/busybox/release-notes/current.html) | diff --git a/ansible/build_gnu.sh b/ansible/build_gnu.sh index 678fb7e84..e70f4a357 100755 --- a/ansible/build_gnu.sh +++ b/ansible/build_gnu.sh @@ -10,8 +10,8 @@ apk add --no-cache alpine-sdk python3-dev bash export LC_ALL=en_US.UTF-8 tool_name="ansible" -tool_version="8.0.0" -tool_lint_version="6.17.1" +tool_version="8.1.0" +tool_lint_version="6.17.2" python_self_name="python-3.11.3" self_name="$tool_name-$tool_version" release_version_dirpath="$dp0/release/$self_name" @@ -51,6 +51,9 @@ cp -f "$dp0/release/ansible-config" "$release_version_dirpath/Scripts/bin/" cp -f "$dp0/release/__main__ansible-playbook.py" "$release_version_dirpath/" cp -f "$dp0/release/ansible-playbook" "$release_version_dirpath/Scripts/bin/" +cp -f "$dp0/release/__main__ansible-inventory.py" "$release_version_dirpath/" +cp -f "$dp0/release/ansible-inventory" "$release_version_dirpath/Scripts/bin/" + cp -f "$dp0/release/__main__ansible-galaxy.py" "$release_version_dirpath/" cp -f "$dp0/release/ansible-galaxy" "$release_version_dirpath/Scripts/bin/" @@ -84,9 +87,12 @@ cd "$release_version_dirpath" %s +%s + ' "$("./Scripts/bin/$tool_name" --version)" \ "$("./Scripts/bin/ansible-config" --version | head -1)" \ "$("./Scripts/bin/ansible-playbook" --version | head -1)" \ + "$("./Scripts/bin/ansible-inventory" --version | head -1)" \ "$("./Scripts/bin/ansible-galaxy" --version | head -1)" \ "$("./Scripts/bin/ansible-lint" --version | head -1)" \ "$("./Scripts/bin/ansible-test" --version | head -1)" \ diff --git a/ansible/release/__main__ansible-inventory.py b/ansible/release/__main__ansible-inventory.py new file mode 100644 index 000000000..91832fb08 --- /dev/null +++ b/ansible/release/__main__ansible-inventory.py @@ -0,0 +1,8 @@ +# -*- coding: utf-8 -*- +import re +import sys +from ansible.cli.inventory import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) + diff --git a/ansible/release/ansible-inventory b/ansible/release/ansible-inventory new file mode 100755 index 000000000..cfb01b368 --- /dev/null +++ b/ansible/release/ansible-inventory @@ -0,0 +1,3 @@ +#!/bin/bash +dp0="$(dirname "$(readlink -f "$0")")" +"$dp0/python3" "$dp0/../../__main__ansible-inventory.py" "$@" diff --git a/ansible/test_docker.sh b/ansible/test_docker.sh index d7a1f0f68..3fc6321f4 100755 --- a/ansible/test_docker.sh +++ b/ansible/test_docker.sh @@ -23,7 +23,7 @@ test_ansible_galaxy_version() { } test_ansible_lint_version() { - assertEquals "ansible-lint 6.17.0 using ansible-core:2.14.5 ruamel-yaml:0.17.32 ruamel-yaml-clib:0.2.7" "$(docker run --rm $image_name ansible-lint --version | head -1)" + assertEquals "ansible-lint 6.17.2 using ansible-core:2.14.5 ansible-compat:4.0.4 ruamel-yaml:0.17.32 ruamel-yaml-clib:0.2.7" "$(docker run --rm $image_name ansible-lint --version | head -1)" } # Load and run shUnit2. diff --git a/ansible/test_linux.sh b/ansible/test_linux.sh index 304162346..07f9a6833 100755 --- a/ansible/test_linux.sh +++ b/ansible/test_linux.sh @@ -18,7 +18,7 @@ if [[ "$is_ubuntu_os" == true ]]; then fi test_version() { - assertEquals "ansible [core 2.15.0] + assertEquals "ansible [core 2.15.1] config file = None configured module search path = ['/github/home/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /__w/StandaloneTools/StandaloneTools/bin/Scripts/lib/python3.11/site-packages/ansible @@ -30,31 +30,35 @@ test_version() { } test_bin_version() { - assertEquals "ansible [core 2.15.0]" "$(../bin/Scripts/bin/ansible --version | head -1)" + assertEquals "ansible [core 2.15.1]" "$(../bin/Scripts/bin/ansible --version | head -1)" } test_ansible_config_version() { - assertEquals "ansible-config [core 2.15.0]" "$(../bin/Scripts/bin/ansible-config --version | head -1)" + assertEquals "ansible-config [core 2.15.1]" "$(../bin/Scripts/bin/ansible-config --version | head -1)" } test_ansible_playbook_version() { - assertEquals "ansible-playbook [core 2.15.0]" "$(../bin/Scripts/bin/ansible-playbook --version | head -1)" + assertEquals "ansible-playbook [core 2.15.1]" "$(../bin/Scripts/bin/ansible-playbook --version | head -1)" +} + +test_ansible_inventory_version() { + assertEquals "ansible-inventory [core 2.15.1]" "$(../bin/Scripts/bin/ansible-inventory --version | head -1)" } test_ansible_galaxy_version() { - assertEquals "ansible-galaxy [core 2.15.0]" "$(../bin/Scripts/bin/ansible-galaxy --version | head -1)" + assertEquals "ansible-galaxy [core 2.15.1]" "$(../bin/Scripts/bin/ansible-galaxy --version | head -1)" } test_ansible_lint_version() { - assertEquals "ansible-lint 6.17.1 using ansible-core:2.15.0 ruamel-yaml:0.17.32 ruamel-yaml-clib:0.2.7" "$(../bin/Scripts/bin/ansible-lint --version | head -1)" + assertEquals "ansible-lint 6.17.2 using ansible-core:2.15.1 ansible-compat:4.1.2 ruamel-yaml:0.17.32 ruamel-yaml-clib:0.2.7" "$(../bin/Scripts/bin/ansible-lint --version | head -1)" } test_ansible_test_version() { - assertEquals "ansible-test version 2.15.0" "$(../bin/Scripts/bin/ansible-test --version | head -1)" + assertEquals "ansible-test version 2.15.1" "$(../bin/Scripts/bin/ansible-test --version | head -1)" } test_ansible_doc_version() { - assertEquals "ansible-doc [core 2.15.0]" "$(../bin/Scripts/bin/ansible-doc --version | head -1)" + assertEquals "ansible-doc [core 2.15.1]" "$(../bin/Scripts/bin/ansible-doc --version | head -1)" } # Load and run shUnit2.