From 91dc2da30142073042bfa0a0ee04b72701f003b8 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Fri, 12 May 2017 19:33:57 +0200 Subject: [PATCH] library/roles/ubuntugis/tasks/main.yml: Give the possibility to remove the ubuntugis repo. --- ubuntugis/tasks/main.yml | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/ubuntugis/tasks/main.yml b/ubuntugis/tasks/main.yml index e41360c1..ca67603a 100644 --- a/ubuntugis/tasks/main.yml +++ b/ubuntugis/tasks/main.yml @@ -1,9 +1,19 @@ --- -- name: Add the ansible ppa for ansible - apt_repository: repo='{{ ubuntugis_repo }}' update_cache=yes - tags: ubuntugis +- block: + - name: Add the ubuntugis repository + apt_repository: repo='{{ ubuntugis_repo }}' update_cache=yes + + - name: Install the ansible package + apt: pkg={{ item }} state={{ ubuntugis_pkg_state }} update_cache=yes cache_valid_time=1800 + with_items: '{{ ubuntugis_packages }}' -- name: Install the ansible package - apt: pkg={{ item }} state={{ ubuntugis_pkg_state }} update_cache=yes cache_valid_time=1800 - with_items: '{{ ubuntugis_packages }}' tags: ubuntugis + when: ubuntugis_repo_install + +- block: + - name: Remove the ubuntugis repository + apt_repository: repo='{{ ubuntugis_repo }}' update_cache=yes state=absent + + tags: ubuntugis + when: not ubuntugis_repo_install +