mirror of
https://gitea.0xace.cc/ansible-galaxy/cacert.git
synced 2025-04-05 08:21:56 +00:00
38 lines
1.4 KiB
YAML
38 lines
1.4 KiB
YAML
- name: Construct facts for hosts from group {{ groups[item.group] }}
|
|
when: inventory_hostname in groups[cacert_ca_group]
|
|
block:
|
|
- name: Load cacert variables for Koji
|
|
include_vars: "{{ lookup('ansible.builtin.first_found', params) }}"
|
|
vars:
|
|
params:
|
|
files:
|
|
- "cacert.yaml"
|
|
paths:
|
|
- "vars"
|
|
|
|
- name: Construct facts for hosts from group {{ groups[item.group] }}
|
|
set_fact:
|
|
iter_hosts: "{{ temp_hosts }}"
|
|
vars:
|
|
temp_hosts: >-
|
|
[{%- for host in groups[per_host_for_group_item.group] -%}
|
|
{"name": "{{ host }}", "hosts": [{"host": "{{ host }}", "path": "{{ per_host_for_group_item.path }}"{{ ',"concat": "' ~ per_host_for_group_item.concat ~ '"' if per_host_for_group_item.concat }} }{{ "" if loop.last else "," }}]}
|
|
{%- endfor -%}]
|
|
delegate_to: "{{ per_host_for_group_fact_item }}"
|
|
delegate_facts: true
|
|
with_items:
|
|
- "{{ groups[cacert_ca_group] | default([]) }}"
|
|
- "{{ groups[cacert_clients_group] | default([]) }}"
|
|
loop_control:
|
|
loop_var: per_host_for_group_fact_item
|
|
|
|
- debug:
|
|
msg: "{{ iter_hosts }}"
|
|
|
|
- name: Create certificate for hosts in {{cn_group_item.group }}
|
|
when: inventory_hostname in groups[cacert_clients_group]
|
|
block:
|
|
- name: Test
|
|
include_tasks: cn_certs.yaml
|
|
loop: "{{ iter_hosts }}"
|