switch to native filters instead of molecule internals
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Robert Kaussow 2020-10-18 23:33:44 +02:00
parent c15eb0a329
commit f3e5234405
No known key found for this signature in database
GPG Key ID: 65362AE74AF98B61
3 changed files with 11 additions and 4 deletions

View File

@ -100,7 +100,10 @@
- name: Dump instance config - name: Dump instance config
copy: copy:
content: "{{ instance_conf | to_json | from_json | molecule_to_yaml | molecule_header }}" content: |
# Molecule managed
{{ instance_conf | to_json | from_json | to_yaml }}
dest: "{{ molecule_instance_config }}" dest: "{{ molecule_instance_config }}"
when: server.changed | bool when: server.changed | bool
@ -110,7 +113,7 @@
host: "{{ item.address }}" host: "{{ item.address }}"
search_regex: SSH search_regex: SSH
delay: 10 delay: 10
loop: "{{ lookup('file', molecule_instance_config) | molecule_from_yaml }}" loop: "{{ lookup('file', molecule_instance_config) | from_yaml }}"
- name: Wait for VM to settle down - name: Wait for VM to settle down
pause: pause:

View File

@ -12,7 +12,7 @@
- name: Populate the instance config - name: Populate the instance config
set_fact: set_fact:
instance_conf: "{{ (lookup('file', molecule_instance_config) | molecule_from_yaml) if cfg.stat.exists else [] }}" instance_conf: "{{ (lookup('file', molecule_instance_config) | from_yaml) if cfg.stat.exists else [] }}"
- name: Destroy molecule instance(s) - name: Destroy molecule instance(s)
hcloud_server: hcloud_server:
@ -70,6 +70,9 @@
- name: Dump instance config - name: Dump instance config
copy: copy:
content: "{{ instance_conf | molecule_to_yaml | molecule_header }}" content: |
# Molecule managed
{{ instance_conf | to_json | from_json | to_yaml }}
dest: "{{ molecule_instance_config }}" dest: "{{ molecule_instance_config }}"
when: server.changed | bool when: server.changed | bool

View File

@ -17,5 +17,6 @@ provisioner:
env: env:
ANSIBLE_FILTER_PLUGINS: ${ANSIBLE_FILTER_PLUGINS:-./plugins/filter} ANSIBLE_FILTER_PLUGINS: ${ANSIBLE_FILTER_PLUGINS:-./plugins/filter}
ANSIBLE_LIBRARY: ${ANSIBLE_LIBRARY:-./library} ANSIBLE_LIBRARY: ${ANSIBLE_LIBRARY:-./library}
ANSIBLE_GALAXY_DISPLAY_PROGRESS: False
verifier: verifier:
name: testinfra name: testinfra