publik-devinst/tasks/delete_tenants.yml

23 lines
544 B
YAML

- name: "Delete {{app}} main tenants"
command: "{{delete_tenant_cmd}} {{item}}"
ignore_errors: yes
loop: "{{tenants}}"
when: not delete_all_tenants
- name: "Find all {{app}} tenants"
ansible.builtin.find:
paths: "{{tenant_dir}}"
recurse: no
file_type: directory
use_regex: true
excludes: '.*\.invalid$'
register: all_tenants
when: delete_all_tenants
- name: "Delete all {{app}} tenants"
command: "{{delete_tenant_cmd}} {{item.path | basename}}"
loop: "{{all_tenants.files}}"
when: delete_all_tenants