Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
vagrantfile bento/ubuntu-14.04 ans provision.sh
#!/usr/bin/env bash
# setup nameserver
sed -i 's/nameserver/#nameserver/g' /etc/resolv.conf
echo "nameserver 8.8.8.8" >> /etc/resolv.conf
# add ppa
sudo apt-add-repository -y ppa:ansible/ansible
sudo apt-get update
# install softwave
sudo apt-get install -y git-core build-essential vim wget curl software-properties-common ansible python-pip python-dev
# install docker
sudo wget -qO- https://get.docker.com/ | sh
sudo usermod -a -G docker vagrant
# python lib
sudo pip install httplib2
sudo pip install passlib
sudo chown -R root:root /home/vagrant/.cache/
sudo apt-get install build-dep python-cffi
sudo pip install cffi
sudo pip install configparser
sudo pip install cryptography
sudo pip install docker-compose
sudo pip install MarkupSafe --upgrade
sudo pip install paramiko --upgrade
sudo pip install py2-ipaddress
sudo pip install pycparser --upgrade
sudo pip install PyYAML --upgrade
sudo pip install six --upgrade
git clone https://github.com/ansible/ansible-container.git /home/vagrant/ansible-container
sudo docker run -d -i --name u_py ubuntu:trusty bash
sudo docker exec u_py apt-get update
sudo docker exec u_py apt-get install -y python-dev
sudo docker commit u_py ubuntu:python
sudo docker rm -f u_py
sed -i 's/ubuntu:trusty/ubuntu:python/g' /home/vagrant/ansible-container/test/ansible/container.yml
sed -i 's/ubuntu:trusty/ubuntu:python/g' /home/vagrant/ansible-container/test-v1/ansible/container.yml
sed -i "s/'container.shipit'/'container.docker','container.shipit'/g" /home/vagrant/ansible-container/setup.py
sed -i 's/- {{ which_docker }}:\/usr\/bin\/docker/#- {{ which_docker }}:\/usr\/bin\/docker/g' /home/vagrant/ansible-container/container/templates/build-docker-compose.j2.yml
sed -i 's/- {{ which_docker }}:\/usr\/bin\/docker/#- {{ which_docker }}:\/usr\/bin\/docker/g' /home/vagrant/ansible-container/container/templates/build-docker-compose-v1.j2.yml
sed -i 's/- {{ which_docker }}:\/usr\/bin\/docker/#- {{ which_docker }}:\/usr\/bin\/docker/g' /home/vagrant/ansible-container/container/templates/listhosts-docker-compose.j2.yml
sed -i 's/- {{ which_docker }}:\/usr\/bin\/docker/#- {{ which_docker }}:\/usr\/bin\/docker/g' /home/vagrant/ansible-container/container/templates/listhosts-docker-compose-v1.j2.yml
sed -i 's/- $DOCKER_CERT_PATH:\/docker-certs\//#- $DOCKER_CERT_PATH:\/docker-certs\//g' /home/vagrant/ansible-container/container/templates/build-docker-compose.j2.yml
sed -i 's/- $DOCKER_CERT_PATH:\/docker-certs\//#- $DOCKER_CERT_PATH:\/docker-certs\//g' /home/vagrant/ansible-container/container/templates/build-docker-compose-v1.j2.yml
sed -i 's/- $DOCKER_CERT_PATH:\/docker-certs\//#- $DOCKER_CERT_PATH:\/docker-certs\//g' /home/vagrant/ansible-container/container/templates/listhosts-docker-compose.j2.yml
sed -i 's/- $DOCKER_CERT_PATH:\/docker-certs\//#- $DOCKER_CERT_PATH:\/docker-certs\//g' /home/vagrant/ansible-container/container/templates/listhosts-docker-compose-v1.j2.yml
sed '17 a\ \ \ \ \ \ - /usr/bin/docker:/usr/bin/docker' -i /home/vagrant/ansible-container/container/templates/build-docker-compose.j2.yml
sed '18 a\ \ \ \ \ \ - /run/docker.sock:/var/run/docker.sock' -i /home/vagrant/ansible-container/container/templates/build-docker-compose.j2.yml
sed '19 a\ \ \ \ \ \ - /usr/lib/x86_64-linux-gnu/libapparmor.so.1.1.0:/lib/x86_64-linux-gnu/libapparmor.so.1' -i /home/vagrant/ansible-container/container/templates/build-docker-compose.j2.yml
sed '20 a\ \ \ \ \ \ - /lib/x86_64-linux-gnu/libsystemd-journal.so.0.10.2:/lib/x86_64-linux-gnu/libsystemd-journal.so.0' -i /home/vagrant/ansible-container/container/templates/build-docker-compose.j2.yml
sed '21 a\ \ \ \ \ \ - /lib/x86_64-linux-gnu/libcgmanager.so.0.0.0:/lib/x86_64-linux-gnu/libcgmanager.so.0' -i /home/vagrant/ansible-container/container/templates/build-docker-compose.j2.yml
sed '22 a\ \ \ \ \ \ - /lib/x86_64-linux-gnu/libnih.so.1.0.0:/lib/x86_64-linux-gnu/libnih.so.1' -i /home/vagrant/ansible-container/container/templates/build-docker-compose.j2.yml
sed '23 a\ \ \ \ \ \ - /lib/x86_64-linux-gnu/libnih-dbus.so.1.0.0:/lib/x86_64-linux-gnu/libnih-dbus.so.1' -i /home/vagrant/ansible-container/container/templates/build-docker-compose.j2.yml
sed '24 a\ \ \ \ \ \ - /lib/x86_64-linux-gnu/libdbus-1.so.3.7.6:/lib/x86_64-linux-gnu/libdbus-1.so.3' -i /home/vagrant/ansible-container/container/templates/build-docker-compose.j2.yml
sed '25 a\ \ \ \ \ \ - /lib/x86_64-linux-gnu/libgcrypt.so.11.8.2:/lib/x86_64-linux-gnu/libgcrypt.so.11' -i /home/vagrant/ansible-container/container/templates/build-docker-compose.j2.yml
sed '12 a\ \ \ \ - /usr/bin/docker:/usr/bin/docker' -i /home/vagrant/ansible-container/container/templates/build-docker-compose-v1.j2.yml
sed '13 a\ \ \ \ - /run/docker.sock:/var/run/docker.sock' -i /home/vagrant/ansible-container/container/templates/build-docker-compose-v1.j2.yml
sed '14 a\ \ \ \ - /usr/lib/x86_64-linux-gnu/libapparmor.so.1.1.0:/lib/x86_64-linux-gnu/libapparmor.so.1' -i /home/vagrant/ansible-container/container/templates/build-docker-compose-v1.j2.yml
sed '15 a\ \ \ \ - /lib/x86_64-linux-gnu/libsystemd-journal.so.0.10.2:/lib/x86_64-linux-gnu/libsystemd-journal.so.0' -i /home/vagrant/ansible-container/container/templates/build-docker-compose-v1.j2.yml
sed '16 a\ \ \ \ - /lib/x86_64-linux-gnu/libcgmanager.so.0.0.0:/lib/x86_64-linux-gnu/libcgmanager.so.0' -i /home/vagrant/ansible-container/container/templates/build-docker-compose-v1.j2.yml
sed '17 a\ \ \ \ - /lib/x86_64-linux-gnu/libnih.so.1.0.0:/lib/x86_64-linux-gnu/libnih.so.1' -i /home/vagrant/ansible-container/container/templates/build-docker-compose-v1.j2.yml
sed '18 a\ \ \ \ - /lib/x86_64-linux-gnu/libnih-dbus.so.1.0.0:/lib/x86_64-linux-gnu/libnih-dbus.so.1' -i /home/vagrant/ansible-container/container/templates/build-docker-compose-v1.j2.yml
sed '19 a\ \ \ \ - /lib/x86_64-linux-gnu/libdbus-1.so.3.7.6:/lib/x86_64-linux-gnu/libdbus-1.so.3' -i /home/vagrant/ansible-container/container/templates/build-docker-compose-v1.j2.yml
sed '20 a\ \ \ \ - /lib/x86_64-linux-gnu/libgcrypt.so.11.8.2:/lib/x86_64-linux-gnu/libgcrypt.so.11' -i /home/vagrant/ansible-container/container/templates/build-docker-compose-v1.j2.yml
sed '17 a\ \ \ \ \ \ - /usr/bin/docker:/usr/bin/docker' -i /home/vagrant/ansible-container/container/templates/listhosts-docker-compose.j2.yml
sed '18 a\ \ \ \ \ \ - /run/docker.sock:/var/run/docker.sock' -i /home/vagrant/ansible-container/container/templates/listhosts-docker-compose.j2.yml
sed '19 a\ \ \ \ \ \ - /usr/lib/x86_64-linux-gnu/libapparmor.so.1.1.0:/lib/x86_64-linux-gnu/libapparmor.so.1' -i /home/vagrant/ansible-container/container/templates/listhosts-docker-compose.j2.yml
sed '20 a\ \ \ \ \ \ - /lib/x86_64-linux-gnu/libsystemd-journal.so.0.10.2:/lib/x86_64-linux-gnu/libsystemd-journal.so.0' -i /home/vagrant/ansible-container/container/templates/listhosts-docker-compose.j2.yml
sed '21 a\ \ \ \ \ \ - /lib/x86_64-linux-gnu/libcgmanager.so.0.0.0:/lib/x86_64-linux-gnu/libcgmanager.so.0' -i /home/vagrant/ansible-container/container/templates/listhosts-docker-compose.j2.yml
sed '22 a\ \ \ \ \ \ - /lib/x86_64-linux-gnu/libnih.so.1.0.0:/lib/x86_64-linux-gnu/libnih.so.1' -i /home/vagrant/ansible-container/container/templates/listhosts-docker-compose.j2.yml
sed '23 a\ \ \ \ \ \ - /lib/x86_64-linux-gnu/libnih-dbus.so.1.0.0:/lib/x86_64-linux-gnu/libnih-dbus.so.1' -i /home/vagrant/ansible-container/container/templates/listhosts-docker-compose.j2.yml
sed '24 a\ \ \ \ \ \ - /lib/x86_64-linux-gnu/libdbus-1.so.3.7.6:/lib/x86_64-linux-gnu/libdbus-1.so.3' -i /home/vagrant/ansible-container/container/templates/listhosts-docker-compose.j2.yml
sed '25 a\ \ \ \ \ \ - /lib/x86_64-linux-gnu/libgcrypt.so.11.8.2:/lib/x86_64-linux-gnu/libgcrypt.so.11' -i /home/vagrant/ansible-container/container/templates/listhosts-docker-compose.j2.yml
sed '12 a\ \ \ \ - /usr/bin/docker:/usr/bin/docker' -i /home/vagrant/ansible-container/container/templates/listhosts-docker-compose-v1.j2.yml
sed '13 a\ \ \ \ - /run/docker.sock:/var/run/docker.sock' -i /home/vagrant/ansible-container/container/templates/listhosts-docker-compose-v1.j2.yml
sed '14 a\ \ \ \ - /usr/lib/x86_64-linux-gnu/libapparmor.so.1.1.0:/lib/x86_64-linux-gnu/libapparmor.so.1' -i /home/vagrant/ansible-container/container/templates/listhosts-docker-compose-v1.j2.yml
sed '15 a\ \ \ \ - /lib/x86_64-linux-gnu/libsystemd-journal.so.0.10.2:/lib/x86_64-linux-gnu/libsystemd-journal.so.0' -i /home/vagrant/ansible-container/container/templates/listhosts-docker-compose-v1.j2.yml
sed '16 a\ \ \ \ - /lib/x86_64-linux-gnu/libcgmanager.so.0.0.0:/lib/x86_64-linux-gnu/libcgmanager.so.0' -i /home/vagrant/ansible-container/container/templates/listhosts-docker-compose-v1.j2.yml
sed '17 a\ \ \ \ - /lib/x86_64-linux-gnu/libnih.so.1.0.0:/lib/x86_64-linux-gnu/libnih.so.1' -i /home/vagrant/ansible-container/container/templates/listhosts-docker-compose-v1.j2.yml
sed '18 a\ \ \ \ - /lib/x86_64-linux-gnu/libnih-dbus.so.1.0.0:/lib/x86_64-linux-gnu/libnih-dbus.so.1' -i /home/vagrant/ansible-container/container/templates/listhosts-docker-compose-v1.j2.yml
sed '19 a\ \ \ \ - /lib/x86_64-linux-gnu/libdbus-1.so.3.7.6:/lib/x86_64-linux-gnu/libdbus-1.so.3' -i /home/vagrant/ansible-container/container/templates/listhosts-docker-compose-v1.j2.yml
sed '20 a\ \ \ \ - /lib/x86_64-linux-gnu/libgcrypt.so.11.8.2:/lib/x86_64-linux-gnu/libgcrypt.so.11' -i /home/vagrant/ansible-container/container/templates/listhosts-docker-compose-v1.j2.yml
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "bento/ubuntu-14.04"
config.vm.provision "shell" do |s|
s.path = "provision.sh"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.