-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Boris Glimcher <[email protected]>
- Loading branch information
Showing
4 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
- name: Converge | ||
hosts: all | ||
gather_facts: false | ||
tasks: | ||
- name: Replace this task with one that validates your content | ||
ansible.builtin.debug: | ||
msg: "This is the effective test" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
- name: Create | ||
hosts: localhost | ||
connection: local | ||
gather_facts: false | ||
# no_log: "{{ molecule_no_log }}" | ||
tasks: | ||
# TODO: Developer must implement and populate 'server' variable | ||
|
||
- name: Create instance config | ||
when: server.changed | default(false) | bool # noqa no-handler | ||
block: | ||
- name: Populate instance config dict # noqa jinja | ||
ansible.builtin.set_fact: | ||
instance_conf_dict: {} | ||
# instance': "{{ }}", | ||
# address': "{{ }}", | ||
# user': "{{ }}", | ||
# port': "{{ }}", | ||
# 'identity_file': "{{ }}", } | ||
with_items: "{{ server.results }}" | ||
register: instance_config_dict | ||
|
||
- name: Convert instance config dict to a list | ||
ansible.builtin.set_fact: | ||
instance_conf: "{{ instance_config_dict.results | map(attribute='ansible_facts.instance_conf_dict') | list }}" | ||
|
||
- name: Dump instance config | ||
ansible.builtin.copy: | ||
content: | | ||
# Molecule managed | ||
{{ instance_conf | to_json | from_json | to_yaml }} | ||
dest: "{{ molecule_instance_config }}" | ||
mode: "0600" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
- name: Destroy | ||
hosts: localhost | ||
connection: local | ||
gather_facts: false | ||
# no_log: "{{ molecule_no_log }}" | ||
tasks: | ||
# Developer must implement. | ||
|
||
# Mandatory configuration for Molecule to function. | ||
|
||
- name: Populate instance config | ||
ansible.builtin.set_fact: | ||
instance_conf: {} | ||
|
||
- name: Dump instance config | ||
ansible.builtin.copy: | ||
content: | | ||
# Molecule managed | ||
{{ instance_conf | to_json | from_json | to_yaml }} | ||
dest: "{{ molecule_instance_config }}" | ||
mode: "0600" | ||
when: server.changed | default(false) | bool # noqa no-handler |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
platforms: | ||
- name: instance | ||
# you might want to add your own variables here based on what provisioning | ||
# you are doing like: | ||
# image: quay.io/centos/centos:stream8 |