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). # Edition can be one of: 'ce' (Community Edition) or 'ee' (Enterprise Edition).
docker_install: true
docker_edition: 'ce' docker_edition: 'ce'
docker_package: "docker-{{ docker_edition }}" docker_package: "docker-{{ docker_edition }}"
docker_package_state: present docker_package_state: present

View File

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

View File

@ -15,6 +15,20 @@
- apt-transport-https - apt-transport-https
- ca-certificates - 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. - name: Add Docker apt key.
apt_key: apt_key:
url: https://download.docker.com/linux/ubuntu/gpg url: https://download.docker.com/linux/ubuntu/gpg