move blacklisting into separate kickstart include
[ovirt-node-image.git] / common-post.ks
blob7497b20a7a6248810a325ea4185eb191ecd1f012
1 # -*-Shell-script-*-
2 echo "Starting Kickstart Post"
3 PATH=/sbin:/usr/sbin:/bin:/usr/bin
4 export PATH
6 echo "Running ovirt-install-host stateless"
7 /usr/sbin/ovirt-install-node stateless
9 echo "Creating shadow files"
10 # because we aren't installing authconfig, we aren't setting up shadow
11 # and gshadow properly.  Do it by hand here
12 pwconv
13 grpconv
15 echo "Forcing C locale"
16 # force logins (via ssh, etc) to use C locale, since we remove locales
17 cat >> /etc/profile << \EOF
18 # oVirt: force our locale to C since we don't have locale stuff'
19 export LC_ALL=C LANG=C
20 EOF
22 echo "Configuring IPTables"
23 # here, we need to punch the appropriate holes in the firewall
24 cat > /etc/sysconfig/iptables << \EOF
25 # oVirt automatically generated firewall configuration
26 *filter
27 :INPUT ACCEPT [0:0]
28 :FORWARD ACCEPT [0:0]
29 :OUTPUT ACCEPT [0:0]
30 -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
31 -A INPUT -p icmp -j ACCEPT
32 -A INPUT -i lo -j ACCEPT
33 # libvirt
34 -A INPUT -p tcp --dport 16509 -j ACCEPT
35 # SSH
36 -A INPUT -p tcp --dport 22 -j ACCEPT
37 # VNC consoles
38 -A INPUT -p tcp -m multiport --dports 5900:6000 -j ACCEPT
39 # migration
40 -A INPUT -p tcp -m multiport --dports 49152:49216 -j ACCEPT
41 -A INPUT -j REJECT --reject-with icmp-host-prohibited
42 -A FORWARD -m physdev ! --physdev-is-bridged -j REJECT --reject-with icmp-host-prohibited
43 COMMIT
44 EOF