-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathks.cfg
152 lines (125 loc) · 3.82 KB
/
ks.cfg
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
# Install a fresh new system (optional)
install
# Specify installation method to use for installation
# To use a different one comment out the 'url' one below, update
# the selected choice with proper options & un-comment it
cdrom
# Set language to use during installation and the default language to use on the installed system (required)
lang en_US.UTF-8
# Set system keyboard type / layout (required)
keyboard se
# Configure network information for target system and activate network devices in the installer environment (optional)
# --onboot enable device at a boot time
# --device device to be activated and / or configured with the network command
# --bootproto method to obtain networking configuration for device (default dhcp)
# --noipv6 disable IPv6 on this device
# To use static IP configuration,
network --onboot yes --device ens192 --bootproto=dhcp --noipv6 --hostname CentOS7Template
# Set the system's root password (required)
# Plaintext password is: server
rootpw --iscrypted $6$rhel6usgcb$aS6oPGXcPKp3OtFArSrhRwu6sN8q2.yEGY7AIwDOQd23YCtiz9c5mXbid1BzX9bmXTEZi.hCzTEXFosVBI5ng0
# Configure firewall settings for the system (optional)
# --enabled reject incoming connections that are not in response to outbound requests
# --ssh allow sshd service through the firewall
# firewall --enabled --ssh
firewall --disabled
# Set up the authentication options for the system (required)
# --enableshadow enable shadowed passwords by default
# --passalgo hash / crypt algorithm for new passwords
# See the manual page for authconfig for a complete list of possible options.
authconfig --enableshadow --passalgo=sha512
# State of SELinux on the installed system (optional)
# Defaults to enforcing
selinux --permissive
# Set the system time zone (required)
timezone --utc Europe/Stockholm
# Specify how the bootloader should be installed (required)
# Plaintext password is: password
bootloader --location=mbr --append="crashkernel=auto rhgb quiet" --password=$6$rhel6usgcb$kOzIfC4zLbuo3ECp1er99NRYikN419wxYMmons8Vm/37Qtg0T8aB9dKxHwqapz8wWAFuVkuI/UJqQBU92bA5C0
autopart --nohome --type=lvm
# Initialize all disks
clearpart --linux --initlabel
# Packages selection
%packages --ignoremissing
Require @Base
@Base
@core
sed
perl
less
dmidecode
bzip2
iproute
iputils
sysfsutils
rsync
nano
mdadm
setserial
man-pages.noarch
findutils
tar
net-tools
tmpwatch
lsof
python
screen
lvm2
curl
ypbind
yp-tools
smartmontools
openssh-clients
acpid
irqbalance
which
bind-utils
ntsysv
ntp
man
#mysql
postfix
chkconfig
gzip
%end
# End of %packages section
%post --log=/var/log/post.log
exec < /dev/tty3 > /dev/tty3
chvt 3
echo "################################"
echo "# Running Post Configuration #"
echo "################################"
echo "exclude=kernel*" >> /etc/yum.conf
echo -e "LANG=en_US.utf-8\nLC_ALL=en_US.utf-8" >> /etc/environment
#Extend LVM volume
lvextend -l 100%FREE /dev/mapper/centos_centos7template-root
xfs_growfs /dev/mapper/centos_centos7template-root
# update the system
yum update -y
#Setting docker-repo
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
#Install Python3
yum install -y python3
#Installing docker
yum install -y docker-ce docker-ce-cli containerd.io
#Install docker-compose
curl -L "https://github.com/docker/compose/releases/download/1.23.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
#Install java package
yum install -y java-1.8.0-openjdk
#enable docker
systemctl enable docker && systemctl start docker
---
chkconfig ntpd on
chkconfig sshd on
chkconfig ypbind on
chkconfig iptables off
chkconfig ip6tables off
chkconfig yum-updatesd off
chkconfig haldaemon off
chkconfig mcstrans off
chkconfig sysstat off
%end
# Reboot after the installation is complete (optional)
# --eject attempt to eject CD or DVD media before rebooting
reboot --eject