<div dir="ltr"><div><div>The --bootproto=dhcp tells anaconda how to configure the network after the install is complete and you reboot. You typically use DHCP for the PXE boot, but then for the actual OS you might want a static IP, so the 'network' command is telling anaconda what you want for the final configuration.<br><br></div>I don't use Satellite, so not sure where it goes, but the 'network' command is a kickstart command, not something that you run as part of the %pre or %post scripts. For some reason I also have the network line that sets the hostname as an additional line, which looks like this:<br> network --device=ens192 --bootproto=dhcp --ipv6=auto --activate<br> network --device=ens192 --hostname=${HOSTNAME}"<br><br></div>Also you need to populate the HOSTNAME variable somehow. If that's blank it obviously won't work.<br><div><div><br><div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr"><div>❧ Brian Mathis<br></div>@orev<br></div></div></div>
<br><br><div class="gmail_quote">On Thu, Apr 30, 2015 at 4:45 PM, James Sumners <span dir="ltr"><<a href="mailto:james.sumners@gmail.com" target="_blank">james.sumners@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Nope. That didn't work.<div><br></div><div>I'm using Satellite 6 to build and serve the kickstart. So what I did is remove my post "blunt instrument" script and added a new pre script:</div><div><br></div><div>```</div><div><div>network --activate --device=$IFDEVICE --bootproto=static --ip=$IPADDR \</div><div>--netmask=255.255.255.0 --gateway=$GATEWAY --nameserver $DNS1,$DNS2 \</div><div>--hostname=$HOSTNAME --onboot=yes</div></div><div>```</div><div><br></div><div>The result is that the network script didn't get created at all because the "network" tool couldn't be found.</div><div><br></div><div>On the "Kickstart Details > Advanced Options" page I have "--bootproto dhcp". I suppose that's replaceable since the kickstart should be retrieved after it has already booted from the PXE image?</div></div><div class=""><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 30, 2015 at 4:16 PM, Brian Mathis <span dir="ltr"><<a href="mailto:brian.mathis+ale@betteradmin.com" target="_blank">brian.mathis+ale@betteradmin.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Set the hostname by making a tmp file with the 'network' kickstart command in the %pre script like this:<br> echo "network --device=ens192 --hostname=${HOSTNAME}" > /tmp/ks-network-hostname<br><div><div>then include that file in the kickstart commands section of the file like this:<br> %include /tmp/ks-network-hostname<br><br></div><div>Overwriting the files like you're doing is a blunt instrument and is sure to fail at some point (like you're seeing). Use the kickstart commands as much as possible so anaconda can do the right thing. I also treat every major release as a *major* release, which requires a complete review and rewrite to adapt to whatever changes were made.<br><br></div></div><div class="gmail_extra"><br clear="all"><div><div><div dir="ltr"><div>❧ Brian Mathis<br></div>@orev<br></div></div></div>
<br><br><div class="gmail_quote"><div><div>On Thu, Apr 30, 2015 at 2:53 PM, James Sumners <span dir="ltr"><<a href="mailto:james.sumners@gmail.com" target="_blank">james.sumners@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div><div dir="ltr">I have a post script to set network configurations that gets used in all of my kickstarts:<div><br></div><div>```</div><div><div>exec 6<&1</div><div>exec > /etc/sysconfig/network</div><div>cat <<HERE_DOC</div><div>NETWORKING=yes</div><div>HOSTNAME=$HOSTNAME</div><div>GATEWAY=$GATEWAY</div><div>HERE_DOC</div><div>exec 1<&6</div></div><div>```</div><div><br></div><div>Works great with RHEL 5/6, but since RHEL 7 switched to systemd not so much (due to hostnamectl [a totally unnecessary change]). According to the documentation[1], I should only have to put my hostname in `/etc/hostname`. So I added this to my post script:</div><div><br></div><div>```</div><div><div>cat /etc/redhat-release 1>/dev/null | grep "release 7"</div><div>if [ \$? -eq 0 ]; then</div><div># RHEL 7</div><div>echo "Enabling RHEL 7 hostname"</div><div>exec 6<&1</div><div>exec > /etc/hostname</div><div>cat <<HERE_DOC</div><div>$HOSTNAME</div><div>HERE_DOC</div><div>exec 1<&6</div><div>fi</div></div><div>```</div><div><br></div><div>The "Enabling RHEL 7 hostname" doesn't get written to the kickstart post log, and the hostname doesn't get written to `/etc/hostname`.</div><div><br></div><div>Does anyone have a method for doing this?</div><div><br></div><div>[1] -- <a href="https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Migration_Planning_Guide/sect-Red_Hat_Enterprise_Linux-Migration_Planning_Guide-System_Management.html#sect-Red_Hat_Enterprise_Linux-Migration_Planning_Guide-System_Management-Hostname_Definition" target="_blank">https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Migration_Planning_Guide/sect-Red_Hat_Enterprise_Linux-Migration_Planning_Guide-System_Management.html#sect-Red_Hat_Enterprise_Linux-Migration_Planning_Guide-System_Management-Hostname_Definition</a><span><font color="#888888"><br clear="all"><div><br></div>-- <br><div><div dir="ltr"><div><div dir="ltr"><div>James Sumners<br><a href="http://james.sumners.info/" target="_blank">http://james.sumners.info/</a> (technical profile)</div><div><a href="http://jrfom.com/" target="_blank">http://jrfom.com/</a> (personal site)</div><div><a href="http://haplo.bandcamp.com/" target="_blank">http://haplo.bandcamp.com/</a> (band page)</div></div></div></div></div>
</font></span></div></div>
<br></div></div>_______________________________________________<br>
Ale mailing list<br>
<a href="mailto:Ale@ale.org" target="_blank">Ale@ale.org</a><br>
<a href="http://mail.ale.org/mailman/listinfo/ale" target="_blank">http://mail.ale.org/mailman/listinfo/ale</a><br>
See JOBS, ANNOUNCE and SCHOOLS lists at<br>
<a href="http://mail.ale.org/mailman/listinfo" target="_blank">http://mail.ale.org/mailman/listinfo</a><br>
<br></blockquote></div><br></div></div>
<br>_______________________________________________<br>
Ale mailing list<br>
<a href="mailto:Ale@ale.org" target="_blank">Ale@ale.org</a><br>
<a href="http://mail.ale.org/mailman/listinfo/ale" target="_blank">http://mail.ale.org/mailman/listinfo/ale</a><br>
See JOBS, ANNOUNCE and SCHOOLS lists at<br>
<a href="http://mail.ale.org/mailman/listinfo" target="_blank">http://mail.ale.org/mailman/listinfo</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div><div dir="ltr"><div><div dir="ltr"><div>James Sumners<br><a href="http://james.sumners.info/" target="_blank">http://james.sumners.info/</a> (technical profile)</div><div><a href="http://jrfom.com/" target="_blank">http://jrfom.com/</a> (personal site)</div><div><a href="http://haplo.bandcamp.com/" target="_blank">http://haplo.bandcamp.com/</a> (band page)</div></div></div></div></div>
</div>
</div></div><br>_______________________________________________<br>
Ale mailing list<br>
<a href="mailto:Ale@ale.org">Ale@ale.org</a><br>
<a href="http://mail.ale.org/mailman/listinfo/ale" target="_blank">http://mail.ale.org/mailman/listinfo/ale</a><br>
See JOBS, ANNOUNCE and SCHOOLS lists at<br>
<a href="http://mail.ale.org/mailman/listinfo" target="_blank">http://mail.ale.org/mailman/listinfo</a><br>
<br></blockquote></div><br></div></div></div></div></div>