Move uninstall tasks to its own file

This cleans up the main tasks file.
This commit is contained in:
Juan Antonio Osorio Robles 2017-11-30 06:41:06 +00:00
parent 67e7142a94
commit 27999d407e
2 changed files with 29 additions and 27 deletions

View File

@ -1,33 +1,7 @@
---
- when: ipsec_uninstall_tunnels|bool or ipsec_upgrade_tunnels|bool
block:
- name: Find tunnel configurations to delete
find:
paths: /etc/ipsec.d/
patterns: overcloud-*
register: configs_to_delete
- name: Remove tunnel configurations
file:
path: "{{ item.path }}"
state: absent
with_items: "{{ configs_to_delete.files }}"
notify:
- Restart ipsec
- name: Find policy configurations to delete
find:
paths: /etc/ipsec.d/policies/
patterns: overcloud-*
register: policies_to_delete
- name: Remove tunnel configurations
file:
path: "{{ item.path }}"
state: absent
with_items: "{{ policies_to_delete.files }}"
notify:
- Restart ipsec
- include: uninstall.yml
- when: not ipsec_uninstall_tunnels|bool or ipsec_upgrade_tunnels|bool
block:

28
tasks/uninstall.yml Normal file
View File

@ -0,0 +1,28 @@
---
- name: Find tunnel configurations to delete
find:
paths: /etc/ipsec.d/
patterns: overcloud-*
register: configs_to_delete
- name: Remove tunnel configurations
file:
path: "{{ item.path }}"
state: absent
with_items: "{{ configs_to_delete.files }}"
notify:
- Restart ipsec
- name: Find policy configurations to delete
find:
paths: /etc/ipsec.d/policies/
patterns: overcloud-*
register: policies_to_delete
- name: Remove tunnel configurations
file:
path: "{{ item.path }}"
state: absent
with_items: "{{ policies_to_delete.files }}"
notify:
- Restart ipsec