diff --git a/molecule/centos7/destroy.yml b/molecule/centos7/destroy.yml index 0037b35..379145b 100644 --- a/molecule/centos7/destroy.yml +++ b/molecule/centos7/destroy.yml @@ -5,10 +5,14 @@ gather_facts: false no_log: "{{ molecule_no_log }}" tasks: + - name: Check existing instance config file + stat: + path: "{{ molecule_instance_config }}" + register: cfg + - name: Populate the instance config set_fact: - instance_conf_file: "{{ lookup('file', molecule_instance_config, errors='ignore') | from_yaml }}" - instance_conf: "{{ instance_conf_file | default([]) }}" + instance_conf: "{{ (lookup('file', molecule_instance_config) | molecule_from_yaml) if cfg.stat.exists else [] }}" - name: Destroy molecule instance(s) hcloud_server: diff --git a/molecule/centos8/destroy.yml b/molecule/centos8/destroy.yml index 0037b35..379145b 100644 --- a/molecule/centos8/destroy.yml +++ b/molecule/centos8/destroy.yml @@ -5,10 +5,14 @@ gather_facts: false no_log: "{{ molecule_no_log }}" tasks: + - name: Check existing instance config file + stat: + path: "{{ molecule_instance_config }}" + register: cfg + - name: Populate the instance config set_fact: - instance_conf_file: "{{ lookup('file', molecule_instance_config, errors='ignore') | from_yaml }}" - instance_conf: "{{ instance_conf_file | default([]) }}" + instance_conf: "{{ (lookup('file', molecule_instance_config) | molecule_from_yaml) if cfg.stat.exists else [] }}" - name: Destroy molecule instance(s) hcloud_server: diff --git a/molecule/requirements.yml b/molecule/requirements.yml index 280de95..dbb6681 100644 --- a/molecule/requirements.yml +++ b/molecule/requirements.yml @@ -1,4 +1,5 @@ --- -collections: - - name: https://gitea.rknet.org/ansible/xoxys.general/releases/download/v1.2.0/xoxys-general-1.2.0.tar.gz - - name: community.general +collections: [] +#collections: +# - name: https://gitea.rknet.org/ansible/xoxys.general/releases/download/v1.2.0/xoxys-general-1.2.0.tar.gz +# - name: community.general