Skip to content

Commit 73f06d1

Browse files
committed
More MN testing changes, more PR review changes
1 parent 0849f0f commit 73f06d1

File tree

5 files changed

+51
-71
lines changed

5 files changed

+51
-71
lines changed

doc/source/configuration/firewall.rst

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,6 @@ follows:
2727
# Unset to leave the default zone unchanged
2828
controller_firewalld_default_zone: drop
2929
30-
.. code-block:: yaml
31-
:caption: ``etc/kayobe/kolla/globals.yml``
32-
33-
# Open up ports in firewalld for services on the public API network.
34-
enable_external_api_firewalld: true
35-
3630
This will configure the standard set of firewalld rules on controller hosts.
3731
Rule definitions are automatically added according to group membership. Rule
3832
sets exist for the following groups:
@@ -57,3 +51,17 @@ If the command above prints a template, rather than a clean list of rules, the
5751
configuration is invalid. The kayobe configuration dump command can be used on
5852
other variables such as ``stackhpc_firewalld_rules_unverified`` or
5953
``stackhpc_*_firewalld_rules`` to debug the configuration.
54+
55+
Ensure Kolla Ansible opens up ports in firewalld for services on the public
56+
API network:
57+
58+
.. code-block:: yaml
59+
:caption: ``etc/kayobe/kolla/globals.yml``
60+
61+
enable_external_api_firewalld: true
62+
external_api_firewalld_zone: "{{ public_net_name | net_zone }}"
63+
64+
Ensure every network in ``networks.yml`` has a zone defined. The standard
65+
configuration is to set the internal network zone to ``trusted`` and every
66+
other zone to the name of the network. See
67+
``etc/kayobe/environments/ci-multinode/networks.yml`` for a practical example.

etc/kayobe/environments/ci-multinode/kolla/globals.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,4 @@ designate_forwarders_addresses: "1.1.1.1; 8.8.8.8"
4747

4848
# Open up ports in firewalld for services on the public API network.
4949
enable_external_api_firewalld: true
50+
external_api_firewalld_zone: "{{ public_net_name | net_zone }}"

etc/kayobe/environments/ci-multinode/networks.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,61 +71,64 @@ storage_mgmt_net_name: storage_mgmt
7171
###############################################################################
7272
# Network definitions.
7373

74+
# Admin overcloud network
75+
admin_oc_zone: "admin_oc"
76+
7477
# Internal network
7578
internal_cidr: 192.168.37.0/24
7679
internal_mtu: "{{ ansible_facts.default_ipv4.mtu - 50 }}"
7780
internal_allocation_pool_start: 192.168.37.3
7881
internal_allocation_pool_end: 192.168.37.254
7982
internal_vlan: 101
80-
internal_zone: "internal_net_zone"
83+
internal_zone: "trusted"
8184

8285
# External network
8386
external_cidr: 192.168.38.0/24
8487
external_mtu: "{{ ansible_facts.default_ipv4.mtu - 50 }}"
8588
external_allocation_pool_start: 192.168.38.3
8689
external_allocation_pool_end: 192.168.38.128
8790
external_vlan: 102
88-
external_zone: "external_net_zone"
91+
external_zone: "external"
8992

9093
# Public network
9194
public_cidr: 192.168.39.0/24
9295
public_mtu: "{{ ansible_facts.default_ipv4.mtu - 50 }}"
9396
public_allocation_pool_start: 192.168.39.3
9497
public_allocation_pool_end: 192.168.39.254
9598
public_vlan: 103
96-
public_zone: "public_net_zone"
99+
public_zone: "public"
97100

98101
# Tunnel network
99102
tunnel_cidr: 192.168.40.0/24
100103
tunnel_mtu: "{{ ansible_facts.default_ipv4.mtu - 50 }}"
101104
tunnel_allocation_pool_start: 192.168.40.3
102105
tunnel_allocation_pool_end: 192.168.40.254
103106
tunnel_vlan: 104
104-
tunnel_zone: "tunnel_net_zone"
107+
tunnel_zone: "tunnel"
105108

106109
# Storage network
107110
storage_cidr: 192.168.41.0/24
108111
storage_mtu: "{{ ansible_facts.default_ipv4.mtu - 50 }}"
109112
storage_allocation_pool_start: 192.168.41.3
110113
storage_allocation_pool_end: 192.168.41.254
111114
storage_vlan: 105
112-
storage_zone: "storage_net_zone"
115+
storage_zone: "storage"
113116

114117
# Storage management network
115118
storage_mgmt_cidr: 192.168.42.0/24
116119
storage_mgmt_mtu: "{{ ansible_facts.default_ipv4.mtu - 50 }}"
117120
storage_mgmt_allocation_pool_start: 192.168.42.3
118121
storage_mgmt_allocation_pool_end: 192.168.42.254
119122
storage_mgmt_vlan: 106
120-
storage_mgmt_zone: "storage_mgmt_net_zone"
123+
storage_mgmt_zone: "storage_mgmt"
121124

122125
# Provision overcloud network
123126
provision_oc_cidr: 192.168.33.0/24
124127
provision_oc_mtu: "{{ ansible_facts.default_ipv4.mtu - 50 }}"
125128
provision_oc_allocation_pool_start: 192.168.33.128
126129
provision_oc_allocation_pool_end: 192.168.33.254
127130
provision_oc_vlan: 107
128-
provision_oc_zone: "provision_oc_net_zone"
131+
provision_oc_zone: "provision_oc"
129132

130133
###############################################################################
131134
# Network virtual patch link configuration.

etc/kayobe/inventory/group_vars/all/firewall

Lines changed: 25 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ stackhpc_firewalld_zones: |
1818
{% set _ = network_zones.append({'zone': network | net_zone }) %}
1919
{% endif %}
2020
{% endfor %}
21-
{{ network_zones }}
21+
{{ network_zones | unique }}
2222

2323
# A templated list of firewalld rules, according to the enabled services,
2424
# host's group membership, and host's network configuration.
@@ -29,7 +29,7 @@ stackhpc_firewalld_rules: |
2929
{% for rule in stackhpc_firewalld_rules_unverified | unique %}
3030
{% if rule | ansible.utils.remove_keys('state') in stackhpc_firewalld_rules_verified | map('ansible.utils.remove_keys', 'state') %}
3131
{% set stackhpc_firewalld_rules_verified = 'Invalid configuration! Two matching firewalld rules probably exist with different states' + 1 %}
32-
{% elif rule.network in network_interfaces and rule.network | net_zone is not none %}
32+
{% elif rule.network in network_interfaces and rule.network | net_zone %}
3333
{% set _ = stackhpc_firewalld_rules_verified.append(rule) %}
3434
{% endif %}
3535
{% endfor %}
@@ -56,7 +56,7 @@ stackhpc_common_firewalld_rules: "{{ stackhpc_common_firewalld_rules_default + s
5656
stackhpc_common_firewalld_rules_default: |
5757
{% set stackhpc_common_firewalld_rules_formatted = [] %}
5858
{% for ruleset in stackhpc_common_firewalld_rules_template %}
59-
{% if ruleset.enabled %}
59+
{% if ruleset.enabled | bool %}
6060
{% for rule in ruleset.rules %}
6161
{% set _ = stackhpc_common_firewalld_rules_formatted.append(rule | combine({'zone': rule.network | net_zone })) %}
6262
{% endfor %}
@@ -78,12 +78,12 @@ stackhpc_common_firewalld_rules_template:
7878
- service: dhcpv6-client
7979
network: "{{ public_net_name }}"
8080
state: disabled
81-
enabled: "{{ public_net_name | net_zone in stackhpc_firewalld_zones }}"
81+
enabled: "{{ {'zone': public_net_name | net_zone} in firewalld_zones }}"
8282
- rules:
8383
- service: ssh
8484
network: "{{ public_net_name }}"
8585
state: disabled
86-
enabled: "{{ public_net_name | net_zone in stackhpc_firewalld_zones and admin_oc_net_name | net_zone != public_net_name | net_zone }}"
86+
enabled: "{{ {'zone': 'public' | net_zone} in firewalld_zones and admin_oc_net_name | net_zone != public_net_name | net_zone }}"
8787

8888
stackhpc_common_firewalld_rules_extra: []
8989

@@ -95,7 +95,7 @@ stackhpc_controller_firewalld_rules: "{{ stackhpc_controller_firewalld_rules_def
9595
stackhpc_controller_firewalld_rules_default: |
9696
{% set stackhpc_controller_firewalld_rules_formatted = [] %}
9797
{% for ruleset in stackhpc_controller_firewalld_rules_template %}
98-
{% if ruleset.enabled %}
98+
{% if ruleset.enabled | bool %}
9999
{% for rule in ruleset.rules %}
100100
{% set _ = stackhpc_controller_firewalld_rules_formatted.append(rule | combine({'zone': rule.network | net_zone })) %}
101101
{% endfor %}
@@ -126,7 +126,7 @@ stackhpc_controller_firewalld_rules_template:
126126
- service: tftp
127127
network: "{{ provision_wl_net_name }}"
128128
state: enabled
129-
enabled: "{{ kolla_enable_ironic }}"
129+
enabled: "{{ kolla_enable_ironic | bool }}"
130130
# Designate
131131
- rules:
132132
- port: 53/tcp
@@ -142,39 +142,6 @@ stackhpc_controller_firewalld_rules_template:
142142
network: "{{ public_net_name }}"
143143
state: enabled
144144
enabled: "{{ kolla_enable_designate | bool }}"
145-
# Vault & Consul
146-
- rules:
147-
- port: 8200/tcp
148-
network: "{{ internal_net_name }}"
149-
state: enabled
150-
- port: 8300/tcp
151-
network: "{{ internal_net_name }}"
152-
state: enabled
153-
- port: 8301/tcp
154-
network: "{{ internal_net_name }}"
155-
state: enabled
156-
- port: 8301/udp
157-
network: "{{ internal_net_name }}"
158-
state: enabled
159-
- port: 8302/tcp
160-
network: "{{ internal_net_name }}"
161-
state: enabled
162-
- port: 8302/udp
163-
network: "{{ internal_net_name }}"
164-
state: enabled
165-
- port: 8500/tcp
166-
network: "{{ internal_net_name }}"
167-
state: enabled
168-
- port: 8501/tcp
169-
network: "{{ internal_net_name }}"
170-
state: enabled
171-
- port: 8600/tcp
172-
network: "{{ internal_net_name }}"
173-
state: enabled
174-
- port: 8600/udp
175-
network: "{{ internal_net_name }}"
176-
state: enabled
177-
enabled: true # FIXME add condition
178145
# GENEVE
179146
- rules:
180147
- port: 6081/udp
@@ -190,7 +157,7 @@ stackhpc_controller_firewalld_rules_template:
190157
# Octavia
191158
- rules:
192159
- port: 5555/udp
193-
network: "{{ octavia_net_name }}"
160+
network: "{{ octavia_net_name | default(public_net_name) }}"
194161
state: enabled
195162
enabled: "{{ kolla_enable_octavia | bool }}"
196163

@@ -204,9 +171,9 @@ stackhpc_compute_firewalld_rules: "{{ stackhpc_compute_firewalld_rules_default +
204171
stackhpc_compute_firewalld_rules_default: |
205172
{% set stackhpc_compute_firewalld_rules_formatted = [] %}
206173
{% for ruleset in stackhpc_compute_firewalld_rules_template %}
207-
{% if ruleset.enabled %}
174+
{% if ruleset.enabled | bool %}
208175
{% for rule in ruleset.rules %}
209-
{% if rule.network in network_interfaces and rule.network | net_zone is not none %}
176+
{% if rule.network in network_interfaces and rule.network | net_zone %}
210177
{% set _ = stackhpc_compute_firewalld_rules_formatted.append(rule | combine({'zone': rule.network | net_zone })) %}
211178
{% endif %}
212179
{% endfor %}
@@ -238,9 +205,9 @@ stackhpc_storage_firewalld_rules: "{{ stackhpc_storage_firewalld_rules_default +
238205
stackhpc_storage_firewalld_rules_default: |
239206
{% set stackhpc_storage_firewalld_rules_formatted = [] %}
240207
{% for ruleset in stackhpc_storage_firewalld_rules_template %}
241-
{% if ruleset.enabled %}
208+
{% if ruleset.enabled | bool %}
242209
{% for rule in ruleset.rules %}
243-
{% if rule.network in network_interfaces and rule.network | net_zone is not none %}
210+
{% if rule.network in network_interfaces and rule.network | net_zone %}
244211
{% set _ = stackhpc_storage_firewalld_rules_formatted.append(rule | combine({'zone': rule.network | net_zone })) %}
245212
{% endif %}
246213
{% endfor %}
@@ -254,7 +221,7 @@ stackhpc_storage_firewalld_rules_template:
254221
- port: 9283/tcp
255222
network: "{{ provision_oc_net_name }}"
256223
state: enabled
257-
enabled: "{{ kolla_enable_prometheus_ceph_mgr_exporter and 'mgrs' in group_names }}"
224+
enabled: "{{ kolla_enable_prometheus_ceph_mgr_exporter | bool | default(false) and 'mgrs' in group_names }}"
258225
# Ceph
259226
- rules:
260227
- service: ceph
@@ -278,9 +245,9 @@ stackhpc_monitoring_firewalld_rules: "{{ stackhpc_monitoring_firewalld_rules_def
278245
stackhpc_monitoring_firewalld_rules_default: |
279246
{% set stackhpc_monitoring_firewalld_rules_formatted = [] %}
280247
{% for ruleset in stackhpc_monitoring_firewalld_rules_template %}
281-
{% if ruleset.enabled %}
248+
{% if ruleset.enabled | bool %}
282249
{% for rule in ruleset.rules %}
283-
{% if rule.network in network_interfaces and rule.network | net_zone is not none %}
250+
{% if rule.network in network_interfaces and rule.network | net_zone %}
284251
{% set _ = stackhpc_monitoring_firewalld_rules_formatted.append(rule | combine({'zone': rule.network | net_zone })) %}
285252
{% endif %}
286253
{% endfor %}
@@ -300,9 +267,9 @@ stackhpc_wazuh_manager_infra_vm_firewalld_rules: "{{ stackhpc_wazuh_manager_infr
300267
stackhpc_wazuh_manager_infra_vm_firewalld_rules_default: |
301268
{% set stackhpc_wazuh_manager_infra_vm_firewalld_rules_formatted = [] %}
302269
{% for ruleset in stackhpc_wazuh_manager_infra_vm_firewalld_rules_template %}
303-
{% if ruleset.enabled %}
270+
{% if ruleset.enabled | bool %}
304271
{% for rule in ruleset.rules %}
305-
{% if rule.network in network_interfaces and rule.network | net_zone is not none %}
272+
{% if rule.network in network_interfaces and rule.network | net_zone %}
306273
{% set _ = stackhpc_wazuh_manager_infra_vm_firewalld_rules_formatted.append(rule | combine({'zone': rule.network | net_zone })) %}
307274
{% endif %}
308275
{% endfor %}
@@ -345,9 +312,9 @@ stackhpc_ansible_control_infra_vm_firewalld_rules: "{{ stackhpc_ansible_control_
345312
stackhpc_ansible_control_infra_vm_firewalld_rules_default: |
346313
{% set stackhpc_ansible_control_infra_vm_firewalld_rules_formatted = [] %}
347314
{% for ruleset in stackhpc_ansible_control_infra_vm_firewalld_rules_template %}
348-
{% if ruleset.enabled %}
315+
{% if ruleset.enabled | bool %}
349316
{% for rule in ruleset.rules %}
350-
{% if rule.network in network_interfaces and rule.network | net_zone is not none %}
317+
{% if rule.network in network_interfaces and rule.network | net_zone %}
351318
{% set _ = stackhpc_ansible_control_infra_vm_firewalld_rules_formatted.append(rule | combine({'zone': rule.network | net_zone })) %}
352319
{% endif %}
353320
{% endfor %}
@@ -367,9 +334,9 @@ stackhpc_seed_firewalld_rules: "{{ stackhpc_seed_firewalld_rules_default + stack
367334
stackhpc_seed_firewalld_rules_default: |
368335
{% set stackhpc_seed_firewalld_rules_formatted = [] %}
369336
{% for ruleset in stackhpc_seed_firewalld_rules_template %}
370-
{% if ruleset.enabled %}
337+
{% if ruleset.enabled | bool %}
371338
{% for rule in ruleset.rules %}
372-
{% if rule.network in network_interfaces and rule.network | net_zone is not none %}
339+
{% if rule.network in network_interfaces and rule.network | net_zone %}
373340
{% set _ = stackhpc_seed_firewalld_rules_formatted.append(rule | combine({'zone': rule.network | net_zone })) %}
374341
{% endif %}
375342
{% endfor %}
@@ -380,7 +347,7 @@ stackhpc_seed_firewalld_rules_default: |
380347
stackhpc_seed_firewalld_rules_template:
381348
# Pulp server
382349
- rules:
383-
- service: "{{ pulp_port }}/tcp"
350+
- port: "{{ pulp_port }}/tcp"
384351
network: "{{ provision_oc_net_name }}"
385352
state: enabled
386353
enabled: "{{ seed_pulp_container_enabled | bool }}"
@@ -420,6 +387,7 @@ stackhpc_seed_firewalld_rules_template:
420387
network: "{{ provision_oc_net_name }}"
421388
state: enabled
422389
enabled: "{{ stackhpc_enable_redfish_exporter | default(false) }}"
390+
# TODO: Rules if SNAT enabled on seed
423391

424392
stackhpc_seed_firewalld_rules_extra: []
425393

@@ -431,9 +399,9 @@ stackhpc_seed_hypervisor_firewalld_rules: "{{ stackhpc_seed_hypervisor_firewalld
431399
stackhpc_seed_hypervisor_firewalld_rules_default: |
432400
{% set stackhpc_seed_hypervisor_firewalld_rules_formatted = [] %}
433401
{% for ruleset in stackhpc_seed_hypervisor_firewalld_rules_template %}
434-
{% if ruleset.enabled %}
402+
{% if ruleset.enabled | bool %}
435403
{% for rule in ruleset.rules %}
436-
{% if rule.network in network_interfaces and rule.network | net_zone is not none %}
404+
{% if rule.network in network_interfaces and rule.network | net_zone %}
437405
{% set _ = stackhpc_seed_hypervisor_firewalld_rules_formatted.append(rule | combine({'zone': rule.network | net_zone })) %}
438406
{% endif %}
439407
{% endfor %}

etc/kayobe/networks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
#cleaning_net_name:
6161

6262
# Name of the network used to manage octavia loadbalancers
63-
octavia_net_name: ""
63+
#octavia_net_name:
6464

6565
###############################################################################
6666
# Network definitions.

0 commit comments

Comments
 (0)