Skip to content

Instantly share code, notes, and snippets.

@duffney
Last active October 23, 2020 02:30
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save duffney/607a264ab23a49f293d5a35f7e0134de to your computer and use it in GitHub Desktop.
Save duffney/607a264ab23a49f293d5a35f7e0134de to your computer and use it in GitHub Desktop.
Dockerfile and supporting links for Ansible 2.10 for become Ansible

Dockerfile

FROM centos:centos7
COPY requirements-azure /tmp
RUN yum check-update; \
yum install -y gcc libffi-devel python3 epel-release; \
yum install -y openssh-clients; \
curl https://packages.microsoft.com/config/rhel/7/prod.repo | tee /etc/yum.repos.d/microsoft.repo; \
yum install -y powershell; \
pwsh -c "Set-PackageSource -Name PSGallery -Trusted"; \
pwsh -c "Install-Module AZ -Scope AllUsers"; \
pip3 --no-cache-dir install --upgrade pip; \
pip3 --no-cache-dir install ansible; \
pip3 --no-cache-dir install -r /tmp/requirements-azure; \
ansible-galaxy collection install azure.azcollection --force; \
yum clean all; \
rm /tmp/requirements-azure

the file "requirements-azure" should be in the Dockerfile path, see below.

Resources

Announcing azcollection, the Ansible collection for Azure

requirements-azure.txt

courtesy of @adiltouati

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment