Skip to content

Commit c7a5f1c

Browse files
authored
Merge pull request #68 from stackhpc/upstream/wallaby-2022-10-31
Synchronise wallaby with upstream
2 parents fbdb27f + e2aadb3 commit c7a5f1c

File tree

7 files changed

+30
-1
lines changed

7 files changed

+30
-1
lines changed

ansible/ip-allocation.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
when:
2828
- item | net_cidr != None
2929
- item | net_bootproto != 'dhcp'
30+
- not item | net_no_ip | bool
3031
roles:
3132
- role: ip-allocation
3233
ip_allocation_filename: "{{ kayobe_env_config_path }}/network-allocation.yml"

doc/source/configuration/reference/network.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ supported:
8383
``libvirt_network_name``
8484
A name to give to a Libvirt network representing this network on the seed
8585
hypervisor.
86+
``no_ip``
87+
Whether to allocate an IP address for this network. If set to ``true``, an
88+
IP address will not be allocated.
8689

8790
Configuring an IP Subnet
8891
------------------------

kayobe/plugins/filter/networks.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,11 @@ def net_interface(context, name, inventory_hostname=None):
174174
return net_attr(context, name, 'interface', inventory_hostname)
175175

176176

177+
@jinja2.contextfilter
178+
def net_no_ip(context, name, inventory_hostname=None):
179+
return net_attr(context, name, 'no_ip', inventory_hostname)
180+
181+
177182
@jinja2.contextfilter
178183
def net_cidr(context, name, inventory_hostname=None):
179184
return net_attr(context, name, 'cidr', inventory_hostname)
@@ -670,6 +675,7 @@ def get_filters():
670675
'net_fqdn': _make_attr_filter('fqdn'),
671676
'net_ip': net_ip,
672677
'net_interface': net_interface,
678+
'net_no_ip': net_no_ip,
673679
'net_cidr': net_cidr,
674680
'net_mask': net_mask,
675681
'net_prefix': net_prefix,

playbooks/kayobe-overcloud-host-configure-base/overrides.yml.j2

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ controller_extra_network_interfaces:
1818
- test_net_bridge_vlan
1919
- test_net_bond
2020
- test_net_bond_vlan
21+
- test_net_bridge_noip
2122

2223
# Custom IP routing tables.
2324
network_route_tables:
@@ -67,6 +68,12 @@ test_net_bond_vlan_cidr: 192.168.39.0/24
6768
test_net_bond_vlan_interface: "{% raw %}{{ test_net_bond_interface }}.{{ test_net_bond_vlan_vlan }}{% endraw %}"
6869
test_net_bond_vlan_vlan: 44
6970

71+
# br1: Bridge interface without IP address.
72+
test_net_bridge_noip_cidr: 192.168.40.0/24
73+
test_net_bridge_noip_interface: br1
74+
test_net_bridge_noip_bridge_ports: [dummy7]
75+
test_net_bridge_noip_no_ip: true
76+
7077
# Define a software RAID device consisting of two loopback devices.
7178
controller_mdadm_arrays:
7279
- name: md0

playbooks/kayobe-overcloud-host-configure-base/pre.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@
3939
- name: Ensure dummy network interfaces exist
4040
command: ip link add dummy{{ item }} type dummy
4141
become: true
42-
loop: "{{ range(2, 7) | list }}"
42+
loop: "{{ range(2, 8) | list }}"

playbooks/kayobe-overcloud-host-configure-base/tests/test_overcloud_host_configure.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,12 @@ def test_network_bond_vlan(host):
8686
assert host.file('/sys/class/net/bond0.44/lower_bond0').exists
8787

8888

89+
def test_network_bridge_no_ip(host):
90+
interface = host.interface('br1')
91+
assert interface.exists
92+
assert not '192.168.40.1' in interface.addresses
93+
94+
8995
def test_additional_user_account(host):
9096
user = host.user("kayobe-test-user")
9197
assert user.name == "kayobe-test-user"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
features:
3+
- |
4+
The new filter ``net_no_ip`` adds the attribute ``no_ip`` which can be set
5+
to ``true`` to skip IP address allocation and configuration for specific
6+
networks.

0 commit comments

Comments
 (0)