Sync with upstream repository
[fuel.git] / build / f_isoroot / f_kscfg / ks.cfg.orig
1 install
2 text
3 #%include /tmp/source.ks
4 cdrom
5 reboot --eject
6 lang en_US.UTF-8
7 keyboard us
8 rootpw r00tme
9 timezone --utc Etc/UTC
10 firewall --disabled
11 selinux --disabled
12 # ignore unsupported hardware warning
13 unsupported_hardware
14 # SKIP CONFIGURING X
15 skipx
16 repo --name="mos-centos" --baseurl=file:///run/install/repo/mos-centos/ --cost=100
17
18 # NEVER ever place zerombr here, it breaks automated installation
19 %include /tmp/bootloader.ks
20 %include /tmp/partition.ks
21 %include /tmp/post_partition.ks
22
23
24
25
26
27 %packages --nobase
28 @Core
29 fuel
30 fuel-library
31 fuel-dockerctl
32 authconfig
33 bind-utils
34 bridge-utils
35 cronie
36 crontabs
37 curl
38 dhcp
39 docker
40 fuel-bootstrap-cli
41 fuel-bootstrap-image
42 # NOTE(kozhukalov): We don't need target centos images in 8.0
43 # fuel-target-centos-images7.1.1503
44 fuelmenu
45 fuel-docker-images
46 fuel-mirror
47 fuel-openstack-metadata
48 gdisk
49 lrzip
50 lsof
51 man
52 mlocate
53 nmap-ncat
54 ntp
55 ntpdate
56 openssh-clients
57 policycoreutils
58 python-pypcap
59 rsync
60 puppet
61 rubygem-netaddr
62 rubygem-openstack
63 selinux-policy-targeted
64 strace
65 sysstat
66 system-config-firewall-base
67 tcpdump
68 telnet
69 vim
70 virt-what
71 wget
72 yum
73 yum-plugin-priorities
74 %end
75
76
77
78
79
80 # PREINSTALL SECTION
81 # HERE ARE COMMANDS THAT WILL BE LAUNCHED BEFORE
82 # INSTALLATION PROCESS ITSELF
83 %pre
84 #!/bin/sh
85
86 # hard drives
87 drives=""
88 removable_drives=""
89 for drv in `ls -1 /sys/block | grep "sd\|hd\|vd\|cciss"`; do
90     if !(blkid | grep -q "${drv}.*Fuel"); then
91       if (grep -q 0 /sys/block/${drv}/removable); then
92           drives="${drives} ${drv}"
93       else
94           removable_drives="${removable_drives} ${drv}"
95       fi
96     fi
97 done
98 default_drive=`echo ${drives} ${removable_drives} | awk '{print $1}'`
99
100 installdrive=${installdrive:-undefined}
101 forceformat=${forceformat:-no}
102 for I in $(cat /proc/cmdline); do
103   case "$I" in
104     *=*)
105       if ! [[ "${I}" =~ "." ]]; then eval "$I"; fi
106     ;;
107   esac
108 done
109
110 set ${drives} ${removable_drives}
111 numdrives=`echo $#`
112
113 tgtdrive="${installdrive}"
114
115 function confirm_format {
116   check_drive="$1"
117   local confirm_format="no"
118
119   if [[ "$forceformat" == "yes" ]] ; then
120     return 0
121   fi
122
123   if parted -s /dev/$check_drive print &>/dev/null ; then
124     echo
125     echo "$check_drive drive contains partition table:"
126     parted -s /dev/$check_drive print
127     echo
128     read -p "Are you sure you want to erase ALL data on disk $check_drive? (y/N)" confirm_format
129     if [[ "$confirm_format" == "y" ]] || [[ "$confirm_format" == "Y" ]] || [[ "$forceformat" == "yes" ]]; then
130       return 0
131     else
132       return 1
133     fi
134   else
135     return 0
136   fi
137 }
138
139 format_confirmed="no"
140
141 if [ $numdrives -lt 1 ]; then
142     exec < /dev/tty3 > /dev/tty3 2>&1
143     chvt 3
144     clear
145     echo
146     echo '********************************************************************'
147     echo '*                            E R R O R                             *'
148     echo '*                                                                  *'
149     echo '*      There is no suitable media available for installation.      *'
150     echo '*                Please attach a drive and try again.              *'
151     echo '*                                                                  *'
152     echo '********************************************************************'
153     echo
154     read -p "Press Enter to shut down the system: " _
155     poweroff
156 fi
157
158 if [ ${numdrives} -gt 1 ] || [ `echo ${drives} | wc -w` -eq 0 ] ; then
159     exec < /dev/tty3 > /dev/tty3 2>&1
160     chvt 3
161     while [ "${tgtdrive}" = "undefined" ]; do
162         clear
163         echo
164         echo '********************************************************************************'
165         echo '*                                 W A R N I N G                                *'
166         echo '*                                                                              *'
167         echo '*  Which of the detected hard drives do you want to be used as                 *'
168         echo '*  the installation target?                                                    *'
169         echo '*                                                                              *'
170         echo '********************************************************************************'
171         echo
172         echo "Possible choices"
173         echo "Persistent drives: ${drives}"
174         echo "Removable drives: ${removable_drives}"
175         echo
176         if [ `echo ${drives} | wc -w` -eq 1 ] ; then
177             read -t 30 -p "Choose hard drive: " tgtdrive || tgtdrive=$default_drive
178         else
179             read -p "Choose hard drive: " tgtdrive
180         fi
181         match="no"
182         for drive in ${drives[@]} ${removable_drives[@]}; do
183           if [[ "$drive" == "$tgtdrive" ]] && match="yes" ; then
184             if confirm_format $tgtdrive ; then
185               format_confirmed="yes"
186               break
187             else
188               tgtdrive="undefined"
189               read -p "You may select another disk. Press Enter to continue." _
190             fi
191           fi
192         done
193         if [[ "$match" == "no" ]]; then
194           tgtdrive="undefined"
195           read -p "Invalid choice. Press Enter to continue." _
196         fi
197     done
198     clear
199     chvt 1
200 else
201     tgtdrive=`echo ${drives} | sed -e "s/^\s*//" -e "s/\s*$//"`
202 fi
203
204 if [ "$format_confirmed" != "yes" ] ; then
205   exec < /dev/tty3 > /dev/tty3 2>&1
206   chvt 3
207   if ! confirm_format $tgtdrive ; then
208       clear
209       echo
210       echo '********************************************************************'
211       echo '*                            E R R O R                             *'
212       echo '*                                                                  *'
213       echo '*           Disk $tgtdrive contains active partition(s).           *'
214       echo '*        Installation cannot continue without confirmation.        *'
215       echo '*                                                                  *'
216       echo '********************************************************************'
217       echo
218       read -p "Press Enter to restart: " _
219       reboot
220   fi
221   chvt 1
222 fi
223
224 # verify tgtdrive is at least 45GB
225 tgtdrivesize=$(( $(cat "/sys/class/block/${tgtdrive}/size") / 2 / 1024 ))
226 if [ $tgtdrivesize -lt 46080 ]; then
227     exec < /dev/tty3 > /dev/tty3 2>&1
228     chvt 3
229     clear
230     echo
231     echo '********************************************************************'
232     echo '*                            E R R O R                             *'
233     echo '*                                                                  *'
234     echo '*  Your disk is under 45GB in size. Installation cannot continue.  *'
235     echo '*             Restart installation with a larger disk.             *'
236     echo '*                                                                  *'
237     echo '********************************************************************'
238     echo
239     read -p "Press Enter to restart: " _
240     reboot
241 fi
242
243 # paths in /dev have "/" instead of "!" for cciss devices
244 tgtdrive=$(echo $tgtdrive | sed -e 's/!/\//')
245
246 # source
247 if test -e /dev/disk/by-label/OpenStack_Fuel; then
248     echo "harddrive --partition=LABEL=OpenStack_Fuel --dir=/" > /tmp/source.ks
249 elif test -e /dev/disk/by-uuid/will_be_substituted_with_actual_uuid; then
250     echo "harddrive --partition=UUID=will_be_substituted_with_actual_uuid --dir=/" > /tmp/source.ks
251 else
252     echo "cdrom" > /tmp/source.ks
253 fi
254
255 vgdisplay -c | cut -d':' -f1 | xargs vgremove -ff
256 dd if=/dev/zero of=/dev/${tgtdrive} bs=10M count=10
257 sleep 3
258 hdparm -z /dev/${tgtdrive}
259 parted -s /dev/${tgtdrive} mklabel gpt
260 parted -a none -s /dev/${tgtdrive} unit MiB mkpart primary 0% 24
261 parted -s /dev/${tgtdrive} set 1 bios_grub on
262 parted -a none -s /dev/${tgtdrive} unit MiB mkpart primary fat16 24 224
263 parted -s /dev/${tgtdrive} set 2 boot on
264 parted -a none -s /dev/${tgtdrive} unit MiB mkpart primary 224 424
265 sleep 3
266 hdparm -z /dev/${tgtdrive}
267
268 # partition
269
270 # This adds support for the p seperator required for cciss devices
271 if echo ${tgtdrive} | grep -q -e cciss ; then
272     bootdev=${tgtdrive}p
273 else
274     bootdev=${tgtdrive}
275 fi
276
277 cat << EOF > /tmp/partition.ks
278 part /boot --onpart=/dev/${bootdev}3
279 part /boot/efi --onpart=/dev/${bootdev}2
280 part pv.001 --ondisk=${tgtdrive} --size=25000 --grow
281 part pv.002 --ondisk=${tgtdrive} --size=20000
282 volgroup os pv.001
283 volgroup docker pv.002
284 logvol swap --vgname=os --recommended --name=swap
285 logvol / --vgname=os --size=10000 --name=root --fstype=ext4
286 logvol /var --vgname=os --grow --percent 40 --name=var --fstype=ext4
287 logvol /var/log --vgname=os --grow --percent 60 --name=varlog --fstype=ext4
288 EOF
289
290
291
292 # bootloader
293 echo "bootloader --driveorder=${tgtdrive} --append=' biosdevname=0 crashkernel=none'" > /tmp/bootloader.ks
294
295 # Anaconda can not install grub 0.97 on disks which are >4T.
296 # The reason is that grub does not support such large geometries
297 # and it simply thinks that the cylinder number has negative value.
298 # Here we just set geometry manually so that grub thinks that disk
299 # size is equal to 1G.
300 # 130 cylinders * (16065 * 512 = 8225280 bytes) = 1G
301 echo "%post --nochroot --log=/mnt/sysimage/root/anaconda-post-partition.log" > /tmp/post_partition.ks
302 echo "echo \"device (hd0) /dev/${tgtdrive}\" >> /tmp/grub.script" >> /tmp/post_partition.ks
303 echo "echo \"geometry (hd0) 130 255 63\" >> /tmp/grub.script" >> /tmp/post_partition.ks
304 echo "echo \"root (hd0,2)\" >> /tmp/grub.script" >> /tmp/post_partition.ks
305 echo "echo \"install /grub/stage1 (hd0) /grub/stage2 p /grub/grub.conf\" >> /tmp/grub.script" >> /tmp/post_partition.ks
306 echo "echo quit >> /tmp/grub.script" >> /tmp/post_partition.ks
307 echo "cat /tmp/grub.script | chroot /mnt/sysimage /sbin/grub --no-floppy --batch" >> /tmp/post_partition.ks
308 echo "%end" >> /tmp/post_partition.ks
309 %end
310
311
312
313
314
315 # POSTINSTALL SECTIONS
316 # HERE ARE COMMANDS THAT WILL BE LAUNCHED JUST AFTER
317 # INSTALLATION ITSELF COMPLETED
318
319
320 # Parse /proc/cmdline and save for next steps
321 %post --log=/root/anaconda-parse-cmdline.log
322 #!/bin/bash
323 set -x
324
325 # Parse cmdline to alter keys which contains dot in their names
326 # Such keys can't be used as variables in bash,
327 # so every dot is replaced with double underscore.
328 # Double underscore needed to avoid possible naming collisions.
329 for item in $(cat /proc/cmdline); do
330   if [[ "${item}" =~ '=' ]]; then
331     key="${item%%=*}"
332     value="${item#*=}"
333   else
334     key="${item}"
335     value='yes'
336   fi
337   key="${key//\./__}"
338   value="${value:-'yes'}"
339   echo "${key}=${value}" >> /root/anaconda.cmdline.vars
340 done
341
342 source /root/anaconda.cmdline.vars
343
344 if [[ ! -z $ifname ]]; then
345   echo "adminif=$(udevadm info --query=property -p /sys/class/net/${ifname%%:*} | \
346     awk -F\= '$1 == "ID_NET_NAME_ONBOARD" {s=$2; exit}; $1 == "ID_NET_NAME_SLOT" {s=$2; exit}; $1 == "ID_NET_NAME_PATH" {s=$2; next}; END {print s}')" >> /root/anaconda.cmdline.vars
347 fi
348
349 # Add self entry to /etc/hosts
350 ipaddr=$(echo $ip | cut -d: -f1)
351 hostname=$(echo $ip | cut -d: -f5)
352 # Use default hostname if missing from parameters
353 [ -z "$hostname" ] && hostname="fuel.domain.tld"
354 short=$(echo $hostname | cut -d. -f1)
355 echo -e "${ipaddr}       ${hostname} ${short}" >> /etc/hosts
356 %end
357
358
359
360
361
362 # Mount installation media in chroot
363 %post --nochroot --log=/mnt/sysimage/root/anaconda-post-before-chroot.log
364 #!/bin/bash
365 set -x
366
367 source "/mnt/sysimage/root/anaconda.cmdline.vars"
368
369 SOURCE="/mnt/sysimage/tmp/source"
370
371 mkdir -p "${SOURCE}"
372
373 case "${repo}" in
374   nfs:*)
375     nfs_url="${repo#nfs:}"
376     mount -t nfs "${nfs_url}" "${SOURCE}"
377   ;;
378   *)
379     if [ -d "/mnt/source" ]; then
380       mount -o bind "/mnt/source" "${SOURCE}"
381     fi
382   ;;
383 esac
384
385
386 # If not mounted, try to bind /run/install/repo since
387 # anaconda shoud mount installation repo to that folder.
388 if ! mountpoint -q "${SOURCE}"; then
389   if [ -d '/run/install/repo' ] && mountpoint -q '/run/install/repo'; then
390     mount -o bind '/run/install/repo' "${SOURCE}"
391   fi
392 fi
393
394
395 # If still not mounted, try to mount from LABEL / UUID.
396 # It was moved from next phase here to keep all mounting stuff
397 # in one place. All other scripts should use SOURCE variable
398 # for access to dist files.
399
400 iso_volume_id=OpenStack_Fuel
401 iso_disk_uuid=will_be_substituted_with_actual_uuid
402 FS="/mnt/sysimage/tmp/fs"
403
404 if ! mountpoint -q "${SOURCE}"; then
405   if [ -e "/dev/disk/by-label/${iso_volume_id}" ]; then
406     mount "/dev/disk/by-label/${iso_volume_id}" "${SOURCE}"
407   elif [ -e "/dev/disk/by-uuid/${iso_disk_uuid}" ]; then
408     mkdir -p "${FS}"
409     mount "/dev/disk/by-uuid/${iso_disk_uuid}" "${FS}"
410     mount -o loop "${FS}/nailgun.iso" "${SOURCE}"
411   fi
412 fi
413
414 # Sleep to capture full log
415 sleep 1
416 %end
417
418
419
420
421
422 %post --log=/root/anaconda-post-configure-repos.log
423 #!/bin/bash
424 set -x
425
426 SOURCE=/tmp/source
427
428 # this file is provided by fuel-openstack-metadata package
429 OPENSTACK_VERSION=`cat /etc/fuel_openstack_version`
430
431 # ----------------------
432 # UNPACKING REPOSITORIES
433 # ----------------------
434
435 wwwdir="/var/www/nailgun"
436 repodir="${wwwdir}/${OPENSTACK_VERSION}"
437
438 # Copying Centos files
439 mkdir -p ${repodir}/centos/x86_64
440 mkdir -p ${repodir}/mos-centos/x86_64
441 cp -r ${SOURCE}/images ${repodir}/centos/x86_64
442 cp -r ${SOURCE}/isolinux ${repodir}/centos/x86_64
443 cp -r ${SOURCE}/repodata ${repodir}/centos/x86_64
444 cp -r ${SOURCE}/Packages ${repodir}/centos/x86_64
445 cp -r ${SOURCE}/mos-centos/repodata ${repodir}/mos-centos/x86_64
446 cp -r ${SOURCE}/mos-centos/Packages ${repodir}/mos-centos/x86_64
447 cp -r ${SOURCE}/extra-repos ${repodir}/
448 cp ${SOURCE}/.treeinfo ${repodir}/centos/x86_64
449
450 # Copying Ubuntu files
451 mkdir -p ${repodir}/ubuntu/x86_64/images
452 cp -r ${SOURCE}/ubuntu/dists ${repodir}/ubuntu/x86_64
453 cp -r ${SOURCE}/ubuntu/pool ${repodir}/ubuntu/x86_64
454
455 # We do not ship debian-installer kernel and initrd on ISO.
456 # But we still need to be able to create ubuntu cobbler distro
457 # which requires kernel and initrd to be available. So, we
458 # just touch these files to work around cobbler's limitation.
459 touch ${repodir}/ubuntu/x86_64/images/linux
460 touch ${repodir}/ubuntu/x86_64/images/initrd.gz
461
462 # make links for backward compatibility
463 ln -s ${repodir}/centos ${wwwdir}/centos
464 ln -s ${repodir}/ubuntu ${wwwdir}/ubuntu
465 #Make a symlink for mos-centos in /var/www/nailgun in iso/ks.template
466 ln -s ${repodir}/mos-centos ${wwwdir}/mos-centos
467 ln -s ${repodir}/extra-repos ${wwwdir}/extra-repos
468
469 mkdir -p ${wwwdir}/targetimages
470
471 cp ${SOURCE}/send2syslog.py /bin/send2syslog.py
472 mkdir -p /var/lib/hiera
473 touch /var/lib/hiera/common.yaml /etc/puppet/hiera.yaml
474
475 # Prepare local repository specification
476 rm /etc/yum.repos.d/CentOS*.repo
477 cp ${SOURCE}/extra-repos/extra.repo /etc/yum.repos.d/
478 cat > /etc/yum.repos.d/nailgun.repo << EOF
479 [nailgun]
480 name=Nailgun Local Repo
481 baseurl=file:/var/www/nailgun/${OPENSTACK_VERSION}/centos/x86_64
482 gpgcheck=0
483 [mos]
484 name=MOS Local Repo
485 baseurl=file:/var/www/nailgun/${OPENSTACK_VERSION}/mos-centos/x86_64
486 gpgcheck=0
487 EOF
488 %end
489
490
491
492
493
494 %post --log=/root/anaconda-post-configure-sysconfig.log
495 #!/bin/bash
496 set -x
497
498 source "/root/anaconda.cmdline.vars"
499 SOURCE=/tmp/source
500
501 # Set correct docker volume group
502 echo "VG=docker" >> /etc/sysconfig/docker-storage-setup
503
504 # Disable create iptables rules by docker
505 echo "DOCKER_NETWORK_OPTIONS=--iptables=false" > /etc/sysconfig/docker-network
506
507 # Disable subscription-manager plugins
508 sed -i 's/^enabled.*/enabled=0/' /etc/yum/pluginconf.d/product-id.conf || :
509 sed -i 's/^enabled.*/enabled=0/' /etc/yum/pluginconf.d/subscription-manager.conf || :
510
511 # Disable GSSAPI in ssh server config
512 sed -i -e "/^\s*GSSAPICleanupCredentials yes/d" -e "/^\s*GSSAPIAuthentication yes/d" /etc/ssh/sshd_config
513
514 # Enable MOTD banner in sshd
515 sed -i -e "s/^\s*PrintMotd no/PrintMotd yes/g" /etc/ssh/sshd_config
516
517 # Add note regarding local repos creation to MOTD
518 cat >> /etc/motd << EOF
519
520 All environments use online repositories by default.
521 Use the following commands to create local repositories
522 on master node and change default repository settings:
523
524 * CentOS: fuel-mirror (see --help for options)
525 * Ubuntu: fuel-mirror (see --help for options)
526
527 Please refer to the following guide for more information:
528 https://docs.mirantis.com/openstack/fuel/fuel-7.0/reference-architecture.html#fuel-rep-mirror
529
530 EOF
531
532 # Install bootstrap_admin_node.sh and enabling it
533 install -m 0777 -D ${SOURCE}/bootstrap_admin_node.sh /usr/local/sbin/bootstrap_admin_node.sh
534 echo "ENABLED=1" > /etc/sysconfig/bootstrap_admin_node
535
536 # Copying version.yaml file. It contains COMMIT_SHA of last commit.
537 RELEASE=$(awk '/release/{gsub(/"/, "");print $2}' ${SOURCE}/version.yaml)
538 mkdir -p /etc/nailgun /etc/fuel/${RELEASE} /etc/fuel/release_versions
539 cp ${SOURCE}/version.yaml /etc/nailgun/version.yaml
540 cp ${SOURCE}/version.yaml /etc/fuel/${RELEASE}/version.yaml
541 ln -s /etc/fuel/${RELEASE}/version.yaml /etc/fuel/version.yaml
542 cp ${SOURCE}/version.yaml /etc/fuel/release_versions/`cat  ${SOURCE}/openstack_version`.yaml
543
544 # Generete Fuel UUID
545 uuidgen > /etc/fuel/fuel-uuid
546
547 # Prepare bootstrap_admin_node config
548 cat > /etc/fuel/bootstrap_admin_node.conf << EOF
549 #Set to yes to run Fuel Setup
550 #Set to no to accept default settings
551 ADMIN_INTERFACE=${adminif}
552 showmenu=${showmenu:-no}
553 wait_for_external_config=${wait_for_external_config:-no}
554 EOF
555
556 # Prepare custom /etc/issue logon banner and script for changing IP in it
557 # We can have several interface naming schemes applied and several interface
558 # UI will listen on
559 ipstr=""
560 NL=$'\n'
561 for ip in `ip -o -4 a | grep -e "e[nt][hopsx].*" | awk '{print \$4 }' | cut -d/ -f1`; do
562   ipstr="${ipstr}https://${ip}:8443${NL}"
563 done
564 cat > /etc/issue <<EOF
565 #########################################
566 #       Welcome to the Fuel server      #
567 #########################################
568 Server is running on \m platform
569
570 Fuel UI is available on:
571 $ipstr
572 Default administrator login:    root
573 Default administrator password: r00tme
574
575 Default Fuel UI login: admin
576 Default Fuel UI password: admin
577
578 Please change root password on first login.
579
580 EOF
581
582 # Unmounting source
583 umount -f ${SOURCE}
584 rm -rf ${SOURCE}
585
586 umount -f ${FS} || true
587 rm -rf ${FS}
588
589 echo "tos orphan 7" >> /etc/ntp.conf
590
591 # Disabling splash
592 sed -i --follow-symlinks -e '/^\slinux16/ s/rhgb/debug/' /boot/grub2/grub.cfg
593
594 # Copying default bash settings to the root directory
595 cp -f /etc/skel/.bash* /root/
596
597 # Blacklist i2c_piix4 module for VirtualBox so it does not create kernel errors
598 (virt-what | fgrep -q "virtualbox") && echo "blacklist i2c_piix4" > /etc/modprobe.d/blacklist-i2c-piix4.conf
599
600 # Blacklist intel_rapl module for VirtualBox so it does not create kernel errors
601 (virt-what | fgrep -q "virtualbox") && echo "blacklist intel_rapl" > /etc/modprobe.d/blacklist-intel-rapl.conf
602
603 # Disable sshd until after Fuel Setup if not running on VirtualBox
604 # TODO(mattymo): Remove VBox exception after LP#1487047 is fixed
605 (virt-what | fgrep -q "virtualbox") || systemctl disable sshd
606
607 %end
608
609
610
611
612
613 %post --log=/root/anaconda-post-configure-autologon.log
614 #!/bin/bash
615 set -x
616
617 # Enable once root autologin for initial setup
618 mkdir -p /etc/systemd/system/getty@tty1.service.d/
619 cat > /etc/systemd/system/getty@tty1.service.d/autologin.conf << 'EOF'
620 [Service]
621 ExecStart=
622 ExecStart=-/sbin/agetty --autologin root --noclear %I 115200 linux
623 EOF
624
625 # Exec bootstrap_admin_node.sh if autologin enabled
626 cat >> /root/.bashrc << 'EOF'
627 if [[ "$(tty)" == "/dev/tty1" && -f /etc/systemd/system/getty@tty1.service.d/autologin.conf ]]; then
628         rm -Rf "/etc/systemd/system/getty@tty1.service.d"
629         /bin/systemctl daemon-reload
630         if [ -x /usr/local/sbin/bootstrap_admin_node.sh ]; then
631                 exec /usr/local/sbin/bootstrap_admin_node.sh
632         fi
633 fi
634 EOF
635 %end
636
637
638 %post --nochroot --log=/mnt/sysimage/root/anaconda-post-interface-settings.log
639 #!/bin/bash
640 set -x
641
642 source "/mnt/sysimage/root/anaconda.cmdline.vars"
643
644 if [[ ! -z $adminif ]]; then
645   rm -f /mnt/sysimage/etc/sysconfig/network-scripts/ifcfg-${ifname%%:*}
646   sed "s/${ifname%%:*}/${adminif}/g" \
647     /etc/sysconfig/network-scripts/ifcfg-${ifname%%:*} > \
648     /mnt/sysimage/etc/sysconfig/network-scripts/ifcfg-${adminif}
649 fi
650 %end