Skip to content

Commit 900e1d4

Browse files
committed
Add apache to support agent-based installs on power.
1 parent 19d1d7f commit 900e1d4

13 files changed

+68
-35
lines changed

libvirt/httpd/httpd.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
TARGET_PORT=8080
3+
4+
dnf install httpd -y
5+
sed -i "s/Listen 80$/Listen ${TARGET_PORT}/" /etc/httpd/conf/httpd.conf
6+
service httpd start
7+
virsh -c qemu+tcp:///system pool-define-as --name httpd --type dir --target /var/www/html
8+
virsh -c qemu+tcp:///system pool-autostart httpd
9+
virsh -c qemu+tcp:///system pool-start httpd
10+
11+
firewall-cmd --zone libvirt --add-port ${TARGET_PORT}/tcp --permanent
12+
firewall-cmd --reload
13+

libvirt/tunnel/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ sudo systemctl status apici.service
3333
To generate the associated ports for a new profile:
3434
1. Create a yaml file with name ```profile_${HOSTNAME}.yaml```.[1]
3535
2. Add the respective token, arch, cluster_capacity, cluster_id and environment.
36-
3. Execute the ```generate-ports.sh``` script to update the yaml file libvirt port configuration with the default values for libvirt, api, http and https using the cluster capacity and cluster id.
36+
3. If the environment will be running httpd (e.g. ppc64le to support agent-based installs), add an httpd_port.
37+
4. If you want to set the ports manually and not rely on the automation, set the key `generate_ports: false` in the profile.
38+
5. Execute the ```generate-ports.sh``` script to update the yaml file libvirt port configuration with the default values for libvirt, api, http and https using the cluster capacity and cluster id.
3739

3840
[1] Sample ```profile_${HOSTNAME}.yaml``` file
3941
```
@@ -54,4 +56,4 @@ To generate the ```libvirt-${arch}.json``` files for your profiles:
5456
4. Select an architecture, and click on the corresponding `libvirt-${arch}` entry. Then, select `leases` followed by `Create a new version +`.
5557
5. Copy the contents of the generated ```libvirt-${arch}.json``` in its entity, click on the eye icon in the value (i.e. second column) of the row whose first column value is `leases`, and replace the contents of that text box with the contents of your clipboard.
5658
6. Finally, scroll to the bottom of the page and hit save. Then, hit save again.
57-
7. To verify that you entered the data correctly, you may need to reload the vault page before displaying the entries since it takes a second to propagate.
59+
7. To verify that you entered the data correctly, you may need to reload the vault page before displaying the entries since it takes a second to propagate.

libvirt/tunnel/generate-leases-network-json.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,21 @@ def build_network(networks, filename):
4747
"Couldn't find cluster_capacity for profile: {0}", profile))
4848
logging.exception(exc)
4949

50+
# Only set httpd_port if it's present (it's only needed for agent installs on ppc64le since it doesn't
51+
# allow for large initrds
52+
httpd_port = None
53+
if 'httpd_port' in profile['profile']:
54+
try:
55+
httpd_port = profile['profile']['httpd_port']
56+
except AttributeError as exc:
57+
logging.error(str.format(
58+
"Couldn't set httpd_port for profile: {0}", profile))
59+
5060
# Initialize arch-based dictionary
5161
if arch not in networks:
5262
networks[arch] = {}
5363

54-
if cluster_capacity <= 1:
64+
if cluster_capacity <= 0:
5565
logging.warning(str.format(
5666
"Profile {0} sets cluster capacity to 0. No leases will be created.", filename))
5767
return
@@ -67,6 +77,11 @@ def build_network(networks, filename):
6777
'compute': [],
6878
'bootstrap': []
6979
}
80+
81+
# Only set httpd port when set on profiles
82+
if httpd_port:
83+
networks[arch][lease]['httpd-port'] = httpd_port
84+
7085
# Bootstrap Network
7186
networks[arch][lease]['bootstrap'].append({
7287
'ip': str.format("192.168.{0}.{1}", networks[arch][lease]['subnet'], BOOSTRAP_OFFSET),

libvirt/tunnel/generate-ports.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,12 @@ do
2323
ARCH=$(yq eval '.profile.arch' ${FILENAME})
2424
CLUSTER_CAPACITY=$(yq eval '.profile.cluster_capacity' ${FILENAME})
2525
CLUSTER_ID=$(yq eval '.profile.cluster_id' ${FILENAME})
26+
GENERATE_PORTS=$(yq eval '.profile.generate_ports' ${FILENAME})
27+
if [[ "$GENERATE_PORTS" == "false" ]]; then
28+
continue
29+
fi
2630

27-
# libvirt ports
31+
# libvirt ports
2832
yq eval -i '.libvirt.bastion-port='$((${LIBVIRT_PORT} + ${CLUSTER_ID})) ${FILENAME}
2933
yq eval -i '.libvirt.target-port='${LIBVIRT_PORT} ${FILENAME}
3034
yq eval -i '.api.bastion-port='$((${API_PORT} + ${CLUSTER_ID})) ${FILENAME}
@@ -33,7 +37,7 @@ do
3337
yq eval -i '.http.target-port='${HTTP_PORT} ${FILENAME}
3438
yq eval -i '.https.bastion-port='$((${HTTPS_PORT} + ${CLUSTER_ID} + 8000)) ${FILENAME}
3539
yq eval -i '.https.target-port='${HTTPS_PORT} ${FILENAME}
36-
for CLUSTER_NUM in $(seq 0 ${CLUSTER_CAPACITY})
40+
for CLUSTER_NUM in $(seq 0 $((${CLUSTER_CAPACITY}-1)))
3741
do
3842
SSH_PORT=${BASTION_SSH_PORTS[${CLUSTER_NUM}]}
3943
yq eval -i '.bastion'${CLUSTER_NUM}'ssh.bastion-port='$((${SSH_PORT} + ${CLUSTER_ID})) ${FILENAME}

libvirt/tunnel/libvirt-ppc64le.json

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@
3131
"ip": "192.168.126.10",
3232
"mac": "02:00:00:c5:d7:14"
3333
}
34-
]
34+
],
35+
"httpd-port": 8080
3536
},
3637
"libvirt-ppc64le-1-1": {
3738
"hostname": "C155F2U31",
@@ -65,7 +66,8 @@
6566
"ip": "192.168.1.10",
6667
"mac": "02:00:00:25:a9:f1"
6768
}
68-
]
69+
],
70+
"httpd-port": 8080
6971
},
7072
"libvirt-ppc64le-1-2": {
7173
"hostname": "C155F2U31",
@@ -99,7 +101,8 @@
99101
"ip": "192.168.2.10",
100102
"mac": "02:00:00:7c:a6:20"
101103
}
102-
]
104+
],
105+
"httpd-port": 8080
103106
},
104107
"libvirt-ppc64le-1-3": {
105108
"hostname": "C155F2U31",
@@ -133,7 +136,8 @@
133136
"ip": "192.168.3.10",
134137
"mac": "02:00:00:93:e3:2e"
135138
}
136-
]
139+
],
140+
"httpd-port": 8080
137141
},
138142
"libvirt-ppc64le-0-0": {
139143
"hostname": "C155F2U33",
@@ -167,7 +171,8 @@
167171
"ip": "192.168.126.10",
168172
"mac": "02:00:00:29:c8:8d"
169173
}
170-
]
174+
],
175+
"httpd-port": 8080
171176
},
172177
"libvirt-ppc64le-0-1": {
173178
"hostname": "C155F2U33",
@@ -201,7 +206,8 @@
201206
"ip": "192.168.1.10",
202207
"mac": "02:00:00:8a:3b:70"
203208
}
204-
]
209+
],
210+
"httpd-port": 8080
205211
},
206212
"libvirt-ppc64le-0-2": {
207213
"hostname": "C155F2U33",
@@ -235,7 +241,8 @@
235241
"ip": "192.168.2.10",
236242
"mac": "02:00:00:2e:bd:3b"
237243
}
238-
]
244+
],
245+
"httpd-port": 8080
239246
},
240247
"libvirt-ppc64le-0-3": {
241248
"hostname": "C155F2U33",
@@ -269,7 +276,8 @@
269276
"ip": "192.168.3.10",
270277
"mac": "02:00:00:9a:b3:df"
271278
}
272-
]
279+
],
280+
"httpd-port": 8080
273281
},
274282
"libvirt-ppc64le-2-0": {
275283
"hostname": "C155F2U35",
@@ -303,7 +311,8 @@
303311
"ip": "192.168.126.10",
304312
"mac": "02:00:00:af:80:3c"
305313
}
306-
]
314+
],
315+
"httpd-port": 8080
307316
},
308317
"libvirt-ppc64le-2-1": {
309318
"hostname": "C155F2U35",
@@ -337,7 +346,8 @@
337346
"ip": "192.168.1.10",
338347
"mac": "02:00:00:8f:45:7a"
339348
}
340-
]
349+
],
350+
"httpd-port": 8080
341351
},
342352
"libvirt-ppc64le-2-2": {
343353
"hostname": "C155F2U35",
@@ -371,7 +381,8 @@
371381
"ip": "192.168.2.10",
372382
"mac": "02:00:00:e5:c1:d4"
373383
}
374-
]
384+
],
385+
"httpd-port": 8080
375386
},
376387
"libvirt-ppc64le-2-3": {
377388
"hostname": "C155F2U35",
@@ -405,6 +416,7 @@
405416
"ip": "192.168.3.10",
406417
"mac": "02:00:00:9f:ef:19"
407418
}
408-
]
419+
],
420+
"httpd-port": 8080
409421
}
410422
}

libvirt/tunnel/profile_C155F2U31.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ profile:
33
cluster_capacity: 4
44
cluster_id: 1
55
environment: "bastion-ppc64le-libvirt"
6+
httpd_port: 8080
67
libvirt:
78
bastion-port: 16510
89
target-port: 16509
@@ -27,6 +28,3 @@ bastion2ssh:
2728
bastion3ssh:
2829
bastion-port: 1064
2930
target-port: 22
30-
bastion4ssh:
31-
bastion-port: 1074
32-
target-port: 22

libvirt/tunnel/profile_C155F2U33.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ profile:
33
cluster_capacity: 4
44
cluster_id: 0
55
environment: "bastion-ppc64le-libvirt"
6+
httpd_port: 8080
67
libvirt:
78
bastion-port: 16509
89
target-port: 16509
@@ -27,6 +28,3 @@ bastion2ssh:
2728
bastion3ssh:
2829
bastion-port: 1063
2930
target-port: 22
30-
bastion4ssh:
31-
bastion-port: 1073
32-
target-port: 22

libvirt/tunnel/profile_C155F2U35.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ profile:
33
cluster_capacity: 4
44
cluster_id: 2
55
environment: "bastion-ppc64le-libvirt"
6+
httpd_port: 8080
67
libvirt:
78
bastion-port: 16511
89
target-port: 16509
@@ -27,6 +28,3 @@ bastion2ssh:
2728
bastion3ssh:
2829
bastion-port: 1065
2930
target-port: 22
30-
bastion4ssh:
31-
bastion-port: 1075
32-
target-port: 22

libvirt/tunnel/profile_lnxocp01.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,3 @@ bastion2ssh:
2727
bastion3ssh:
2828
bastion-port: 1063
2929
target-port: 22
30-
bastion4ssh:
31-
bastion-port: 1073
32-
target-port: 22

libvirt/tunnel/profile_lnxocp02.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,3 @@ bastion2ssh:
2727
bastion3ssh:
2828
bastion-port: 1064
2929
target-port: 22
30-
bastion4ssh:
31-
bastion-port: 1074
32-
target-port: 22

0 commit comments

Comments
 (0)