-
Notifications
You must be signed in to change notification settings - Fork 0
/
delete_all.yaml
46 lines (41 loc) · 1.4 KB
/
delete_all.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
---
- name: Playbook to kick off a mass migration from vmware to ocp-virt
hosts: localhost
collections:
- rlopez.ocp_virt
# roles:
# - {role: rlopez.ocp_virt.validation}
# - {role: rlopez.ocp_virt.providers}
# - {role: rlopez.ocp_virt.virt_plan}
vars:
delete_plans: false
provision_data_file: "{{ playbook_dir }}/provision_data.yaml"
tasks:
- name: Load in provision data
ansible.builtin.include_vars:
file: "{{ provision_data_file }}"
- name: Debug provision data
ansible.builtin.debug:
msg: "{{ provision_data }}"
- block:
- name: Loop over users, including the tasks
vars:
_user_name: "{{ _user.value.user }}"
_user_password: "{{ _user.value.password }}"
ansible.builtin.include_tasks:
file: delete_migration.yaml
loop: "{{ provision_data.users | dict2items }}"
loop_control:
loop_var: _user
label: "{{ _user.key }}"
# - name: Get all migration toolkit for virtualization plans that are status.condition.type == "Archived"
# kubernetes.core.k8s:
# namespace: "mtv-{{ _user_name }}"
# kind: Plan
# api_version: forklift.konveyor.io/v1beta1
# field_selectors:
# - status.type=Archived
#
- name: Stop execution of this playbook
ansible.builtin.fail:
msg: "Stop right there!"