<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 &#39;network&#39; command is telling anaconda what you want for the final configuration.<br><br></div>I don&#39;t use Satellite, so not sure where it goes, but the &#39;network&#39; 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}&quot;<br><br></div>Also you need to populate the HOSTNAME variable somehow.  If that&#39;s blank it obviously won&#39;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">&lt;<a href="mailto:james.sumners@gmail.com" target="_blank">james.sumners@gmail.com</a>&gt;</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&#39;t work.<div><br></div><div>I&#39;m using Satellite 6 to build and serve the kickstart. So what I did is remove my post &quot;blunt instrument&quot; 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&#39;t get created at all because the &quot;network&quot; tool couldn&#39;t be found.</div><div><br></div><div>On the &quot;Kickstart Details &gt; Advanced Options&quot; page I have &quot;--bootproto dhcp&quot;. I suppose that&#39;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">&lt;<a href="mailto:brian.mathis+ale@betteradmin.com" target="_blank">brian.mathis+ale@betteradmin.com</a>&gt;</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 &#39;network&#39; kickstart command in the %pre script like this:<br>    echo &quot;network --device=ens192 --hostname=${HOSTNAME}&quot; &gt; /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&#39;re doing is a blunt instrument and is sure to fail at some point (like you&#39;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">&lt;<a href="mailto:james.sumners@gmail.com" target="_blank">james.sumners@gmail.com</a>&gt;</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&lt;&amp;1</div><div>exec &gt; /etc/sysconfig/network</div><div>cat &lt;&lt;HERE_DOC</div><div>NETWORKING=yes</div><div>HOSTNAME=$HOSTNAME</div><div>GATEWAY=$GATEWAY</div><div>HERE_DOC</div><div>exec 1&lt;&amp;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&gt;/dev/null | grep &quot;release 7&quot;</div><div>if [ \$? -eq 0 ]; then</div><div># RHEL 7</div><div>echo &quot;Enabling RHEL 7 hostname&quot;</div><div>exec 6&lt;&amp;1</div><div>exec &gt; /etc/hostname</div><div>cat &lt;&lt;HERE_DOC</div><div>$HOSTNAME</div><div>HERE_DOC</div><div>exec 1&lt;&amp;6</div><div>fi</div></div><div>```</div><div><br></div><div>The &quot;Enabling RHEL 7 hostname&quot; doesn&#39;t get written to the kickstart post log, and the hostname doesn&#39;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>