Skip to content

Instantly share code, notes, and snippets.

@nnzv
Last active March 12, 2024 18:02
Show Gist options
  • Save nnzv/9389e59cbf3917fa006521d5d80ecd95 to your computer and use it in GitHub Desktop.
Save nnzv/9389e59cbf3917fa006521d5d80ecd95 to your computer and use it in GitHub Desktop.
Run ansible inside a container!
FROM centos:7
WORKDIR /etc/ansible
COPY . .
ENV LC_ALL en_US.UTF-8
RUN yum update -y \
&& yum upgrade -y \
&& yum install -y epel-release \
&& yum install -y \
python3-pip \
openssh-clients \
sshpass \
&& pip3 install --upgrade pip \
&& pip3 install ansible-core==2.11.12 \
&& pip3 install ansible ansible-lint \
&& yum -y remove epel-release \
&& yum clean all \
&& rm -rf /root/.cache/pip
ENTRYPOINT ["ansible-playbook", "-m", "ping", "all"]
www ansible_host=172.18.0.11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment