Skip to content

Commit

Permalink
ansible: upgrade to 8.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
halostatue committed Feb 27, 2024
1 parent e2aa7eb commit f52344c
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 44 deletions.
4 changes: 4 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand All @@ -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 \
Expand All @@ -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.

Expand Down
50 changes: 28 additions & 22 deletions install
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
16 changes: 8 additions & 8 deletions pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down

0 comments on commit f52344c

Please sign in to comment.