fix molecule destroy playbook
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
14ad88693d
commit
3341c6542b
@ -5,10 +5,14 @@
|
|||||||
gather_facts: false
|
gather_facts: false
|
||||||
no_log: "{{ molecule_no_log }}"
|
no_log: "{{ molecule_no_log }}"
|
||||||
tasks:
|
tasks:
|
||||||
|
- name: Check existing instance config file
|
||||||
|
stat:
|
||||||
|
path: "{{ molecule_instance_config }}"
|
||||||
|
register: cfg
|
||||||
|
|
||||||
- name: Populate the instance config
|
- name: Populate the instance config
|
||||||
set_fact:
|
set_fact:
|
||||||
instance_conf_file: "{{ lookup('file', molecule_instance_config, errors='ignore') | from_yaml }}"
|
instance_conf: "{{ (lookup('file', molecule_instance_config) | molecule_from_yaml) if cfg.stat.exists else [] }}"
|
||||||
instance_conf: "{{ instance_conf_file | default([]) }}"
|
|
||||||
|
|
||||||
- name: Destroy molecule instance(s)
|
- name: Destroy molecule instance(s)
|
||||||
hcloud_server:
|
hcloud_server:
|
||||||
@ -28,6 +32,9 @@
|
|||||||
retries: 300
|
retries: 300
|
||||||
loop: "{{ server.results }}"
|
loop: "{{ server.results }}"
|
||||||
|
|
||||||
|
- pause:
|
||||||
|
seconds: 5
|
||||||
|
|
||||||
- name: Destroy volume(s)
|
- name: Destroy volume(s)
|
||||||
hcloud_volume:
|
hcloud_volume:
|
||||||
name: "{{ item.instance }}"
|
name: "{{ item.instance }}"
|
||||||
|
Loading…
Reference in New Issue
Block a user