Ansible, Azure and macOS Big Sur

One of the annoying things about updating to the latest version of macOS is that a lot of the command-line tools I use tend to break or need tweaking slightly from how I have been using them.

docker run \
-v ${HOME}/.azure:/root/.azure \
-v ${PWD}:/playbook \
ghcr.io/russmckendrick/ansible:latest \
ansible-playbook -i inv site.yml
Running the image using Azure CLI credentials
AZURE_CLIENT_ID=yourClientId
AZURE_SECRET=yourClientSecret
AZURE_TENANT=yourTenantId
AZURE_SUBSCRIPTION_ID=yourSubscriptionId
docker run \
-v ${PWD}:/playbook \
--env-file ./azurecreds \
ghcr.io/russmckendrick/ansible:latest \
ansible-playbook -i inv site.yml
Running the image using environment variables
docker run \
-v ${HOME}/.azure:/root/.azure \
ghcr.io/russmckendrick/ansible:latest \
az account list
Viewing the output of az account list
FROM alpine:latest

LABEL maintainer="Russ McKendrick <russ@mckendrick.io>"
LABEL org.opencontainers.image.source https://github.com/russmckendrick/docker-ansible-azure/
LABEL org.opencontainers.image.description "Docker Image which runs Ansible, the Azure Collection and the Azure CLI, see the repo for more information"

RUN apk update && apk upgrade && \
apk add bash py3-pip && \
apk add --virtual=build gcc libffi-dev musl-dev openssl-dev python3-dev make && \
pip --no-cache-dir install -U pip && \
pip install azure-cli && \
pip install -r https://raw.githubusercontent.com/ansible-collections/azure/dev/requirements-azure.txt && \
pip install ansible && \
ansible-galaxy collection install azure.azcollection && \
apk del --purge build && \
mkdir /playbook

WORKDIR /playbook

CMD [ "ansible-playbook", "--version" ]

Geek, Lover Of Shiny Things and Grump.