Hello,
I don't understand how to configure ip static after boot on dhcp.
My server boot on dhcp, it's ok but after in "interface configuration" it's
always in dhcp mode.
I would like provisionning with foreman proxy dhcp and after configuring ip
static.
If i change subnets with the option bootmode = static my server didn't find
a dhcp.
I tested to modify kickstart default PXELinux with ks=<%=
foreman_url('provision')%>&static=yes and "Kickstart default" network
–bootproto <%= @static ? "static but doesn't work
Can you help me please ?
My provision :
install
url --url http://mirror.centos.org/centos/7.2.1511/os/x86_64
lang en_US.UTF-8
selinux --enforcing
keyboard us
skipx
network --bootproto dhcp --hostname tnbilminf06.mydomain.local
–device=00:50:56:aa:87:5b
rootpw --iscrypted $5$VC26vOJg$4bRwvz4Q1eA94p/7zClwFhtqG2a71YkUDUW7aaJhMKC
firewall --service=ssh
authconfig --useshadow --passalgo=sha256 --kickstart
timezone --utc UTC
services --disabled
gpm,sendmail,cups,pcmcia,isdn,rawdevices,hpoj,bluetooth,openibd,avahi-daemon,avahi-dnsconfd,hidd,hplip,pcscd
repo --name="EPEL"
–mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=x86_64
*bootloader --location=mbr --append="nofb quiet splash=quiet" *
zerombr
clearpart --none --initlabel
part /boot --fstype="xfs" --ondisk=sda --size=1024
part pv.155 --fstype="lvmpv" --ondisk=sda --size=19455
volgroup vgos --pesize=4096 pv.155
logvol swap --fstype="swap" --size=4092 --name=swap --vgname=vgos
logvol /home --fstype="xfs" --size=1024 --name=home --vgname=vgos
logvol /tmp --fstype="xfs" --size=4096 --name=tmp --vgname=vgos
logvol /var --fstype="xfs" --size=2048 --name=var --vgname=vgos
logvol / --fstype="xfs" --size=8192 --name=root --vgname=vgos
text
reboot
%packages
yum
dhclient
ntp
wget
@Core
redhat-lsb-core
epel-release
puppet
%end
%post --nochroot
exec < /dev/tty3 > /dev/tty3
#changing to VT 3 so that we can see whats going on…
/usr/bin/chvt 3
(
cp -va /etc/resolv.conf /mnt/sysimage/etc/resolv.conf
/usr/bin/chvt 1
) 2>&1 | tee /mnt/sysimage/root/install.postnochroot.log
%end
%post
logger "Starting anaconda tnbilminf06.mydomain.local postinstall"
exec < /dev/tty3 > /dev/tty3
#changing to VT 3 so that we can see whats going on…
/usr/bin/chvt 3
(
# interface
real=ip -o link | grep 00:50:56:aa:87:5b | awk '{print $2;}' | sed s/:$//
# ifcfg files are ignored by NM if their name contains colons so we
convert colons to underscore
sanitized_real=$real
cat << EOF > /etc/sysconfig/network-scripts/ifcfg-$sanitized_real
BOOTPROTO="dhcp"
DEVICE=$real
HWADDR="00:50:56:aa:87:5b"
ONBOOT=yes
PEERDNS=yes
PEERROUTES=yes
EOF
#update local time
echo "updating system time"
/usr/sbin/ntpdate -sub 0.fedora.pool.ntp.org
/usr/sbin/hwclock --systohc
# update all the base packages from the updates repository
yum -t -y -e 0 update
echo "Configuring puppet"
cat > /etc/puppet/puppet.conf << EOF
[main]
vardir = /var/lib/puppet
logdir = /var/log/puppet
rundir = /var/run/puppet
ssldir = $vardir/ssl
[agent]
pluginsync = true
report = true
ignoreschedules = true
daemon = false
ca_server = tnbilminf03.mydomain.local
certname = tnbilminf06.mydomain.local
environment = production
server = tnbilminf03.mydomain.local
EOF
# Setup puppet to run on system reboot
/sbin/chkconfig --level 345 puppet on
/usr/bin/puppet agent --config /etc/puppet/puppet.conf -o --tags
no_such_tag --server tnbilminf03.mydomain.local --no-daemonize
sync
# Inform the build system that we are done.
echo "Informing Foreman that we are built"
wget -q -O /dev/null --no-check-certificate
http://tnbilminf03.mydomain.local/unattended/built?token=84b60e42-b1e0-4504-b9c6-485dc4bd3bd8
) 2>&1 | tee /root/install.post.log
exit 0
%end