-
Notifications
You must be signed in to change notification settings - Fork 1
/
centos66-oz.tdl
99 lines (79 loc) · 2.47 KB
/
centos66-oz.tdl
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
<template>
<name>centos65_x86_64-PD</name>
<description>Centos 6.5 x86_64 template</description>
<disk>
<size>3G</size>
</disk>
<os>
<name>CentOS-6</name>
<version>5</version>
<arch>x86_64</arch>
<install type='iso'>
<iso>http://mirror3.mirror.garr.it/mirrors/CentOS/6.5/isos/x86_64/CentOS-6.5-x86_64-minimal.iso</iso>
</install>
</os>
<files>
<file name="/etc/sysconfig/network">
NETWORKING=yes
NOZEROCONF=yes
</file>
<file name="/etc/sysconfig/network-scripts/ifcfg-eth0">
DEVICE=eth0
BOOTPROTO=dhcp
ONBOOT=yes
TYPE=Ethernet
</file>
<file name="/etc/ntp.conf">
server ntp.pd.infn.it
</file>
</files>
<commands>
<command name="removeudevnet">
rm -f /etc/udev/rules.d/70-persistent-net.rules
rm -f /lib/udev/rules.d/75-persistent-net-generator.rules
</command>
<command name="epel">
rpm --import http://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL
rpm --import http://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-6
rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
</command>
<command name="cloud-user">
adduser cloud-user -G adm,wheel
</command>
<command name="nopwdwheel">
echo "%wheel ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
</command>
<command name="setlocaltime">
rm -f /etc/localtime
ln -s /usr/share/zoneinfo/Europe/Rome /etc/localtime
</command>
<command name="setntpdon">
/sbin/chkconfig ntpd on
</command>
<command name="mkinitrd">
mkinitrd --with virtio_pci --with virtio_ring --with virtio_blk --with virtio_net --with virtio_balloon --with virtio -f /boot/initramfs-$(ls /lib/modules/).img $(ls /lib/modules/)
</command>
<command name="update">
yum update -y
</command>
<command name="packages">
yum install -y cloud-init cloud-utils cloud-utils-growpart dracut-modules-growroot nc httpd parted git
</command>
<command name="installresizefs">
cd /tmp
git clone https://github.com/CloudPadovana/qcow2-resizable-images.git
cd qcow2-resizable-images/linux-rootfs-resize
chmod +x ./install
./install
</command>
<command name="sethostname_always">
sed -i 's/set_hostname/[set_hostname, always]/g' /etc/cloud/cloud.cfg
</command>
<command name="makeunchangableudevnet">
touch /etc/udev/rules.d/70-persistent-net.rules
touch /lib/udev/rules.d/75-persistent-net-generator.rules
chattr +i /etc/udev/rules.d/70-persistent-net.rules
chattr +i /lib/udev/rules.d/75-persistent-net-generator.rules
</command>
</commands>
</template>