This repository has been archived by the owner on Jan 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix an issue that errors have been occurring by ansible lint 5 (#21)
- Loading branch information
Showing
5 changed files
with
69 additions
and
61 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
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
45 changes: 45 additions & 0 deletions
45
...tter/{{cookiecutter.molecule_directory}}/{{cookiecutter.scenario_name}}/handlers/main.yml
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,45 @@ | ||
--- | ||
{% raw -%} | ||
- name: Populate instance config dict for linux | ||
set_fact: | ||
instance_conf_dict: { | ||
'instance': "{{ instance_info.item.item.name }}", | ||
'address': "{{ instance_info.instance.ipv4 }}", | ||
'user': "{{ molecule_yml.driver.vm_username }}", | ||
'port': 22, | ||
'identity_file': "{{ keypair_path }}", | ||
'instance_os_type': "{{ molecule_yml.driver.instance_os_type }}" | ||
} | ||
loop: "{{ server.results }}" | ||
loop_control: | ||
loop_var: instance_info | ||
register: instance_config_dict | ||
|
||
- name: Populate instance config dict for windows | ||
set_fact: | ||
instance_conf_dict: { | ||
'instance': "{{ instance_info.item.item.name }}", | ||
'address': "{{ instance_info.instance.ipv4 }}", | ||
'port': "{{ molecule_yml.driver.winrm_port | default(5986) }}", | ||
'connection': "{{ molecule_yml.driver.connection | default('winrm') }}", | ||
'user': "{{ molecule_yml.driver.vm_username }}", | ||
'password': "{{ molecule_yml.driver.vm_password }}", | ||
'winrm_transport': "{{ molecule_yml.driver.winrm_transport | default('ntlm') }}", | ||
'winrm_server_cert_validation': "{{ molecule_yml.driver.winrm_server_cert_validation | default('ignore') }}", | ||
'instance_os_type': "{{ molecule_yml.driver.instance_os_type }}" | ||
} | ||
loop: "{{ server.results }}" | ||
loop_control: | ||
loop_var: instance_info | ||
register: instance_config_dict | ||
|
||
- name: Convert instance config dict to a list | ||
set_fact: | ||
instance_conf: "{{ instance_config_dict.results | map(attribute='ansible_facts.instance_conf_dict') | list }}" | ||
|
||
- name: Dump instance config | ||
copy: | ||
content: "{{ instance_conf | to_json | from_json | to_yaml }}" | ||
dest: "{{ molecule_instance_config }}" | ||
mode: 0644 | ||
{%- endraw %} |
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
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