feat(security): allow all registered provisioners to connect without limitations instead of the one running playbooks only

This commit is contained in:
NaeiKinDus 2024-07-11 00:00:00 +00:00
parent 332e367c3c
commit 14a46715c7
Signed by: WoodSmellParticle
GPG key ID: 8E52ADFF7CA8AE56
4 changed files with 17 additions and 48 deletions

View file

@ -5,18 +5,6 @@
- distribution
- virtualization_type
- name: get supervisor IP address
ansible.builtin.shell: "echo $SSH_CLIENT | tr -s '[:blank:]' ' ' | cut -d ' ' -f 1"
register: ssh_client
when: ansible_connection is not match("local")
changed_when: false
failed_when: ssh_client.stdout is falsy
- name: set fact
ansible.builtin.set_fact:
security_firewall_supervisor_ip: "{{ ssh_client.get('stdout', None) }}"
changed_when: false
- name: install and configure nftables
when: security_firewall_enabled is truthy
become: true
@ -42,9 +30,9 @@
- name: set firewall templates facts
ansible.builtin.set_fact:
security_firewall_supervisors_ip4: '{{ provisioner_facts.controllers_list.values() }}'
security_firewall_dns4_servers: "{{ hostvars[inventory_hostname]['global_dns_{}_dns4'.format(global_dns_type)] | default(ansible_facts.dns.nameservers | ansible.utils.ipv4, true) }}"
security_firewall_dns6_servers: "{{ hostvars[inventory_hostname]['global_dns_{}_dns6'.format(global_dns_type)] | default(ansible_facts.dns.nameservers | ansible.utils.ipv6, true) }}"
security_firewall_supervisor_has_ip6: "{{ true if security_firewall_supervisor_ip is defined and security_firewall_supervisor_ip and security_firewall_supervisor_ip | ansible.utils.ipv6 else false }}"
- name: base config file
ansible.builtin.template: