forked from infra/ansible
add rhel8 kickstart and post
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
This commit is contained in:
parent
230b2bff74
commit
6d5b9846b1
4 changed files with 121 additions and 1 deletions
|
|
@ -5,7 +5,7 @@ datacenter: rdu3
|
|||
eth0_ipv4_gw: 10.16.167.254
|
||||
eth0_ipv4_ip: 10.16.167.74
|
||||
ks_repo: https://infrastructure.fedoraproject.org/repo/rhel/RHEL8-x86_64/
|
||||
ks_url: https://infrastructure.fedoraproject.org/repo/rhel/ks/kvm-rhel
|
||||
ks_url: https://infrastructure.fedoraproject.org/repo/rhel/ks/kvm-rhel-8
|
||||
# DB used by pagure
|
||||
pagure_db_host: db01.stg.rdu3.fedoraproject.org
|
||||
ssh_hostnames:
|
||||
|
|
|
|||
39
roles/kickstarts/files/rhel8-post.sh
Normal file
39
roles/kickstarts/files/rhel8-post.sh
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
#!/bin/bash
|
||||
# This script gets run on every host after the kickstart runs.
|
||||
|
||||
infraurl="https://infrastructure.fedoraproject.org"
|
||||
|
||||
# suck down a root ssh key from our central location
|
||||
mkdir -p /root/.ssh
|
||||
chmod 700 /root/.ssh
|
||||
curl -o/root/.ssh/authorized_keys $infraurl/infra/ssh/admin.pub
|
||||
#
|
||||
# setup our sshd_config
|
||||
#
|
||||
curl -o/etc/ssh/sshd_config $infraurl/infra/ssh/sshd_config.default
|
||||
restorecon -Rv /etc/ssh
|
||||
|
||||
#
|
||||
# setup our repos
|
||||
#
|
||||
pushd /etc/yum.repos.d
|
||||
curl -O $infraurl/rhel/rhel8.repo
|
||||
curl -O $infraurl/rhel/epel8.repo
|
||||
curl -O $infraurl/infra/ansible/files/common/rhel-infra-tags.repo
|
||||
popd
|
||||
|
||||
#
|
||||
# This is needed for ansible ssh pipeline support to work
|
||||
#
|
||||
pushd /etc/sudoers.d
|
||||
echo "Defaults !requiretty" > norequiretty
|
||||
chmod 440 norequiretty
|
||||
popd
|
||||
|
||||
systemctl start postfix && \
|
||||
echo "$HOSTNAME has just been [re]installed" | \
|
||||
/bin/mail -s "$HOSTNAME - INSTALLED" \
|
||||
-r admin@fedoraproject.org admin@fedoraproject.org
|
||||
|
||||
mkdir -p /etc/ansible/facts.d
|
||||
date +%Y%m%d > /etc/ansible/facts.d/install_date.fact
|
||||
|
|
@ -6,6 +6,7 @@
|
|||
with_items:
|
||||
- kvm-fedora
|
||||
- kvm-rhel
|
||||
- kvm-rhel-8
|
||||
- hardware-rhel-9-08disk
|
||||
- hardware-rhel-9-06disk
|
||||
- hardware-rhel-10-08disk
|
||||
|
|
|
|||
80
roles/kickstarts/templates/kvm-rhel-8.j2
Normal file
80
roles/kickstarts/templates/kvm-rhel-8.j2
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
#version=RHEL8
|
||||
install
|
||||
text
|
||||
skipx
|
||||
# License Agreement
|
||||
eula --agreed
|
||||
# Network information
|
||||
|
||||
# Setup Repository info
|
||||
repo --name="BaseOS" --baseurl=https://infrastructure.fedoraproject.org/repo/rhel/rhel8/x86_64/rhel-8-for-x86_64-baseos-rpms/
|
||||
repo --name="AppStream" --baseurl=https://infrastructure.fedoraproject.org/repo/rhel/rhel8/x86_64/rhel-8-for-x86_64-appstream-rpms/
|
||||
repo --name="PowerTools" --baseurl=https://infrastructure.fedoraproject.org/repo/rhel/rhel8/x86_64/codeready-builder-for-rhel-8-x86_64-rpms/
|
||||
# Run the Setup Agent on first boot
|
||||
firstboot --disable
|
||||
# Keyboard layouts
|
||||
keyboard --vckeymap=us --xlayouts='us'
|
||||
# System language
|
||||
lang en_US.UTF-8 --addsupport=en_GB.UTF-8
|
||||
# System authorization information
|
||||
auth --enableshadow --passalgo=sha512
|
||||
# Root password
|
||||
rootpw --iscrypted "{{ kickstart_initial_password_encrypted }}"
|
||||
# System timezone
|
||||
timezone Etc/GMT --isUtc --nontp
|
||||
# System bootloader configuration
|
||||
zerombr
|
||||
bootloader --append="net.ifnames=0 crashkernel=auto" --location=mbr --boot-drive=vda
|
||||
# Partition clearing information
|
||||
clearpart --initlabel --all
|
||||
# Filesystem Data
|
||||
part /boot --fstype xfs --size=512
|
||||
part swap --fstype swap --size=2048
|
||||
part pv.01 --size=100 --grow
|
||||
volgroup GuestVolGroup00 pv.01
|
||||
logvol / --fstype xfs --size=100 --vgname=GuestVolGroup00 --name=root --grow
|
||||
# What to do at the end
|
||||
reboot
|
||||
|
||||
%packages
|
||||
@core
|
||||
authselect-compat
|
||||
bash-completion
|
||||
bind-utils
|
||||
cronie-noanacron
|
||||
crontabs
|
||||
dhclient
|
||||
iptables-services
|
||||
mailx
|
||||
nfs-utils
|
||||
nmap-ncat
|
||||
openssh-clients
|
||||
openssh-server
|
||||
patch
|
||||
python36
|
||||
postfix
|
||||
python3
|
||||
python3-libselinux
|
||||
rsync
|
||||
rsyslog
|
||||
strace
|
||||
telnet
|
||||
tmpwatch
|
||||
tmux
|
||||
traceroute
|
||||
vim-enhanced
|
||||
yum
|
||||
yum-utils
|
||||
zsh
|
||||
-biosdevname
|
||||
-cronie-anacron
|
||||
-subscription-manager
|
||||
-iwl*
|
||||
-yum-rhn-plugin
|
||||
%end
|
||||
|
||||
%post --nochroot --log=/mnt/sysimage/root/post.output --erroronfail
|
||||
mkdir /mnt/sysimage/root/tmp
|
||||
chroot /mnt/sysimage /usr/bin/curl http://infrastructure.fedoraproject.org/rhel/ks/post/rhel8-post.sh -o /root/tmp/rhel8-post.sh
|
||||
chroot /mnt/sysimage /bin/bash /root/tmp/rhel8-post.sh
|
||||
%end
|
||||
Loading…
Add table
Add a link
Reference in a new issue