This commit is contained in:
Phillip Thurston 2017-08-17 20:39:12 +00:00 committed by GitHub
commit 3ec09fe4bf
3 changed files with 20 additions and 5 deletions

View File

@ -1,5 +1,6 @@
---
# Edition can be one of: 'ce' (Community Edition) or 'ee' (Enterprise Edition).
docker_install: true
docker_edition: 'ce'
docker_package: "docker-{{ docker_edition }}"
docker_package_state: present

View File

@ -1,18 +1,18 @@
---
- include: setup-RedHat.yml
when: ansible_os_family == 'RedHat'
- include: setup-Debian.yml
when: ansible_os_family == 'Debian'
- name: OS specific setup
include: "setup-{{ ansible_os_family }}.yml"
when: docker_install
- name: Install Docker.
package: name={{ docker_package }} state={{ docker_package_state }}
when: docker_install
- name: Ensure Docker is started and enabled at boot.
service:
name: docker
state: started
enabled: yes
when: docker_install
- include: docker-compose.yml
when: docker_install_compose

View File

@ -15,6 +15,20 @@
- apt-transport-https
- ca-certificates
- name: Get Kernel release
command: uname -r
register: docker_kernel_release
when: ansible_distribution == "Ubuntu" and ansible_distribution_release == "trusty"
- name: Ensure Trusty packages are installed
apt:
name: "{{ item }}"
state: present
with_items:
- "linux-image-extra-{{ docker_kernel_release }}"
- linux-image-extra-virtual
when: ansible_distribution == "Ubuntu" and ansible_distribution_release == "trusty"
- name: Add Docker apt key.
apt_key:
url: https://download.docker.com/linux/ubuntu/gpg