Skip to content

Instantly share code, notes, and snippets.

@cidrblock
Created November 1, 2016 11:46
Show Gist options
  • Save cidrblock/c163be2da9757e67a4fd5014f33948e5 to your computer and use it in GitHub Desktop.
Save cidrblock/c163be2da9757e67a4fd5014f33948e5 to your computer and use it in GitHub Desktop.
Dockerfile for ansible + utilities
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