summaryrefslogtreecommitdiffstats
path: root/views/el7.ks.erb
blob: 3a837a4998910638d10bd2678c8a6e96319ed7fa (plain)
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
148
149
150
151
152
153
154
155
install
reboot
text
url --url=http://mirror.switch.ch/ftp/mirror/centos/7/os/<%= arch %>/
lang en_US.UTF-8
keyboard sg-latin1
rootpw --iscrypted <%= rootpw %>
firewall --enabled --port=22:tcp
authconfig --enableshadow --passalgo=sha512 --disablefingerprint
services --disabled fcoe,ip6tables,iptables,iscsi,iscsid,lldpad,netfs,nfslock,rpcbind,rpcgssd,rpcidmapd,udev-post,lvm2-monitor,postfix,avahi-daemon,hal,kudzu,autofs,readahead,kdump,NetworkManager
# let's run puppet on first run
services --enabled puppet
timezone --utc <%= location %>
bootloader --location=mbr
firstboot --disable

zerombr
<% if ['kvm'].include?(virt)
  disk = 'vda'
  pvsize = 1
elsif virt == 'physical'
  disk = 'sda'
  pvsize = 20480
else
  raise "virt is not yet supported"
end %>

clearpart --initlabel --all --drives=<%= disk %>
ignoredisk --only-use=<%= disk %>
part /boot --fstype ext4 --size=512 --ondrive=<%= disk %>
part pv.01 --size=<%= pvsize %> --grow --ondrive=<%= disk %>
volgroup vg-<%= hostname=fqdn.split('.').first %> pv.01
logvol  /tmp  --vgname=vg-<%= hostname %> --size=1024      --name=tmp  --fstype=ext4
logvol  swap  --vgname=vg-<%= hostname %> --size=1024      --name=swap --fstype=swap
logvol  /     --vgname=vg-<%= hostname %> --size=1 --grow  --name=root --fstype=ext4

<% interfaces.keys.reject{|i| i =~ /:/ }.sort.each_with_index do |inf,i|
  values = interfaces[inf] %>
network --device=<%= inf %> --bootproto=static --ip=<%= values['ip'] %> --netmask=<%= values['netmask'] %> <%= "--gateway=#{values['gateway']} " unless values['gateway'].nil? %><% if i == 0 %><%= " --nameserver=#{values['nameserver']} --hostname=#{fqdn}" %><% end %>
<% end %>

repo --name=centos.7.<%= arch %>.os --baseurl=http://mirror.switch.ch/ftp/mirror/centos/7/os/<%= arch %>/
repo --name=centos.7.<%= arch %>.updates --baseurl=http://mirror.switch.ch/ftp/mirror/centos/7/updates/<%= arch %>/
repo --name=centos.7.<%= arch %>.cr --baseurl=http://mirror.switch.ch/ftp/mirror/centos/7/cr/<%= arch %>/
repo --name=centos.7.<%= arch %>.epel --baseurl=http://mirror.switch.ch/ftp/mirror/epel/7/<%= arch %>/
repo --name=centos.7.<%= arch %>.extras --baseurl=http://mirror.switch.ch/ftp/mirror/centos/7/extras/<%= arch %>/
repo --name=centos.7.<%= arch %>.glei --baseurl=http://yum.glei.ch/el7/<%= arch %>/
repo --name=centos.7.<%= arch %>.puppet --baseurl=http://yum.puppetlabs.com/puppet/el/7/x86_64/


%packages
irqbalance
man-pages
mlocate
openssh-clients
openssh-server
tcp_wrappers
vim-enhanced
wget
which
virt-what
policycoreutils-python
selinux-policy-devel
acpid
iptables-services
tmpwatch
-bluez-utils
-firstboot-tui
-kudzu
-system-config-network-tui
-cpuspeed
-pcsc-lite
-ccid
-coolkey
-ifd-egate
-readahead
-oddjob
-NetworkManager
-NetworkManager-tui
-dhcdbd
-aspell
-Deployment_Guide-en-US
-desktop-file-utils
-htmlview
-pinfo
-redhat-menus
-dos2unix
-dosfstools
-mkbootdisk
-fbset
-pcmciautils
-system-config-securitylevel-tui
-wireless-tools
-rhpl
-wpa_supplicant

-microcode_ctl
-iwl*
-*firmware
-smartmontools
-iprutils

-redhat-lsb-core
-dracut-config-rescue

puppet-agent
puppet-release

# packages that are used on all systems
epel-release
yum-plugin-priorities
deltarpm
yum-cron
rkhunter
prelink
tmux
screen
shorewall
bash-completion
haveged
ekeyd-egd-linux
munin-node
mc
denyhosts
cryptsetup
gpm
chrony
%end

%post

<% interfaces.keys.select{|i| i =~ /:/ }.each do |inf|
  values = interfaces[inf] %>
cat <<-EOF >/etc/sysconfig/network-scripts/ifcfg-<%= inf %>
DEVICE=<%= inf %>
ONBOOT=yes
BOOTPROTO=static
IPADDR=<%= values['ip'] %>
NETMASK=<%= values['netmask'] %>
EOF
<% end %>

if [ -f /etc/sysconfig/network-scripts/ifcfg-eth0 ]; then
  sed -i 's/GATEWAY0/GATEWAY/' /etc/sysconfig/network-scripts/ifcfg-eth0
fi

[ -d /etc/puppetlabs/puppet/ssl/certs ] || mkdir -p /etc/puppetlabs/puppet/ssl/certs
cat <<-EOF >/etc/puppetlabs/puppet/ssl/certs/ca.pem
<%= File.read('/srv/puppet/ssl/certs/ca.pem') %>
EOF

echo -e '[main]\nserver=puppet.glei.ch' >> /etc/puppetlabs/puppet/puppet.conf

%end