Last active
March 12, 2024 18:02
-
-
Save nnzv/9389e59cbf3917fa006521d5d80ecd95 to your computer and use it in GitHub Desktop.
Run ansible inside a container!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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