Add group variables to the prereq role (#334)

Signed-off-by: laszlojau <49835454+laszlojau@users.noreply.github.com>
pull/341/head
laszlojau 2024-06-11 02:28:06 +09:30 committed by GitHub
parent 5a12415b3c
commit 1907e6fb79
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 4 deletions

View File

@ -1,2 +1,4 @@
---
api_port: 6443 # noqa var-naming[no-role-prefix]
server_group: server # noqa var-naming[no-role-prefix]
agent_group: agent # noqa var-naming[no-role-prefix]

View File

@ -51,7 +51,7 @@
- name: If ufw enabled, open etcd ports
when:
- ufw_status['stdout'] == "Status':' active"
- groups['server'] | length > 1
- groups[server_group] | length > 1
community.general.ufw:
rule: allow
port: "2379:2381"
@ -79,7 +79,7 @@
immediate: true
- name: If firewalld enabled, open etcd ports
when: groups['server'] | length > 1
when: groups[server_group] | length > 1
ansible.posix.firewalld:
port: "2379-2381/tcp"
zone: internal
@ -111,8 +111,8 @@
loop: >-
{{
(
groups['server'] | default([])
+ groups['agent'] | default([])
groups[server_group] | default([])
+ groups[agent_group] | default([])
)
| map('extract', hostvars, ['ansible_default_ipv4', 'address'])
| flatten | unique | list