chore!: separated galaxy deps and own collections; modified ansible script generation to use two paths for collections

REQUIRES REGENERATING ansible.cfg!
This commit is contained in:
NaeiKinDus 2025-02-23 00:00:00 +00:00
parent 4af69c31ce
commit 888590ed9f
Signed by: WoodSmellParticle
GPG key ID: 8E52ADFF7CA8AE56
188 changed files with 30 additions and 30 deletions

View file

@ -0,0 +1,47 @@
---
# playbook file used for creating the instances and storing data in instance-config
- name: Create
hosts: localhost
gather_facts: false
connection: local
tasks:
- name: Create instances
vagrant:
instances: "{{ molecule_yml.platforms }}"
default_box: "{{ molecule_yml.driver.default_box | default('debian/bookworm64') }}"
provider_name: "{{ molecule_yml.driver.provider.name | default(omit, true) }}"
provision: "{{ molecule_yml.driver.provision | default(omit) }}"
cachier: "{{ molecule_yml.driver.cachier | default(omit) }}"
parallel: "{{ molecule_yml.driver.parallel | default(omit) }}"
state: up
register: server
- name: VMs info
ansible.builtin.debug:
msg: "{{ server.results }}"
- name: Create molecule instances configuration
when: server is changed # noqa no-handler
block:
- name: Populate instance config dict
ansible.builtin.set_fact:
instance_conf_dict:
{
"instance": "{{ item.Host }}",
"address": "{{ item.HostName }}",
"user": "{{ item.User }}",
"port": "{{ item.Port }}",
"identity_file": "{{ item.IdentityFile }}",
}
loop: "{{ server.results }}"
loop_control:
label: "{{ item.Host }}"
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: "{{ instance_conf | to_json | from_json | to_yaml }}"
dest: "{{ molecule_instance_config }}"
mode: "0600"