-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
48 additions
and
4 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,60 @@ | ||
--- | ||
|
||
- name: Install docker utils | ||
- name: Install docker requirements | ||
apt: | ||
pkg: '{{ item }}' | ||
state: present | ||
with_items: | ||
- curl | ||
- aufs-tools | ||
- apt-transport-https | ||
|
||
- name: Install docker | ||
- name: Uninstall old Docker versions | ||
apt: | ||
name: "{{ item }}" | ||
state: absent | ||
with_items: | ||
- docker | ||
- docker-engine | ||
- docker.io | ||
|
||
- name: Add Docker repository key | ||
apt_key: | ||
id: "9DC858229FC7DD38854AE2D88D81803C0EBFCD88" | ||
keyserver: "https://download.docker.com/linux/ubuntu/gpg" | ||
state: present | ||
register: add_repository_key | ||
ignore_errors: true | ||
|
||
- name: Alternative | Add Docker repository key | ||
shell: "curl -sSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -" | ||
when: add_repository_key|failed | ||
|
||
- name: Add Docker repository | ||
apt_repository: | ||
repo: "deb [arch=amd64] https://download.docker.com/linux/{{ ansible_lsb.id|lower }} {{ ansible_lsb.codename|lower }} stable" | ||
update_cache: yes | ||
state: present | ||
|
||
- name: Install Docker CE | ||
apt: | ||
pkg: '{{ item }}' | ||
state: latest | ||
with_items: | ||
- docker-engine | ||
- docker-ce | ||
|
||
- name: Deploy docker.service (template) | ||
template: | ||
src: templates/docker.service.j2 | ||
dest: /etc/systemd/system/docker.service | ||
owner: vagrant | ||
group: root | ||
mode: 0775 | ||
|
||
- name: Restart Docker | ||
command: '{{ item }}' | ||
with_items: | ||
- systemctl daemon-reload | ||
- systemctl enable docker | ||
- systemctl restart docker | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
[Service] | ||
ExecStart= | ||
ExecStart=/usr/bin/docker daemon -H unix:///var/run/docker.sock -H tcp://{{ VM.network.private.address }}:2375 {{ DOCKER.opts }} | ||
ExecStart=/usr/bin/dockerd -H unix:///var/run/docker.sock -H tcp://{{ VM.network.private.address }}:2375 {{ DOCKER.opts }} |