-
Notifications
You must be signed in to change notification settings - Fork 34
/
contrail-centos.ks
132 lines (122 loc) · 3.94 KB
/
contrail-centos.ks
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
#platform=x86, AMD64, or Intel EM64T
# System authorization information
auth --useshadow --enablemd5
# System bootloader configuration
bootloader --location=mbr
# Partition clearing information
clearpart --all --initlabel --drives=sda
# Use text mode install
text
# Firewall configuration
firewall --enabled
# Run the Setup Agent on first boot
firstboot --disable
# System keyboard
keyboard us
# System language
lang en_US
# Use network installation
url --url=$tree
# If any cobbler repo definitions were referenced in the kickstart profile, include them here.
$yum_repo_stanza
# Network information
## $SNIPPET('network_config')
# Reboot after installation
reboot
# Root password
rootpw --iscrypted $passwd
# SELinux configuration
selinux --disabled
# Do not configure the X Window System
skipx
# System timezone
timezone America/Los_Angeles
# Install OS instead of upgrade
install
# Clear the Master Boot Record
zerombr
# Allow anaconda to partition the system as needed
autopart
%pre
$SNIPPET('log_ks_pre')
$SNIPPET('kickstart_start')
## $SNIPPET('pre_install_network_config')
# Enable installation monitoring
## $SNIPPET('pre_anamon')
%end
%packages --nobase
@core
openssh-clients
puppet
$SNIPPET('func_install_if_enabled')
%end
%post
$SNIPPET('log_ks_post')
yum -y install wget ntp ntpdate
## Configure NTP to access cobbler/puppet master as NTP server
/usr/sbin/ntpdate $http_server
/sbin/hwclock --systohc
/bin/mv /etc/ntp.conf /etc/ntp.conf.orig
/bin/touch /var/lib/ntp/drift
cat << __EOT__ > /etc/ntp.conf
driftfile /var/lib/ntp/drift
server $http_server iburst
restrict 127.0.0.1
restrict -6 ::1
includefile /etc/ntp/crypto/pw
keys /etc/ntp/keys
__EOT__
/sbin/chkconfig ntpd on
/sbin/chkconfig
/sbin/service ntpd start
# Start yum configuration
$yum_config_stanza
# End yum configuration
$SNIPPET('post_install_kernel_options')
## $SNIPPET('post_install_network_config')
$SNIPPET('func_register_if_enabled')
##$SNIPPET('puppet_register_if_enabled')
## Configure puppet agent and start it
echo "$server puppet" >> /etc/hosts
echo "$ip_address $system_name.$system_domain $system_name" >> /etc/hosts
## Tmp fix, copy the init.d script for puppet agent. This should be included in puppet package install.
wget -O /etc/init.d/puppet "http://$server:$http_port/cobbler/aux/puppet"
chmod 755 /etc/init.d/puppet
echo "[agent]" >> /etc/puppet/puppet.conf
echo " pluginsync = true" >> /etc/puppet/puppet.conf
echo " ignorecache = true" >> /etc/puppet/puppet.conf
echo " usecacheonfailure = false" >> /etc/puppet/puppet.conf
echo " listen = true" >> /etc/puppet/puppet.conf
echo " ordering = manifest" >> /etc/puppet/puppet.conf
echo " stringify_facts = false" >> /etc/puppet/puppet.conf
echo "[main]" >> /etc/puppet/puppet.conf
echo "runinterval=60" >> /etc/puppet/puppet.conf
cat >/tmp/puppet-auth.conf <<EOF
# Allow puppet kick access
path /run
method save
auth any
# allow $server.$system_domain
allow *
EOF
cat /etc/puppet/auth.conf >> /tmp/puppet-auth.conf
cp -f /tmp/puppet-auth.conf /etc/puppet/auth.conf
# Tempprary patch to work around puppet issue of custom facts not working. The custom
# fact scripts get installed with incorrect permissions (no execute permission). This
# results in custom facts not working. Putting a hot patch to work around this problem.
# could be removed once puppet issue is resolved. Abhay
sed -i "s/initialize(name, path, source, ignore = nil, environment = nil, source_permissions = :ignore)/initialize(name, path, source, ignore = nil, environment = nil, source_permissions = :use)/g" /usr/share/ruby/vendor_ruby/puppet/configurer/downloader.rb
# disable selinux and iptables
sed -i 's/SELINUX=.*/SELINUX=disabled/g' /etc/selinux/config
service iptables stop
/sbin/chkconfig iptables off
$SNIPPET('download_config_files')
$SNIPPET('koan_environment')
$SNIPPET('redhat_register')
$SNIPPET('cobbler_register')
# Enable post-install boot notification
## $SNIPPET('post_anamon')
# Start final steps
$SNIPPET('kickstart_done')
# End final steps
%end