質問編集履歴
8
自己解決
title
CHANGED
File without changes
|
body
CHANGED
@@ -9,49 +9,41 @@
|
|
9
9
|
・今後、VLAN等ややこしい設定をする可能性がある
|
10
10
|
という理由からです。
|
11
11
|
|
12
|
-
# 困ってい
|
12
|
+
# 困っていたこと1
|
13
13
|
A stop job is running for Anaconda と表示され、1分30秒待たされます。
|
14
14
|
待たされるだけで、OSインストール, post script は
|
15
15
|
問題なく完了してそうなのですが、
|
16
16
|
間違くないのと、表示がなんとなく気持ち悪いので、
|
17
17
|
標示させず、待たずにすむようにしたいです。
|
18
|
-
**->postスクリプトを2回書いてることで、表示されているようで
|
18
|
+
**->postスクリプトを2回書いてることで、表示されているようでした**
|
19
|
-
|
20
|
-
# 表示されているメッセージについて
|
21
|
-
kickstart の post script を書いてから、標示されるようになりました。
|
22
19
|

|
23
20
|
|
24
|
-
# 困ってい
|
21
|
+
# 困っていたこと2
|
25
22
|
nmcliでネットワーク設定をする場合、--nochroot 環境で nmcliを実行してから、
|
26
23
|
cp -p /etc/sysconfig/network-scripts/ifcfg-* /mnt/sysimage/etc/sysconfig/network-scripts/
|
27
24
|
する必要があるみたいで、2回 post を書いています。
|
28
25
|
|
26
|
+
|
29
27
|
# 試してみたこと
|
30
|
-
|
28
|
+
・postを2回書くのをやめて、pre, postに分けた。
|
31
|
-
ls -al /mnt/sysimage/bin/bash で bash があったので、
|
32
|
-
yum update -y する前に
|
33
|
-
chroot /mnt/sysimage/ したのですが、
|
34
|
-
|
29
|
+
・IPを振る部分をshellscriptに分けて、cron@rebootで呼び出すようにした
|
35
|
-
どのように設定するかで悩んでいます。
|
36
30
|
|
37
31
|
# Kickstartの内容について
|
38
|
-
kickstart は 以下のような内容にな
|
32
|
+
最終的な kickstart は 以下のような内容になりました。
|
39
33
|
```
|
40
|
-
cat << '
|
34
|
+
cat << 'EOC' > /var/pxe/ks/centos82-minimal.cfg
|
41
35
|
#version=RHEL8
|
42
36
|
|
43
37
|
# Reboot after installation
|
44
38
|
reboot
|
45
39
|
|
46
40
|
# Use network installation
|
47
|
-
url --url http://
|
41
|
+
url --url http://10.10.10.100/centos82-minimal/
|
48
|
-
repo --name=Minimal --baseurl=http://
|
42
|
+
repo --name=Minimal --baseurl=http://10.10.10.100/centos82-minimal/Minimal
|
49
43
|
|
50
44
|
# Use text mode install
|
51
45
|
text
|
52
46
|
|
53
|
-
# Run the Setup Agent on first boot
|
54
|
-
firstboot --enable
|
55
47
|
ignoredisk --only-use=nvme0n1
|
56
48
|
|
57
49
|
# Keyboard layouts
|
@@ -60,13 +52,15 @@
|
|
60
52
|
# System language
|
61
53
|
lang en_US.UTF-8
|
62
54
|
|
55
|
+
# Logging rsyslog
|
56
|
+
logging --host=10.10.10.100 --port=514 --level=debug
|
57
|
+
|
63
58
|
# Network information
|
64
|
-
# network --device=br0 --bridgeslaves=eth0 --bootproto=static --ip=192.168.1.222 --netmask=255.255.255.0 --gateway=192.168.1.1 --nameserver=8.8.8.8 --noipv6 --activate
|
65
|
-
# network --device=br0 --bridgeslaves=eth0 --
|
59
|
+
# network --bootproto=static --device=br0 --bridgeslaves=eth0 --ip=10.10.10.222 --netmask=255.255.255.0 --gateway=10.10.10.1 --nameserver=8.8.8.8 --noipv6 --activate
|
66
60
|
network --hostname=localhost.localdomain
|
67
61
|
|
68
62
|
# Root password
|
69
|
-
rootpw --iscrypted
|
63
|
+
rootpw --iscrypted passpassworddd
|
70
64
|
|
71
65
|
# SELinux configuration
|
72
66
|
selinux --disabled
|
@@ -117,125 +111,124 @@
|
|
117
111
|
pwpolicy luks --minlen=6 --minquality=1 --notstrict --nochanges --notempty
|
118
112
|
%end
|
119
113
|
|
120
|
-
# Post script 1
|
121
|
-
%post --nochroot --log=/mnt/sysimage/root/post1-ks.log
|
122
114
|
|
115
|
+
|
116
|
+
# Pre script
|
117
|
+
%pre --log=/tmp/ks-pre.log
|
118
|
+
# %post
|
119
|
+
# exec < /dev/tty3 | tee -a /tmp/ks-pre.log > /dev/tty3
|
123
|
-
|
120
|
+
# /usr/bin/chvt 3
|
121
|
+
# set -x
|
122
|
+
echo "################################"
|
123
|
+
echo "# Running Pre Configuration #"
|
124
|
+
echo "################################"
|
125
|
+
|
124
126
|
nmcli c
|
127
|
+
nmcli c a type bridge con-name br0 ifname br0 stp no autoconnect yes
|
125
|
-
|
128
|
+
nmcli c m br0 ipv4.method auto
|
129
|
+
nmcli c a type bridge-slave con-name eth0 ifname eth0 master br0 autoconnect yes
|
130
|
+
nmcli c
|
131
|
+
cp -p /etc/sysconfig/network-scripts/ifcfg-* /mnt/sysimage/etc/sysconfig/network-scripts/
|
126
132
|
|
127
|
-
|
133
|
+
# /usr/bin/chvt 1
|
128
|
-
ls -al /mnt/sysimage/etc/sysconfig/network-scripts/ifcfg-*
|
129
|
-
ls -al /etc/sysconfig/network-scripts/ifcfg-*
|
130
|
-
|
134
|
+
%end
|
131
135
|
|
132
|
-
# Set static ip
|
133
|
-
nmcli c a type ethernet ifname eth0 con-name eth0
|
134
|
-
nmcli c a type bridge con-name br0 ifname br0 autoconnect yes
|
135
|
-
nmcli c m br0 bridge.stp no
|
136
|
-
for i in 151 152 153 final; do
|
137
|
-
test $i = "final" && nmcli c m br0 ipv4.method auto
|
138
136
|
|
137
|
+
|
138
|
+
# Post script
|
139
|
+
%post --log=/root/ks-post.log
|
140
|
+
# %post
|
141
|
+
# exec < /dev/tty3 | tee -a /root/ks-post.log > /dev/tty3
|
142
|
+
# /usr/bin/chvt 3
|
143
|
+
# set -x
|
144
|
+
echo "################################"
|
145
|
+
echo "# Running Post Configuration #"
|
146
|
+
echo "################################"
|
147
|
+
|
148
|
+
# Save post script log
|
149
|
+
cat << "EOF" > /root/ks-pre.log
|
150
|
+
%include /tmp/ks-pre.log
|
151
|
+
EOF
|
152
|
+
|
153
|
+
# Delete default nic
|
154
|
+
ls -al /etc/sysconfig/network-scripts/
|
155
|
+
find /etc/sysconfig/network-scripts/ -type f -name 'ifcfg-*' | grep -v -e lo$ -e br0$ -e eth0$ | xargs rm -f
|
156
|
+
ls -al /etc/sysconfig/network-scripts/
|
157
|
+
|
158
|
+
# Set shellscript
|
159
|
+
# =============================================================================================================================
|
160
|
+
cat << 'EOS' > /root/firstboot.sh
|
161
|
+
#/bin/bash
|
162
|
+
set -x
|
163
|
+
|
164
|
+
limit=300
|
165
|
+
for i in $(seq 1 $limit); do echo -n "${i} @ $(date '+%Y-%m-%d %H:%M:%S,%3N')" ; ping -c3 -i0.5 10.10.10.1 > /dev/null 2>&1 && break ; sleep 0.3s ; done
|
166
|
+
if [ $i -eq $limit ]; then echo 'orz_OTZ @ cannot ping default gateway' ; exit ; fi
|
167
|
+
|
168
|
+
logger -n 10.10.10.100 -t "firstboot.sh[$$]" -p user.info 'script started'
|
169
|
+
|
170
|
+
rm -f $0
|
171
|
+
rm -f /etc/cron.d/firstboot.cron
|
172
|
+
|
173
|
+
for i in 151 152 153 999 ; do
|
139
|
-
ping -
|
174
|
+
ping -c3 10.10.10.$i && continue
|
140
|
-
|
175
|
+
ip="10.10.10.${i}"
|
141
176
|
break
|
142
177
|
done
|
143
|
-
nmcli c m eth0 master br0 connection.slave-type bridge
|
144
|
-
rm -rf /mnt/sysimage/etc/sysconfig/network-scripts/ifcfg-*
|
145
|
-
cp -p /etc/sysconfig/network-scripts/ifcfg-* /mnt/sysimage/etc/sysconfig/network-scripts/
|
146
178
|
|
147
|
-
|
179
|
+
if [ "$ip" = "10.10.10.999" ]; then
|
180
|
+
logger -n 10.10.10.100 -t "firstboot.sh[$$]" -p user.warning "orz_OTZ @ 10.10.10.151-153 is already used"
|
181
|
+
else
|
182
|
+
logger -n 10.10.10.100 -t "firstboot.sh[$$]" -p user.info "ping ${ip} is ok"
|
148
|
-
|
183
|
+
nmcli c m br0 ipv4.method manual ipv4.address 10.10.10.$i/24 ipv4.gateway 10.10.10.1 ipv4.dns 8.8.8.8
|
184
|
+
nmcli c up br0
|
185
|
+
fi
|
186
|
+
nmcli c
|
149
187
|
ls -al /etc/sysconfig/network-scripts/ifcfg-*
|
150
|
-
echo '/mnt/sysimage/ ==='
|
151
188
|
|
152
|
-
|
189
|
+
logger -n 10.10.10.100 -t "firstboot.sh[$$]" -p user.info "yum update"
|
153
|
-
nmcli c
|
154
|
-
echo 'nmcli c ==='
|
155
190
|
|
156
|
-
|
191
|
+
yum update -y
|
192
|
+
yum install -y rsyslog bash-completion vim git rsync
|
157
193
|
|
158
|
-
# Post script 2
|
159
|
-
|
194
|
+
cat << 'EOF' > /etc/rsyslog.d/pxe.conf
|
160
|
-
|
195
|
+
*.info;mail.none;authpriv.none;cron.none /var/log/messages
|
161
|
-
|
196
|
+
authpriv.* /var/log/secure
|
197
|
+
mail.* -/var/log/maillog
|
198
|
+
cron.* /var/log/cron
|
162
|
-
|
199
|
+
*.emerg :omusrmsg:*
|
200
|
+
uucp,news.crit /var/log/spooler
|
201
|
+
local7.* /var/log/boot.log
|
202
|
+
*.* @10.10.10.100
|
203
|
+
EOF
|
204
|
+
|
163
205
|
mkdir -p /root/git
|
164
206
|
cd /root/git/
|
165
207
|
git clone https://github.com/teityura/dotfiles.git
|
166
208
|
cd dotfiles/
|
167
209
|
rsync -av ./. /root/ --exclude .git/
|
168
210
|
lvcreate -s -n lv_root_01_deployed vg1/lv_root
|
169
|
-
%end
|
170
211
|
|
212
|
+
yum install -y epel-release
|
213
|
+
yum install -y sl
|
171
|
-
|
214
|
+
export TERM=xterm
|
172
|
-
|
215
|
+
(sl ; clear ; echo 'Please enter login user, password ! q-(-_-)-p') > /dev/tty1 &
|
173
216
|
|
174
|
-
### ログ
|
175
|
-
```
|
176
|
-
[root@localhost ~]# less post1-ks.log
|
177
|
-
nmcli c ===
|
178
|
-
NAME UUID TYPE DEVICE
|
179
|
-
eno1 6f2660f6-89df-4a19-9b6e-58d2d8b0bdb6 ethernet eno1
|
180
|
-
nmcli c ===
|
181
|
-
/mnt/sysimage/ ===
|
182
|
-
-rw-r--r--. 1 root root 164 Oct 1 15:06 /mnt/sysimage/etc/sysconfig/network-scripts/ifcfg-eno1
|
183
|
-
-
|
217
|
+
logger -n 10.10.10.100 -t "firstboot.sh[$$]" -p user.info 'script ended'
|
184
|
-
|
218
|
+
exec $SHELL --login
|
219
|
+
EOS
|
185
|
-
|
220
|
+
# =============================================================================================================================
|
186
|
-
Connection 'br0' (5568f601-6347-4eab-a9d1-ebfe5911d463) successfully added.
|
187
|
-
PING 192.168.1.151 (192.168.1.151) 56(84) bytes of data.
|
188
|
-
From 192.168.1.59 icmp_seq=1 Destination Host Unreachable
|
189
221
|
|
222
|
+
# Set cron
|
223
|
+
cat << 'EOF' > /etc/cron.d/firstboot.cron
|
190
|
-
|
224
|
+
SHELL=/bin/bash
|
225
|
+
PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
226
|
+
MAILTO=root
|
227
|
+
HOME=/root
|
191
|
-
|
228
|
+
@reboot root bash firstboot.sh > /root/firstboot-sh.log 2>&1
|
229
|
+
EOF
|
192
230
|
|
193
|
-
/
|
231
|
+
# /usr/bin/chvt 1
|
194
|
-
-rw-r--r--. 1 root root 345 Oct 1 15:07 /mnt/sysimage/etc/sysconfig/network-scripts/ifcfg-br0
|
195
|
-
-rw-r--r--. 1 root root 164 Oct 1 15:04 /mnt/sysimage/etc/sysconfig/network-scripts/ifcfg-eno1
|
196
|
-
-rw-r--r--. 1 root root 169 Oct 1 15:07 /mnt/sysimage/etc/sysconfig/network-scripts/ifcfg-eth0
|
197
|
-
-rw-r--r--. 1 root root 345 Oct 1 15:07 /etc/sysconfig/network-scripts/ifcfg-br0
|
198
|
-
-rw-r--r--. 1 root root 164 Oct 1 15:04 /etc/sysconfig/network-scripts/ifcfg-eno1
|
199
|
-
-rw-r--r--. 1 root root 169 Oct 1 15:07 /etc/sysconfig/network-scripts/ifcfg-eth0
|
200
|
-
/mnt/sysimage/ ===
|
201
|
-
nmcli c ===
|
202
|
-
NAME UUID TYPE DEVICE
|
203
|
-
br0 5568f601-6347-4eab-a9d1-ebfe5911d463 bridge br0
|
204
|
-
eno1 6f2660f6-89df-4a19-9b6e-58d2d8b0bdb6 ethernet eno1
|
205
|
-
eth0 cbabcac8-b269-486b-82ad-2258e00f4737 ethernet --
|
206
|
-
nmcli c ===
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
[root@localhost ~]# less post2-ks.log
|
211
|
-
CentOS-8 - AppStream 9.1 MB/s | 5.8 MB 00:00
|
212
|
-
CentOS-8 - Base 3.0 MB/s | 2.2 MB 00:00
|
213
|
-
CentOS-8 - Extras 17 kB/s | 8.1 kB 00:00
|
214
|
-
Dependencies resolved.
|
215
|
-
======================================================================================
|
216
|
-
Package Arch Version Repo Size
|
217
|
-
======================================================================================
|
218
|
-
|
232
|
+
%end
|
219
|
-
kernel x86_64 4.18.0-193.19.1.el8_2 BaseOS 2.8 M
|
220
|
-
|
233
|
+
EOC
|
221
|
-
Complete!
|
222
|
-
(略)
|
223
|
-
================================================================================
|
224
|
-
Package Arch Version Repository Size
|
225
|
-
================================================================================
|
226
|
-
Installing:
|
227
|
-
git x86_64 2.18.4-2.el8_2 AppStream 186 kg
|
228
|
-
(略)
|
229
|
-
Complete!
|
230
|
-
Cloning into 'dotfiles'...
|
231
|
-
sending incremental file list
|
232
|
-
./
|
233
|
-
.bash_logout
|
234
|
-
sent 17,668 bytes received 233 bytes 35,802.00 bytes/sec
|
235
|
-
total size is 16,830 speedup is 0.94
|
236
|
-
WARNING: Sum of all thin volume sizes (1.12 TiB) exceeds the size of thin pool vg1/pool1 and the size of whole volume group (930.82 GiB).
|
237
|
-
WARNING: You have not turned on protection against thin pools running out of space.
|
238
|
-
WARNING: Set activation/thin_pool_autoextend_threshold below 100 to trigger automatic extension of thin pools before they get full.
|
239
|
-
Logical volume "lv_root_01_deployed" created.
|
240
|
-
# ログここで終わり
|
241
234
|
```
|
7
修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# やりたいこと
|
2
2
|
PXEBoot, kickstart で OSインストールする際、
|
3
3
|
[192.168.1.151, 192.168.1.152, 192.168.1.153] のうち、
|
4
|
-
使用されてないIPを設定するように、postスクリプト等を設定したい。
|
4
|
+
使用されてないIPを設定するように、postスクリプト等を設定したいです。
|
5
|
-
(インストールするOSはCentOS8.2
|
5
|
+
(インストールするOSは CentOS8.2 になります)
|
6
6
|
|
7
7
|
kickstart で network を 使わず nmcli を使っているのは、
|
8
8
|
・スクリプトで割り当てる際に便利そう
|
@@ -15,10 +15,10 @@
|
|
15
15
|
問題なく完了してそうなのですが、
|
16
16
|
間違くないのと、表示がなんとなく気持ち悪いので、
|
17
17
|
標示させず、待たずにすむようにしたいです。
|
18
|
+
**->postスクリプトを2回書いてることで、表示されているようです**
|
18
19
|
|
19
20
|
# 表示されているメッセージについて
|
20
21
|
kickstart の post script を書いてから、標示されるようになりました。
|
21
|
-
**->postスクリプトを2回書いてることで、表示されているようです**
|
22
22
|

|
23
23
|
|
24
24
|
# 困っていること2
|
6
ログ追加, 質問追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,3 +1,14 @@
|
|
1
|
+
# やりたいこと
|
2
|
+
PXEBoot, kickstart で OSインストールする際、
|
3
|
+
[192.168.1.151, 192.168.1.152, 192.168.1.153] のうち、
|
4
|
+
使用されてないIPを設定するように、postスクリプト等を設定したい。
|
5
|
+
(インストールするOSはCentOS8.2 です)
|
6
|
+
|
7
|
+
kickstart で network を 使わず nmcli を使っているのは、
|
8
|
+
・スクリプトで割り当てる際に便利そう
|
9
|
+
・今後、VLAN等ややこしい設定をする可能性がある
|
10
|
+
という理由からです。
|
11
|
+
|
1
12
|
# 困っていること
|
2
13
|
A stop job is running for Anaconda と表示され、1分30秒待たされます。
|
3
14
|
待たされるだけで、OSインストール, post script は
|
@@ -5,14 +16,24 @@
|
|
5
16
|
間違くないのと、表示がなんとなく気持ち悪いので、
|
6
17
|
標示させず、待たずにすむようにしたいです。
|
7
18
|
|
8
|
-
環境は CentOS8.2 です
|
9
|
-
|
10
|
-
|
11
19
|
# 表示されているメッセージについて
|
12
|
-
kickstart の post script を書いてから
|
20
|
+
kickstart の post script を書いてから、標示されるようになりました。
|
13
|
-
|
21
|
+
**->postスクリプトを2回書いてることで、表示されているようです**
|
14
22
|

|
15
23
|
|
24
|
+
# 困っていること2
|
25
|
+
nmcliでネットワーク設定をする場合、--nochroot 環境で nmcliを実行してから、
|
26
|
+
cp -p /etc/sysconfig/network-scripts/ifcfg-* /mnt/sysimage/etc/sysconfig/network-scripts/
|
27
|
+
する必要があるみたいで、2回 post を書いています。
|
28
|
+
|
29
|
+
# 試してみたこと
|
30
|
+
kickstart の post 実行中に
|
31
|
+
ls -al /mnt/sysimage/bin/bash で bash があったので、
|
32
|
+
yum update -y する前に
|
33
|
+
chroot /mnt/sysimage/ したのですが、
|
34
|
+
yum update が実行せずに、lvcreate のみ実行されるような動きをしており、
|
35
|
+
どのように設定するかで悩んでいます。
|
36
|
+
|
16
37
|
# Kickstartの内容について
|
17
38
|
kickstart は 以下のような内容になっています。
|
18
39
|
```
|
@@ -97,7 +118,7 @@
|
|
97
118
|
%end
|
98
119
|
|
99
120
|
# Post script 1
|
100
|
-
%post --nochroot --log=/mnt/sysimage/root/
|
121
|
+
%post --nochroot --log=/mnt/sysimage/root/post1-ks.log
|
101
122
|
|
102
123
|
echo 'nmcli c ==='
|
103
124
|
nmcli c
|
@@ -135,7 +156,7 @@
|
|
135
156
|
%end
|
136
157
|
|
137
158
|
# Post script 2
|
138
|
-
%post --log=/root/
|
159
|
+
%post --log=/root/post2-ks.log
|
139
160
|
# Setup and snapshot
|
140
161
|
yum update -y
|
141
162
|
yum install -y bash-completion vim git rsync
|
@@ -148,6 +169,73 @@
|
|
148
169
|
%end
|
149
170
|
|
150
171
|
EOF
|
172
|
+
```
|
151
173
|
|
174
|
+
### ログ
|
175
|
+
```
|
176
|
+
[root@localhost ~]# less post1-ks.log
|
177
|
+
nmcli c ===
|
178
|
+
NAME UUID TYPE DEVICE
|
179
|
+
eno1 6f2660f6-89df-4a19-9b6e-58d2d8b0bdb6 ethernet eno1
|
180
|
+
nmcli c ===
|
181
|
+
/mnt/sysimage/ ===
|
182
|
+
-rw-r--r--. 1 root root 164 Oct 1 15:06 /mnt/sysimage/etc/sysconfig/network-scripts/ifcfg-eno1
|
183
|
+
-rw-r--r--. 1 root root 164 Oct 1 15:04 /etc/sysconfig/network-scripts/ifcfg-eno1
|
184
|
+
/mnt/sysimage/ ===
|
185
|
+
Connection 'eth0' (cbabcac8-b269-486b-82ad-2258e00f4737) successfully added.
|
186
|
+
Connection 'br0' (5568f601-6347-4eab-a9d1-ebfe5911d463) successfully added.
|
187
|
+
PING 192.168.1.151 (192.168.1.151) 56(84) bytes of data.
|
188
|
+
From 192.168.1.59 icmp_seq=1 Destination Host Unreachable
|
152
189
|
|
190
|
+
--- 192.168.1.151 ping statistics ---
|
191
|
+
1 packets transmitted, 0 received, +1 errors, 100% packet loss, time 0ms
|
192
|
+
|
193
|
+
/mnt/sysimage/ ===
|
194
|
+
-rw-r--r--. 1 root root 345 Oct 1 15:07 /mnt/sysimage/etc/sysconfig/network-scripts/ifcfg-br0
|
195
|
+
-rw-r--r--. 1 root root 164 Oct 1 15:04 /mnt/sysimage/etc/sysconfig/network-scripts/ifcfg-eno1
|
196
|
+
-rw-r--r--. 1 root root 169 Oct 1 15:07 /mnt/sysimage/etc/sysconfig/network-scripts/ifcfg-eth0
|
197
|
+
-rw-r--r--. 1 root root 345 Oct 1 15:07 /etc/sysconfig/network-scripts/ifcfg-br0
|
198
|
+
-rw-r--r--. 1 root root 164 Oct 1 15:04 /etc/sysconfig/network-scripts/ifcfg-eno1
|
199
|
+
-rw-r--r--. 1 root root 169 Oct 1 15:07 /etc/sysconfig/network-scripts/ifcfg-eth0
|
200
|
+
/mnt/sysimage/ ===
|
201
|
+
nmcli c ===
|
202
|
+
NAME UUID TYPE DEVICE
|
203
|
+
br0 5568f601-6347-4eab-a9d1-ebfe5911d463 bridge br0
|
204
|
+
eno1 6f2660f6-89df-4a19-9b6e-58d2d8b0bdb6 ethernet eno1
|
205
|
+
eth0 cbabcac8-b269-486b-82ad-2258e00f4737 ethernet --
|
206
|
+
nmcli c ===
|
207
|
+
|
208
|
+
|
209
|
+
|
210
|
+
[root@localhost ~]# less post2-ks.log
|
211
|
+
CentOS-8 - AppStream 9.1 MB/s | 5.8 MB 00:00
|
212
|
+
CentOS-8 - Base 3.0 MB/s | 2.2 MB 00:00
|
213
|
+
CentOS-8 - Extras 17 kB/s | 8.1 kB 00:00
|
214
|
+
Dependencies resolved.
|
215
|
+
======================================================================================
|
216
|
+
Package Arch Version Repo Size
|
217
|
+
======================================================================================
|
218
|
+
Installing:
|
219
|
+
kernel x86_64 4.18.0-193.19.1.el8_2 BaseOS 2.8 M
|
220
|
+
(略)
|
221
|
+
Complete!
|
222
|
+
(略)
|
223
|
+
================================================================================
|
224
|
+
Package Arch Version Repository Size
|
225
|
+
================================================================================
|
226
|
+
Installing:
|
227
|
+
git x86_64 2.18.4-2.el8_2 AppStream 186 kg
|
228
|
+
(略)
|
229
|
+
Complete!
|
230
|
+
Cloning into 'dotfiles'...
|
231
|
+
sending incremental file list
|
232
|
+
./
|
233
|
+
.bash_logout
|
234
|
+
sent 17,668 bytes received 233 bytes 35,802.00 bytes/sec
|
235
|
+
total size is 16,830 speedup is 0.94
|
236
|
+
WARNING: Sum of all thin volume sizes (1.12 TiB) exceeds the size of thin pool vg1/pool1 and the size of whole volume group (930.82 GiB).
|
237
|
+
WARNING: You have not turned on protection against thin pools running out of space.
|
238
|
+
WARNING: Set activation/thin_pool_autoextend_threshold below 100 to trigger automatic extension of thin pools before they get full.
|
239
|
+
Logical volume "lv_root_01_deployed" created.
|
240
|
+
# ログここで終わり
|
153
241
|
```
|
5
kickstart 修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -97,7 +97,7 @@
|
|
97
97
|
%end
|
98
98
|
|
99
99
|
# Post script 1
|
100
|
-
%post --nochroot --log=/root/
|
100
|
+
%post --nochroot --log=/mnt/sysimage/root/post-ks.log
|
101
101
|
|
102
102
|
echo 'nmcli c ==='
|
103
103
|
nmcli c
|
@@ -135,8 +135,7 @@
|
|
135
135
|
%end
|
136
136
|
|
137
137
|
# Post script 2
|
138
|
-
%post --log=/root/
|
138
|
+
%post --log=/root/post-ks.log
|
139
|
-
|
140
139
|
# Setup and snapshot
|
141
140
|
yum update -y
|
142
141
|
yum install -y bash-completion vim git rsync
|
@@ -150,4 +149,5 @@
|
|
150
149
|
|
151
150
|
EOF
|
152
151
|
|
152
|
+
|
153
153
|
```
|
4
kickstart 修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -45,7 +45,7 @@
|
|
45
45
|
network --hostname=localhost.localdomain
|
46
46
|
|
47
47
|
# Root password
|
48
|
-
rootpw --iscrypted
|
48
|
+
rootpw --iscrypted passpass
|
49
49
|
|
50
50
|
# SELinux configuration
|
51
51
|
selinux --disabled
|
3
kickstart 修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -45,7 +45,7 @@
|
|
45
45
|
network --hostname=localhost.localdomain
|
46
46
|
|
47
47
|
# Root password
|
48
|
-
rootpw --iscrypted
|
48
|
+
rootpw --iscrypted $6$0f5yPKYQO3ggj2vB$hXU8VDtEGAeyU/foHBH9PYTW7imzuLFXGpBSCDbGm0lYLOumZ7bb.Fj8fUYKbmLOMdaCX9hbXr4gf74lDGAzk1
|
49
49
|
|
50
50
|
# SELinux configuration
|
51
51
|
selinux --disabled
|
@@ -96,18 +96,47 @@
|
|
96
96
|
pwpolicy luks --minlen=6 --minquality=1 --notstrict --nochanges --notempty
|
97
97
|
%end
|
98
98
|
|
99
|
+
# Post script 1
|
99
|
-
%post --log=/root/
|
100
|
+
%post --nochroot --log=/root/post1-ks.log
|
101
|
+
|
102
|
+
echo 'nmcli c ==='
|
103
|
+
nmcli c
|
104
|
+
echo 'nmcli c ==='
|
105
|
+
|
106
|
+
echo '/mnt/sysimage/ ==='
|
107
|
+
ls -al /mnt/sysimage/etc/sysconfig/network-scripts/ifcfg-*
|
108
|
+
ls -al /etc/sysconfig/network-scripts/ifcfg-*
|
109
|
+
echo '/mnt/sysimage/ ==='
|
110
|
+
|
100
111
|
# Set static ip
|
101
112
|
nmcli c a type ethernet ifname eth0 con-name eth0
|
102
113
|
nmcli c a type bridge con-name br0 ifname br0 autoconnect yes
|
103
114
|
nmcli c m br0 bridge.stp no
|
104
|
-
for i in 151 152 153; do
|
115
|
+
for i in 151 152 153 final; do
|
116
|
+
test $i = "final" && nmcli c m br0 ipv4.method auto
|
117
|
+
|
105
118
|
ping -c1 192.168.1.$i && continue
|
106
|
-
nmcli c m br0 ipv4.method manual ipv4.address 192.168.1.$i/
|
119
|
+
nmcli c m br0 ipv4.method manual ipv4.address 192.168.1.$i/24 ipv4.gateway 192.168.1.1 ipv4.dns 8.8.8.8
|
107
120
|
break
|
108
121
|
done
|
109
122
|
nmcli c m eth0 master br0 connection.slave-type bridge
|
123
|
+
rm -rf /mnt/sysimage/etc/sysconfig/network-scripts/ifcfg-*
|
124
|
+
cp -p /etc/sysconfig/network-scripts/ifcfg-* /mnt/sysimage/etc/sysconfig/network-scripts/
|
110
125
|
|
126
|
+
echo '/mnt/sysimage/ ==='
|
127
|
+
ls -al /mnt/sysimage/etc/sysconfig/network-scripts/ifcfg-*
|
128
|
+
ls -al /etc/sysconfig/network-scripts/ifcfg-*
|
129
|
+
echo '/mnt/sysimage/ ==='
|
130
|
+
|
131
|
+
echo 'nmcli c ==='
|
132
|
+
nmcli c
|
133
|
+
echo 'nmcli c ==='
|
134
|
+
|
135
|
+
%end
|
136
|
+
|
137
|
+
# Post script 2
|
138
|
+
%post --log=/root/post2-ks.log
|
139
|
+
|
111
140
|
# Setup and snapshot
|
112
141
|
yum update -y
|
113
142
|
yum install -y bash-completion vim git rsync
|
@@ -121,5 +150,4 @@
|
|
121
150
|
|
122
151
|
EOF
|
123
152
|
|
124
|
-
|
125
153
|
```
|
2
kickstart 修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -5,6 +5,9 @@
|
|
5
5
|
間違くないのと、表示がなんとなく気持ち悪いので、
|
6
6
|
標示させず、待たずにすむようにしたいです。
|
7
7
|
|
8
|
+
環境は CentOS8.2 です
|
9
|
+
|
10
|
+
|
8
11
|
# 表示されているメッセージについて
|
9
12
|
kickstart の post script を書いてから
|
10
13
|
標示されるようになりました。
|
@@ -95,10 +98,6 @@
|
|
95
98
|
|
96
99
|
%post --log=/root/post-ks.log
|
97
100
|
# Set static ip
|
98
|
-
echo 'nmcli c ==='
|
99
|
-
nmcli c
|
100
|
-
echo 'nmcli c ==='
|
101
|
-
|
102
101
|
nmcli c a type ethernet ifname eth0 con-name eth0
|
103
102
|
nmcli c a type bridge con-name br0 ifname br0 autoconnect yes
|
104
103
|
nmcli c m br0 bridge.stp no
|
@@ -109,11 +108,6 @@
|
|
109
108
|
done
|
110
109
|
nmcli c m eth0 master br0 connection.slave-type bridge
|
111
110
|
|
112
|
-
echo '/mnt/sysimage/ ==='
|
113
|
-
ls -al /mnt/sysimage/etc/sysconfig/network-scripts/ifcfg-*
|
114
|
-
ls -al /etc/sysconfig/network-scripts/ifcfg-*
|
115
|
-
echo '/mnt/sysimage/ ==='
|
116
|
-
|
117
111
|
# Setup and snapshot
|
118
112
|
yum update -y
|
119
113
|
yum install -y bash-completion vim git rsync
|
1
kickstart 修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -101,12 +101,10 @@
|
|
101
101
|
|
102
102
|
nmcli c a type ethernet ifname eth0 con-name eth0
|
103
103
|
nmcli c a type bridge con-name br0 ifname br0 autoconnect yes
|
104
|
-
nmcli c m br0 bridge.stp no
|
104
|
+
nmcli c m br0 bridge.stp no
|
105
|
-
nmcli c m br0 ipv4.address 192.168.1.$i/16 ipv4.gateway 192.168.1.1 ipv4.dns 192.168.1.1
|
106
|
-
nmcli c m eth0 master br0 connection.slave-type bridge
|
107
105
|
for i in 151 152 153; do
|
108
106
|
ping -c1 192.168.1.$i && continue
|
109
|
-
nmcli c m br0 ipv4.address 192.168.1.$i/16 ipv4.gateway 192.168.1.1 ipv4.dns
|
107
|
+
nmcli c m br0 ipv4.method manual ipv4.address 192.168.1.$i/16 ipv4.gateway 192.168.1.1 ipv4.dns 8.8.8.8
|
110
108
|
break
|
111
109
|
done
|
112
110
|
nmcli c m eth0 master br0 connection.slave-type bridge
|
@@ -117,7 +115,6 @@
|
|
117
115
|
echo '/mnt/sysimage/ ==='
|
118
116
|
|
119
117
|
# Setup and snapshot
|
120
|
-
%post --log=/root/post-ks.log
|
121
118
|
yum update -y
|
122
119
|
yum install -y bash-completion vim git rsync
|
123
120
|
mkdir -p /root/git
|
@@ -130,4 +127,5 @@
|
|
130
127
|
|
131
128
|
EOF
|
132
129
|
|
130
|
+
|
133
131
|
```
|