Created
November 1, 2016 11:46
-
-
Save cidrblock/c163be2da9757e67a4fd5014f33948e5 to your computer and use it in GitHub Desktop.
Dockerfile for ansible + utilities
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 ansible/ansible:ubuntu1604 | |
# Some basic useful utilities not related to Ansible | |
RUN apt-get update && apt-get -y install vim wget cowsay | |
# Install govc, used for vsphere VM spinup | |
RUN curl -L -O https://github.com/vmware/govmomi/releases/download/v0.11.1/govc_linux_amd64.gz &&\ | |
gunzip govc_linux_amd64.gz &&\ | |
mv govc_linux_amd64 /usr/local/bin/govc &&\ | |
chmod +x /usr/local/bin/govc | |
# Prereq for ansible | |
RUN pip install --upgrade pip | |
RUN pip install paramiko PyYAML Jinja2 httplib2 six requests dnspython | |
# clone ansible from source and checkout version | |
RUN git clone https://github.com/ansible/ansible.git --recursive | |
RUN cd ansible &&\ | |
git checkout v2.2.0.0-0.4.rc4 &&\ | |
git submodule update --init --recursive &&\ | |
cd .. | |
# Set-up the ntc_ansible module | |
RUN apt-get update && apt-get -y install zlib1g-dev libxml2-dev libxslt-dev python-dev | |
RUN pip install ntc-ansible terminal | |
RUN mkdir modules | |
RUN cd modules &&\ | |
git clone https://github.com/networktocode/ntc-ansible --recursive &&\ | |
git submodule update --init --recursive &&\ | |
cd .. | |
RUN echo 'source /ansible/hacking/env-setup' >> ~/.bashrc | |
RUN echo "[defaults]" > ~/.ansible.cfg | |
RUN echo "library = /modules/" >> ~/.ansible.cfg | |
ENTRYPOINT /bin/bash |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment