This repository has been archived by the owner on Aug 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
centos-8-kickstart-cloud_common.cfg
147 lines (116 loc) · 3.41 KB
/
centos-8-kickstart-cloud_common.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
#version=RHEL8
# Partition clearing information
clearpart --all --initlabel
# Use graphical install
text
# Use CDROM installation media
cdrom
# Keyboard layouts
keyboard --vckeymap=us --xlayouts='us'
# System language
lang en_US.UTF-8
network --hostname={HOST}
network --device=enp1s0 --bootproto=dhcp --onboot=yes --noipv6 --activate --nodefroute
network --device=enp2s0 --bootproto=dhcp --noipv6 --onboot=yes --activate
network --device=enp3s0 --bootproto=static --onboot=yes --noipv6 --activate --ip=127.0.0.1
# Root password
rootpw {GENERATED_PWD}
# Run the Setup Agent on first boot
firstboot --enable
# Do not configure the X Window System
skipx
# System services
services --enabled="chronyd" --disabled="libvirtd" --enabled="qemu-guest-agent"
# System bootloader configuration
bootloader --location=mbr --boot-drive=vda
timezone UTC --isUtc
%pre --log=/tmp/ks_pre.log
# Determine how many drives we have
# shellcheck disable=SC2046
set $(list-harddrives)
let numd=$#/2
if [ "$numd" -eq 1 ] ; then
## all but storage have only 1 drive
cat << EOF >> /tmp/partinfo.log
autopart --type=lvm
EOF
else
cat << EOF >> /tmp/partinfo.log
part biosboot --size=1 --ondisk=vda
part / --size=1024 --grow --ondisk=vda
part /home --size=1000 --ondisk=vda
part /boot --size=1000 --ondisk=vda
part swap --size=5000 --ondisk=vda
part pv.01 --size=1024 --grow --ondisk=vdb
volgroup cinder-volumes pv.01
EOF
fi
%end
zerombr
%include /tmp/partinfo.log
# Create user
user --name=stack --shell=/bin/bash --homedir=/opt/stack --password={GENERATED_PWD}
%packages
%include /mnt/install/repo/ks_configs/packages.cfg
%end
%addon com_redhat_kdump --disable
%end
%anaconda
pwpolicy root --minlen=6 --minquality=1 --notstrict --nochanges --notempty
pwpolicy user --minlen=6 --minquality=1 --notstrict --nochanges --emptyok
pwpolicy luks --minlen=6 --minquality=1 --notstrict --nochanges --notempty
%end
%post --nochroot
cp /mnt/install/repo/embedded/* /mnt/sysroot/tmp
%include /mnt/install/repo/ks_configs/create-local-repo.cfg
%include /mnt/install/repo/ks_configs/copy_py_modules_to_root_fs.cfg
cp -r /run/install/repo/ks_configs/python.modules /mnt/sysimage/root/
%include /mnt/install/repo/ks_configs/configure-local-repo.cfg
cp /tmp/*.log /mnt/sysroot/var/log
%end
%post
exec 1>/var/log/init-install.log 2>&1
source /tmp/project_config.sh
source /tmp/vm_functions.sh
sed -i 's/^.*swap.*$/#&/' /etc/fstab
swapoff -a
disk_count=$(lshw -class disk | grep /dev/vd -c)
if [[ "$disk_count" -ge 5 ]]; then
index=0
for d in vdc vdd vde; do
pvcreate -f /dev/${d}
parted /dev/${d} -s -- mklabel gpt mkpart KOLLA_SWIFT_DATA 1 -1
sleep 5
mkfs.xfs -f -L d${index} /dev/${d}1
sleep 5
((index++))
done
fi
systemctl mask firewalld
install_packages_openstack
setup_keys_certs_for_vm
# adjust main volumes to allocate most size to root volume
grow_fs
grub_update
tuned-adm profile virtual-guest
echo "stack ALL=(ALL) NOPASSWD: ALL" | tee /etc/sudoers.d/stack
cat >> /etc/modules-load.d/vhost_net.conf <<EOF
vhost_net
EOF
join_machine_to_domain {CENTOS_ADMIN_PWD_123456789012}
#setup repo server
yum install -y httpd python36
systemctl enable httpd
sed -i 's/Listen 80/Listen 8081/' /etc/httpd/conf/httpd.conf
pip3 uninstall -y selinux
## extract docker repo
tar -xf /tmp/docker-repo.tar -C /var/www/html
rm -rf /tmp/docker-repo.tar
###############################
### cleanup everything but logs
rm -rf /tmp/*.sh
###Close out cfg file
%end
eula --agreed
reboot --eject
#########