-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use a template to generate docker.list #3
base: master
Are you sure you want to change the base?
Changes from 9 commits
9575f45
4c1b443
af49150
56b29fb
c931eb2
bc45209
b99008f
e987995
596f7ee
f523b9c
b46c9e1
028690f
da1c96b
60f56c1
15937cb
57cf208
44ed971
b9ee360
5c98925
85a841a
7505e3b
498fc8e
3737bf1
58218fe
9f925de
95edfc8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.vagrant/ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# -*- mode: ruby -*- | ||
# vi: set ft=ruby : | ||
|
||
Vagrant.configure("2") do |config| | ||
config.ssh.forward_agent = true | ||
config.vm.synced_folder Dir.getwd, "/home/vagrant/roles/ansible-docker", nfs: true | ||
|
||
# ubuntu 12.04 that Travis CI is using | ||
config.vm.define 'travis', primary: true do |c| | ||
c.vm.network "private_network", ip: "192.168.100.2" | ||
c.vm.box = "precise-server-cloudimg-amd64-vagrant-disk1" | ||
c.vm.box_url = "https://cloud-images.ubuntu.com/vagrant/precise/current/precise-server-cloudimg-amd64-vagrant-disk1.box" | ||
c.vm.provision "shell" do |s| | ||
s.inline = "apt-get update -y; apt-get install python-software-properties; add-apt-repository ppa:rquillo/ansible; apt-get update -y; apt-get install ansible -y; cd /home/vagrant/roles/ansible-docker/tests; ansible-playbook -i inventory playbook.yml" | ||
s.privileged = true | ||
end | ||
end | ||
|
||
# ubuntu 14.04 | ||
config.vm.define 'ubuntu', primary: true do |c| | ||
c.vm.network "private_network", ip: "192.168.100.3" | ||
c.vm.box = "trusty-server-cloudimg-amd64-vagrant-disk1" | ||
c.vm.box_url = "https://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box" | ||
c.vm.provision "shell" do |s| | ||
s.inline = "apt-get update -y; apt-get install -y software-properties-common; apt-add-repository ppa:ansible/ansible; apt-get update -y; apt-get install -y ansible; cd /home/vagrant/roles/ansible-docker/tests; ansible-playbook -i inventory playbook.yml" | ||
s.privileged = true | ||
end | ||
end | ||
|
||
# centos 6: | ||
config.vm.define 'centos' do |c| | ||
c.vm.network "private_network", ip: "192.168.100.4" | ||
c.vm.box = "centos65-x86_64-20140116" | ||
c.vm.box_url = "https://github.com/2creatives/vagrant-centos/releases/download/v6.5.3/centos65-x86_64-20140116.box" | ||
c.vm.provision "shell" do |s| | ||
s.inline = "yum update gmp; yum install ansible -y; cd /home/vagrant/roles/ansible-docker/tests; ansible-playbook -i inventory playbook.yml" | ||
s.privileged = true | ||
end | ||
end | ||
|
||
# centos 7: | ||
config.vm.define 'centos7' do |c| | ||
c.vm.network "private_network", ip: "192.168.100.5" | ||
c.vm.box = "centos/7" | ||
c.vm.provision "shell" do |s| | ||
s.inline = "yum install -y epel-release; yum install -y ansible; cd /home/vagrant/roles/ansible-docker/tests; ansible-playbook -i inventory playbook.yml" | ||
s.privileged = true | ||
end | ||
end | ||
|
||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
|
||
- name: Install Docker Repository | ||
template: src=docker-repo.j2 dest=/etc/yum.repos.d/docker.repo | ||
|
||
- name: Install Docker Engine | ||
yum: name=docker-engine state=present | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
# Generated by Ansible for {{ansible_fqdn}} | ||
|
||
DOCKER_OPTS={{docker_opts}} | ||
DOCKER_OPTS="{{docker_opts}}" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
# Generated by Ansible for {{ansible_fqdn}} | ||
description "Docker daemon" | ||
|
||
start on filesystem and started lxc-net | ||
stop on runlevel [!2345] | ||
start on stopped rc RUNLEVEL=[2345] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't understand what that change does, can you please explain ? |
||
|
||
respawn | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[local] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is already an |
||
localhost |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
|
||
- hosts: localhost | ||
connection: local | ||
sudo: yes | ||
|
||
tasks: | ||
- name: Wait for Docker to be up | ||
wait_for: path=/var/run/docker.sock state=started delay=3 timeout=5 | ||
|
||
- name: Test that Docker can run hello-world | ||
command: docker run --rm hello-world | ||
register: status | ||
failed_when: status.rc != 0 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
# | ||
# Test Playbook | ||
# | ||
|
||
- hosts: localhost | ||
connection: local | ||
sudo: yes | ||
|
||
roles: | ||
- {role: ../../} | ||
|
||
- include: main.yml | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This action and the next one can be merge together.