Merge branch 'master' into debian-apt-amd64

master
Alexander Thomas 2018-05-02 16:38:11 +02:00 committed by GitHub
commit 377a6f3728
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 29 additions and 11 deletions

View File

@ -5,7 +5,8 @@ env:
- distro: centos7
- distro: ubuntu1604
- distro: ubuntu1404
- distro: debian8
- distro: debian9
- distro: fedora27
script:
# Configure test script so we can run extra tests after playbook is run.

View File

@ -19,8 +19,12 @@ Available variables are listed below, along with default values (see `defaults/m
The `docker_edition` should be either `ce` (Community Edition) or `ee` (Enterprise Edition). You can also specify a specific version of Docker to install using a format like `docker-{{ docker_edition }}-<VERSION>`. And you can control whether the package is installed, uninstalled, or at the latest version by setting `docker_package_state` to `present`, `absent`, or `latest`, respectively.
docker_install_compose: true
docker_compose_version: "1.16.1"
docker_restart_on_package_change: True
Whether to restart the Docker daemon after the Docker package is installed or updated. If this is set to `True`, this role will flush all handlers (run any of the handlers that have been notified by this and any other role up to this point in the play). The default setting helps avoid firewall clashes with Docker rules (e.g. when using custom `iptables` rules or the `geerlingguy.firewall` Ansible role).
docker_install_compose: True
docker_compose_version: "1.21.1"
docker_compose_path: /usr/local/bin/docker-compose
Docker Compose installation options.
@ -28,6 +32,7 @@ Docker Compose installation options.
docker_apt_arch: amd64
docker_apt_release_channel: stable
docker_apt_repository: "deb [arch={{ docker_apt_arch }}] https://download.docker.com/linux/{{ ansible_distribution|lower }} {{ ansible_distribution_release }} {{ docker_apt_release_channel }}"
docker_apt_ignore_key_error: True
(Used only for Debian/Ubuntu.) You can switch the channel to `edge` if you want to use the Edge release.

View File

@ -3,10 +3,11 @@
docker_edition: 'ce'
docker_package: "docker-{{ docker_edition }}"
docker_package_state: present
docker_restart_on_package_change: True
# Docker Compose options.
docker_install_compose: true
docker_compose_version: "1.16.1"
docker_install_compose: True
docker_compose_version: "1.21.1"
docker_compose_path: /usr/local/bin/docker-compose
# Used only for Debian/Ubuntu. Switch 'stable' to 'edge' if needed.
@ -14,8 +15,9 @@ docker_apt_release_channel: stable
# Architecture must be specified in order for updates to work. Choose between 'amd64' & 'i386'.
docker_apt_arch: amd64
docker_apt_repository: "deb [arch={{ docker_apt_arch }}] https://download.docker.com/linux/{{ ansible_distribution|lower }} {{ ansible_distribution_release }} {{ docker_apt_release_channel }}"
docker_apt_ignore_key_error: True
# Used only for RedHat/CentOS.
docker_yum_repo_url: https://download.docker.com/linux/centos/docker-{{ docker_edition }}.repo
# Used only for RedHat/CentOS/Fedora.
docker_yum_repo_url: https://download.docker.com/linux/{{ (ansible_distribution == "Fedora") | ternary("fedora","centos") }}/docker-{{ docker_edition }}.repo
docker_yum_repo_enable_edge: 0
docker_yum_repo_enable_test: 0

View File

@ -6,12 +6,15 @@ galaxy_info:
description: Docker for Linux.
company: "Midwestern Mac, LLC"
license: "license (BSD, MIT)"
min_ansible_version: 2.0
min_ansible_version: 2.4
platforms:
- name: EL
versions:
- 6
- 7
- name: Fedora
versions:
- all
- name: Debian
versions:
- jessie

View File

@ -6,7 +6,10 @@
when: ansible_os_family == 'Debian'
- name: Install Docker.
package: name={{ docker_package }} state={{ docker_package_state }}
package:
name: "{{ docker_package }}"
state: "{{ docker_package_state }}"
notify: restart docker
- name: Ensure Docker is started and enabled at boot.
service:
@ -14,5 +17,9 @@
state: started
enabled: yes
- name: Ensure handlers are notified now to avoid firewall conflicts.
meta: flush_handlers
when: docker_restart_on_package_change
- include_tasks: docker-compose.yml
when: docker_install_compose

View File

@ -7,7 +7,7 @@
- docker
- docker-engine
- name: Ensure depdencies are installed.
- name: Ensure dependencies are installed.
apt:
name: "{{ item }}"
state: present
@ -21,7 +21,7 @@
id: 9DC858229FC7DD38854AE2D88D81803C0EBFCD88
state: present
register: add_repository_key
ignore_errors: true
ignore_errors: "{{ docker_apt_ignore_key_error }}"
- name: Ensure curl is present (on older systems without SNI).
package: name=curl state=present