Add possibility to create networks
This commit is contained in:
committed by
decentral1se
parent
3617624623
commit
6c4c20baa6
@ -56,6 +56,25 @@
|
||||
when: volumes.changed
|
||||
with_items: "{{ volumes.results }}"
|
||||
|
||||
- name: Destroy network(s)
|
||||
hcloud_network:
|
||||
name: "{{ item.1.name }}"
|
||||
api_token: "{{ lookup('env', 'HCLOUD_TOKEN') }}"
|
||||
state: absent
|
||||
register: networks
|
||||
loop: "{{ instance_conf|subelements('networks', skip_missing=True) }}"
|
||||
async: 7200
|
||||
poll: 0
|
||||
|
||||
- name: Wait for network(s) deletion to complete
|
||||
async_status:
|
||||
jid: "{{ item.ansible_job_id }}"
|
||||
register: hetzner_networks
|
||||
until: hetzner_networks.finished
|
||||
retries: 300
|
||||
when: networks.changed
|
||||
with_items: "{{ networks.results }}"
|
||||
|
||||
- name: Remove registered SSH key
|
||||
hcloud_ssh_key:
|
||||
name: "{{ instance_conf[0].ssh_key_name }}"
|
||||
|
||||
Reference in New Issue
Block a user