Added variable to selectivley skip entire role if needed.

This commit is contained in:
Phillip Thurston 2017-08-03 21:12:14 -06:00
parent 98ae233269
commit ab9c581a4b
2 changed files with 4 additions and 0 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,15 +1,18 @@
--- ---
- name: OS specific setup - name: OS specific setup
include: include: "setup-{{ ansible_os_family }}.yml" include: include: "setup-{{ ansible_os_family }}.yml"
when: docker_install
- 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