File tree Expand file tree Collapse file tree 3 files changed +26
-11
lines changed Expand file tree Collapse file tree 3 files changed +26
-11
lines changed Original file line number Diff line number Diff line change 30
30
sudo apt update
31
31
sudo apt install -y git tmux lvm2 iptables
32
32
else
33
- sudo dnf install -y git tmux lvm2
33
+ sudo dnf install -y git tmux lvm2 patch
34
34
fi
35
35
36
36
# Work around connectivity issues seen while configuring this node as seed
37
37
# hypervisor with Kayobe
38
- if [[ " ${CLOUD_USER} " = " cloud-user" ]]
39
- then
40
- sudo dnf install -y network-scripts
41
- sudo rm -f /etc/sysconfig/network-scripts/ifcfg-ens3*
42
- fi
43
38
cat << EOF | sudo tee /etc/sysctl.d/70-ipv6.conf
44
39
net.ipv6.conf.all.disable_ipv6 = 1
45
40
net.ipv6.conf.default.disable_ipv6 = 1
46
41
EOF
47
42
sudo sysctl --load /etc/sysctl.d/70-ipv6.conf
48
43
44
+ # CentOS Stream 8 requires network-scripts. Rocky Linux 9 and onwards use NetworkManager.
49
45
if [[ " ${CLOUD_USER} " = " cloud-user" ]]
50
46
then
51
- sudo systemctl is-active NetworkManager && (sudo systemctl disable NetworkManager; sudo systemctl stop NetworkManager)
52
- sudo systemctl is-active network || (sudo systemctl enable network; sudo pkill dhclient; sudo systemctl start network)
47
+ case $( grep -o " [89]\.[0-9]" /etc/redhat-release) in
48
+ " 8.*" )
49
+ sudo dnf install -y network-scripts
50
+ sudo rm -f /etc/sysconfig/network-scripts/ifcfg-ens3*
51
+ sudo systemctl is-active NetworkManager && (sudo systemctl disable NetworkManager; sudo systemctl stop NetworkManager)
52
+ sudo systemctl is-active network || (sudo systemctl enable network; sudo pkill dhclient; sudo systemctl start network)
53
+ ;;
54
+ " 9.*" )
55
+ # No network-scripts for RL9
56
+ sudo systemctl is-active NetworkManager || (sudo systemctl enable NetworkManager; sudo systemctl start NetworkManager)
57
+ ;;
58
+ " *" )
59
+ echo " Could not recognise OS release $( < /etc/redhat-release) "
60
+ exit -1
61
+ ;;
62
+ esac
53
63
fi
54
64
55
65
# Exit on error
Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ resource "openstack_compute_instance_v2" "registry" {
73
73
74
74
resource "openstack_compute_floatingip_v2" "registry" {
75
75
count = var. allocate_floating_ips ? 1 : 0
76
- pool = " external "
76
+ pool = var . floating_ip_external_net
77
77
}
78
78
79
79
resource "openstack_compute_floatingip_associate_v2" "registry" {
@@ -143,7 +143,7 @@ resource "openstack_compute_instance_v2" "lab" {
143
143
144
144
resource "openstack_compute_floatingip_v2" "lab" {
145
145
count = var. allocate_floating_ips ? var. lab_count : 0
146
- pool = " external "
146
+ pool = var . floating_ip_external_net
147
147
}
148
148
149
149
resource "openstack_compute_floatingip_associate_v2" "lab" {
Original file line number Diff line number Diff line change @@ -64,6 +64,11 @@ variable "allocate_floating_ips" {
64
64
default = " false"
65
65
}
66
66
67
+ variable "floating_ip_external_net" {
68
+ description = " Network name to use for floating IP allocation"
69
+ default = " external"
70
+ }
71
+
67
72
# Remember to set a floating IP if you're using a bastion
68
73
variable "create_bastion" {
69
74
description = " Whether or not to create a bastion instance"
@@ -73,4 +78,4 @@ variable "create_bastion" {
73
78
variable "bastion_floating_ip" {
74
79
description = " Bastion floating IP"
75
80
default = " 0.0.0.0"
76
- }
81
+ }
You can’t perform that action at this time.
0 commit comments