chore: Configure argo workflows permissions
This commit is contained in:
@ -5,12 +5,42 @@
|
||||
- vars/pb.secrets.yaml
|
||||
tasks:
|
||||
|
||||
- name: Retrieve target folder details
|
||||
community.vmware.vmware_vm_info:
|
||||
hostname: "{{ hv.hostname }}"
|
||||
username: "{{ hv.username }}"
|
||||
password: "{{ secrets.hv.password }}"
|
||||
folder: "{{ hv.folder }}"
|
||||
validate_certs: false
|
||||
register: vm_info
|
||||
|
||||
- name: User prompt
|
||||
ansible.builtin.pause:
|
||||
prompt: Virtual machine '{{ appliance.id }}' already exists. Delete to continue [yes] or abort [no]?"
|
||||
register: prompt
|
||||
until:
|
||||
- prompt.user_input in ['yes', 'no']
|
||||
delay: 0
|
||||
when: (vm_info | selectattr('guest_name', 'equalto', appliance.id) | length) > 0
|
||||
|
||||
- name: Destroy existing VM
|
||||
community.vmware.vmware_guest:
|
||||
hostname: "{{ hv.hostname }}"
|
||||
username: "{{ hv.username }}"
|
||||
password: "{{ secrets.hv.password }}"
|
||||
folder: "{{ hv.folder }}"
|
||||
name: appliance.id
|
||||
state: absent
|
||||
when:
|
||||
- (vm_info | selectattr('guest_name', 'equalto', appliance.id) | length) > 0
|
||||
- (prompt.user_input | bool) == true
|
||||
|
||||
- name: Deploy VM from OVA-template
|
||||
community.vmware.vmware_deploy_ovf:
|
||||
hostname: "{{ hv.hostname }}"
|
||||
username: "{{ hv.username }}"
|
||||
password: "{{ secrets.hv.password }}"
|
||||
validate_certs: no
|
||||
validate_certs: false
|
||||
datacenter: "{{ hv.datacenter }}"
|
||||
folder: "{{ hv.folder }}"
|
||||
cluster: "{{ hv.cluster }}"
|
||||
|
Reference in New Issue
Block a user