-
Notifications
You must be signed in to change notification settings - Fork 1
/
c8-kvm-guest.cfg.j2
94 lines (74 loc) · 3.31 KB
/
c8-kvm-guest.cfg.j2
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
#version=RHEL8
auth --enableshadow --passalgo=sha512
ignoredisk --only-use=vda
# System bootloader configuration
bootloader --location=mbr --boot-drive=vda
# Partition clearing information
clearpart --all --initlabel
{% if 'aarch64' in inventory_hostname %}
part /boot/efi --fstype="vfat" --ondisk=vda --size=200
{% endif %}
{% if 'ppc' in inventory_hostname %}
part prepboot --asprimary --fstype=prepboot --size=10
part /boot --fstype="ext4" --size=1024
part pv.8 --fstype="lvmpv" --size=6000 --grow
volgroup vg_{{ inventory_hostname_short}} --pesize=4096 pv.8
logvol swap --fstype="swap" --size=2112 --name=swap --vgname=vg_{{ inventory_hostname_short }}
logvol / --fstype="ext4" --size=3000 --grow --name=root --vgname=vg_{{ inventory_hostname_short }}
{% else %}
part /boot --fstype="ext4" --ondisk=vda --size=1024
part pv.14 --fstype="lvmpv" --ondisk=vda --size=10000 --grow
volgroup vg_{{ inventory_hostname_short }} --pesize=4096 pv.14
logvol / --fstype="ext4" --size=8200 --grow --name=root --vgname=vg_{{ inventory_hostname_short }}
logvol swap --fstype="swap" --size=2136 --name=swap --vgname=vg_{{ inventory_hostname_short }}
{% endif %}
{% if enable_CR == "1" %}
repo --name=install-BaseOS --baseurl=http://qa.centos.org/centos/{{ centos_dist }}/BaseOS/{{ centos_arch }}/os/
repo --name=install-CR --baseurl=http://qa.centos.org/centos/{{ centos_dist }}/cr/{{ centos_arch }}/os/
{% endif %}
# Use text mode install
text
# Use network installation
url --url="http://qa.centos.org/centos/8/BaseOS/{{ centos_arch }}/os/"
# Keyboard layouts
keyboard --vckeymap=us --xlayouts=''
# System language
lang en_US.UTF-8
# Network information
network --bootproto=static --device=eth0 --ip={{ ip }} --netmask={{ netmask }} --nameserver={{ nameserver }} --gateway={{ gateway }} --activate
network --hostname={{ inventory_hostname }}
# Root password
rootpw --iscrypted $6$YRLM3XoE/H3XIxAr$uKqW3VSk67hVrxnsCqzJLDQidIZdBW2eyZ3BnxORfxmwUEjrUezBF0woxMlzelnxSWvure5Vzc1sTS9e1OoLH/
# Run the Setup Agent on first boot
firstboot --enable
# Do not configure the X Window System
skipx
# System services
services --enabled="chronyd"
# System timezone
timezone Etc/UTC --isUtc
reboot
%packages
@^minimal-environment
wget
%end
%addon com_redhat_kdump --disable --reserve-mb='auto'
%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
{% if centos_arch == 'ppc64le' or centos_arch == 'aarch64' %}
echo "{{ mirrorlist_ip }} mirrorlist.centos.org" >> /etc/hosts
{% endif %}
mkdir /root/.ssh
echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDUyaH+XuDDERZCF3B55+e/kVr3ly7jFjMp53dfYUZro7MZdV0JwSMk+6w1Wo4qF1SsVECpUm5hYtoVMAzcWt0WhmBnaflmNNZjTn7RGdA/jqjOe5dVGHDKQkRdvFL0hHP4AJUb3kjKbEfhql1JUsoOX7xFtf873/qi8699o3cCg11ln3SzbmnsVPVB0XT9mnavwgz+/CJmYGVBYfxFbObS/N5ENvdQLMk5N64E7D/ClAE3b69JprB8cKygMWuqJjL67EtvV/KsTd2M02N3jtIP797LdAZvSNt4FwAm41yb3W6vajS0NAk461ytt+dnnDVchCj9GqscwEJRCsuliWlf qa@qa.centos.org" >> /root/.ssh/authorized_keys
chmod 700 /root/.ssh
chmod 600 /root/.ssh/* ; chcon -v -R -t ssh_home_t /root/.ssh**
{% if enable_CR == "1" %}
sed -i s/enabled=0/enabled=1/ /etc/yum.repos.d/CentOS-CR.repo
sed -i s/gpgcheck=1/gpgcheck=0/ /etc/yum.repos.d/CentOS-CR.repo
{% endif %}
%end