forked from eucalyptus/eucalyptus-service-image
-
Notifications
You must be signed in to change notification settings - Fork 0
/
eucalyptus-service-image.ks.in
130 lines (116 loc) · 2.6 KB
/
eucalyptus-service-image.ks.in
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
install
cmdline
reboot
keyboard us
lang en_US.UTF-8
timezone UTC
network --bootproto dhcp --device eth0 --onboot on
rootpw --iscrypted $1$HEVobWzu$6d5IWr.r7Df15XHLFCggW/
auth --useshadow --passalgo=sha512
firewall --disabled
selinux --disabled
services --enabled=network,ntpd,ntpdate
skipx
eula --agreed
bootloader --timeout=1 --append="xen_blkfront.sda_is_xvda=1 serial=tty0 console=ttyS0,115200n8"
clearpart --all
zerombr
part / --size 1536 --grow --fstype ext3
url --url @INSTALL_TREE@
repo --name updates --baseurl=@UPDATES_MIRROR@
repo --name epel --baseurl=@EPEL_MIRROR@
repo --name eucalyptus --baseurl=@EUCALYPTUS_MIRROR@
# Add all the packages after the base packages
%packages --excludedocs --instLangs=en
@core --nodefaults
audit
bash
chkconfig
cloud-init
cloud-utils-growpart
coreutils
createrepo
curl
e2fsprogs
ec2-net-utils
epel-release
ntp
ntpdate
openssh-server
passwd
policycoreutils
rootfiles
sudo
system-config-firewall-base
yum-utils
-*firmware
-acl
-b43-openfwwf
-btrfs-progs
-cyrus-sasl
-deltarpm
-dracut-config-rescue
-efibootmgr
-firewalld
-kernel-tools
-iprutils
-libsysfs
-man-db
-microcode_ctl
-mysql-libs
-NetworkManager
-NetworkManager-libnm
-NetworkManager-team
-NetworkManager-tui
-NetworkManager-wifi
-plymouth
-plymouth-system-theme
-postfix
-python-deltarpm
-qemu-guest-agent
-sg3_utils
-sg3_utils-libs
-sysstat
-wpa_supplicant
-xfsprogs
%end
%post --erroronfail --log=/root/kickstart-post.log
set -x
# packages cleanup
yum -y erase linux-firmware
# Setup console
cat > /etc/init/ttyS0.conf <<EOF
stop on runlevel[016]
start on runlevel[345]
respawn
instance /dev/ttyS0
exec /sbin/mingetty /dev/ttyS0
EOF
# Configure sudo
sed -i '/!visiblepw/s/^/#/' /etc/sudoers
# Configure cloud-init
sed -i 's/name: centos/name: cloud-user/' /etc/cloud/cloud.cfg
# Configure networking
mkdir -p /etc/systemd/system/cloud-init-local.service.d
cat > /etc/systemd/system/cloud-init-local.service.d/10-execstart-networking.conf <<EOF
[Service]
ExecStart=/usr/local/bin/reset-networking.sh
EOF
cat > /usr/local/bin/reset-networking.sh <<EOF
#!/bin/bash
echo "# Networking config from /usr/local/bin/reset-networking.sh" > /etc/sysconfig/network
echo "NOZEROCONF=yes" >> /etc/sysconfig/network
echo "NETWORKING=yes" >> /etc/sysconfig/network
EOF
chmod 755 /usr/local/bin/reset-networking.sh
/usr/local/bin/reset-networking.sh
# Configure sshd
sed -i 's/PasswordAuthentication yes/PasswordAuthentication no/' /etc/ssh/sshd_config
sed -i 's/GSSAPIAuthentication yes/GSSAPIAuthentication no/' /etc/ssh/sshd_config
cat >> /etc/ssh/sshd_config <<EOF
UseDNS no
PermitRootLogin without-password
EOF
yum clean all
%end
#vim: set syntax=kickstart: