Skip to content
This repository was archived by the owner on Nov 12, 2020. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 28 additions & 1 deletion molecule/default/converge.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,39 @@
---
- name: Playbook for role testing
- name: Playbook for role testing (hosts_type = block)
hosts: all

vars:
hosts_group_name: ungrouped
hosts_additional_entries:
testing.osism.xyz: 127.0.1.1
foobar.osism.xyz: 127.0.1.2
hosts_type: block

roles:
- role: ansible-hosts

- name: Playbook for role testing (hosts_type = local)
hosts: all

vars:
hosts_group_name: ungrouped
hosts_additional_entries:
testing.osism.xyz: 127.0.1.1
foobar.osism.xyz: 127.0.1.2
hosts_type: local

roles:
- role: ansible-hosts

- name: Playbook for role testing (hosts_type = template)
hosts: all

vars:
hosts_group_name: ungrouped
hosts_additional_entries:
testing.osism.xyz: 127.0.1.1
foobar.osism.xyz: 127.0.1.2
hosts_type: template

roles:
- role: ansible-hosts
4 changes: 4 additions & 0 deletions tasks/type-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@
register: hosts_tempfile
delegate_to: localhost
run_once: true
tags: molecule-idempotence-notest

- name: Generate temporary /etc/hosts file
template:
src: "hosts-template.j2"
dest: "{{ hosts_tempfile.path }}"
delegate_to: localhost
run_once: true
tags: molecule-idempotence-notest

- name: Copy /etc/hosts file
copy:
Expand All @@ -23,10 +25,12 @@
mode: 0644
backup: "{{ hosts_file_backup }}"
become: true
tags: molecule-idempotence-notest

- name: Delete temporary file
file:
path: "{{ hosts_tempfile.path }}"
state: absent
delegate_to: localhost
run_once: true
tags: molecule-idempotence-notest