diff --git a/Changelog.md b/Changelog.md index 368fb0d..c1c733b 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,5 +1,9 @@ # [ghcr.io/]kineticcafe/ansible Changelog +## 5.1.0 / 2024-02-27 + +- Upgraded to Ansible 8.7.0 + ## 5.0.0 / 2023-11-03 - Upgraded to Python 3.12 diff --git a/README.md b/README.md index 0a5d690..69f2e60 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ effort of installing it on various systems. The image is based on Debian Bookworm (slim) and includes: -- Ansible 8.5.0 +- Ansible 8.7.0 - Python 3.12 These images can be pulled either from Docker Hub @@ -18,7 +18,7 @@ These images can be pulled either from Docker Hub Tests have been made on Ubuntu 18 and macOS 13 (Apple Silicon). Because of recent changes to cryptographic packages in Python, support for -linux/arm/v7 has been dropped. +`linux/arm/v7` has been dropped. ## `kineticcafe-ansible` script Commands @@ -31,9 +31,9 @@ default; this can be overridden by using `$IMAGE`: $ IMAGE=kineticcafe/ansible:latest ./kineticcafe-ansible --version ``` -### Installing `kinetic-ansible` +### Installing `kineticcafe-ansible` -`kinetic-ansible` can be installed with symlinks using the `install` script: +`kineticcafe-ansible` can be installed with symlinks using the `install` script: ```sh curl -sSL --fail \ @@ -43,18 +43,18 @@ curl -sSL --fail \ Replace `~/.local/bin` with your preferred binary directory. -By default, it will download `kinetic-ansible` from GitHub and install it in the -provided `TARGET` and make symbolic links for the following Ansible commands: -`ansible`, `ansible-community`, `ansible-config`, `ansible-connection`, -`ansible-console`, `ansible-doc`, `ansible-galaxy`, `ansible-inventory`, -`ansible-playbook`, `ansible-pull`, `ansible-test`, and `ansible-vault`. -Symbolic link creation will not overwrite files or symbolic links to locations -_other_ than `TARGET/kinetic-ansible`. +By default, it will download `kineticcafe-ansible` from GitHub and install it in +the provided `TARGET` and make symbolic links for the following Ansible +commands: `ansible`, `ansible-community`, `ansible-config`, +`ansible-connection`, `ansible-console`, `ansible-doc`, `ansible-galaxy`, +`ansible-inventory`, `ansible-playbook`, `ansible-pull`, `ansible-test`, and +`ansible-vault`. Symbolic link creation will not overwrite files or symbolic +links to locations _other_ than `TARGET/kineticcafe-ansible`. `--no-symlinks` (`-S`) may be specified to skip symbolic link creation entirely. -`--force` (`-f`) may be specified to install `kinetic-ansible` even if it already -exists, and to overwrite files and non-`TARGET/kinetic-ansible` symbolic links. +`--force` (`-f`) may be specified to install `kineticcafe-ansible` even if it already +exists, and to overwrite files and non-`TARGET/kineticcafe-ansible` symbolic links. `--verbose` (`-v`) will turn on trace output of commands. diff --git a/install b/install index b2fad7f..8bc8899 100755 --- a/install +++ b/install @@ -14,7 +14,7 @@ symlinked_commands=( ) readonly symlinked_commands -# equivalent to readlink -f +# cross-platform equivalent to GNU readlink -f. canonicalize() { local t t="$1" @@ -52,14 +52,6 @@ already a symlink to TARGET/${script} and --force is not supplied. USAGE } -maybe-verbose() { - if "${verbose}"; then - set -x && "${@}" && set +x - else - "${@}" - fi -} - declare force install_symlinks no_download target target_script verbose force=false install_symlinks=true @@ -104,25 +96,35 @@ fi target_script="${target}/${script}" download-script() { - if ! curl -sSL --fail "${url}" -o "${target_script}"; then + local -a cmd + cmd=(curl -sSL --fail "${url}" -o "${target_script}") + + [[ "${verbose}" ]] && echo "${cmd[*]}" + + if ! "${cmd[@]}"; then echo >&2 "error: could not download ${url} into ${target_script}." exit 1 fi } -if "${no_download}"; then - if ! [[ -x "${target_script}" ]]; then - echo >&2 "error: ${target_script} does not exist and no download is set." - fi -elif [[ -x "${target_script}" ]]; then - if ! "${force}"; then - echo >&2 "error: ${target_script} already exists." - exit 1 - fi +if "${no_download}" && ! [[ -x "${target_script}" ]]; then + echo >&2 "error: ${target_script} does not exist and no download is set." + exit 1 +elif [[ -x "${target_script}" ]] && ! "${force}"; then + echo >&2 "error: ${target_script} already exists." + exit 1 +fi - maybe-verbose download-script +if ! [[ -x "${target_script}" ]] && ! "${no_download}"; then + download-script - [[ -x "${target_script}" ]] || maybe-verbose chmod +x "${target_script}" + if ! [[ -x "${target_script}" ]]; then + if "${verbose}"; then + chmod -v +x "${target_script}" + else + chmod +x "${target_script}" + fi + fi fi "${install_symlinks}" || exit 0 @@ -140,5 +142,9 @@ for symlinked_command in "${symlinked_commands[@]}"; do fi fi - maybe-verbose ln -sf "${target_script}" "${target_command}" + if "${verbose}"; then + ln -sfv "${target_script}" "${target_command}" + else + ln -sf "${target_script}" "${target_command}" + fi done diff --git a/pdm.lock b/pdm.lock index 6514816..124fdad 100644 --- a/pdm.lock +++ b/pdm.lock @@ -4,25 +4,25 @@ [metadata] groups = ["default", "dev"] strategy = ["cross_platform"] -lock_version = "4.4" +lock_version = "4.4.1" content_hash = "sha256:02acdf09106e2c66beacebc208bad0539b50a2bc1bc80bc124b6f0adfadf8b0c" [[package]] name = "ansible" -version = "8.5.0" +version = "8.7.0" requires_python = ">=3.9" summary = "Radically simple IT automation" dependencies = [ - "ansible-core~=2.15.5", + "ansible-core~=2.15.7", ] files = [ - {file = "ansible-8.5.0-py3-none-any.whl", hash = "sha256:2749032e26b0dbc9a694528b85fd89e7f950b8c7b53606f17dd997f23ac7cc88"}, - {file = "ansible-8.5.0.tar.gz", hash = "sha256:327c509bdaf5cdb2489d85c09d2c107e9432f9874c8bb5c0702a731160915f2d"}, + {file = "ansible-8.7.0-py3-none-any.whl", hash = "sha256:fa7d3bc2dfdb0ab031df645814ff86b15cb5ec041bfbee4041f795abfa5646ca"}, + {file = "ansible-8.7.0.tar.gz", hash = "sha256:3a5ca5152e4547d590e40b542d76b18dbbe2b36da4edd00a13a7c51a374ff737"}, ] [[package]] name = "ansible-core" -version = "2.15.5" +version = "2.15.9" requires_python = ">=3.9" summary = "Radically simple IT automation" dependencies = [ @@ -33,8 +33,8 @@ dependencies = [ "resolvelib<1.1.0,>=0.5.3", ] files = [ - {file = "ansible-core-2.15.5.tar.gz", hash = "sha256:8cc539cb8d4349af3ffd901c70722f7a7a203ae6427ddac95ffdf546a6e41602"}, - {file = "ansible_core-2.15.5-py3-none-any.whl", hash = "sha256:3efa234de5fce79ec98853f3369535b27cacd7ce498495b996030cd15c373735"}, + {file = "ansible-core-2.15.9.tar.gz", hash = "sha256:25f9b1b5a5af3c0986bd3928ed086eaddb867527fb5c83afef1a03cfad34f345"}, + {file = "ansible_core-2.15.9-py3-none-any.whl", hash = "sha256:5b6a4b12aa5358f60933e79d86763e3558862282fb1dc563a29b9999e5849fc3"}, ] [[package]] diff --git a/pyproject.toml b/pyproject.toml index e9135e2..c34efef 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "pdm.backend" [project] name = "docker-ansible" -version = "5.0.0" +version = "5.1.0" description = "Ansible in Docker" authors = [{ name = "Austin Ziegler", email = "aziegler@kineticcommerce.com" }] dependencies = ["ansible~=8.2"]