From ab9c581a4bc1185218d07f1866da9eb054d3cb60 Mon Sep 17 00:00:00 2001 From: Phillip Thurston Date: Thu, 3 Aug 2017 21:12:14 -0600 Subject: [PATCH] Added variable to selectivley skip entire role if needed. --- defaults/main.yml | 1 + tasks/main.yml | 3 +++ 2 files changed, 4 insertions(+) diff --git a/defaults/main.yml b/defaults/main.yml index 65fb26a..b6ee17b 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -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 diff --git a/tasks/main.yml b/tasks/main.yml index eac32d8..861c0d6 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,15 +1,18 @@ --- - name: OS specific setup include: 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