<font size=2 face="sans-serif">- Thanks and good luck</font><br><br><br><br><font size=1 color=#5f5f5f face="sans-serif">From:      
 </font><font size=1 face="sans-serif">Lachlan Musicman <datakid@gmail.com></font><br><font size=1 color=#5f5f5f face="sans-serif">To:      
 </font><font size=1 face="sans-serif">spacewalk-list@redhat.com</font><br><font size=1 color=#5f5f5f face="sans-serif">Date:      
 </font><font size=1 face="sans-serif">03/31/2016 07:31 PM</font><br><font size=1 color=#5f5f5f face="sans-serif">Subject:    
   </font><font size=1 face="sans-serif">[Spacewalk-list]
Kickstart, Config management and debugging</font><br><font size=1 color=#5f5f5f face="sans-serif">Sent by:    
   </font><font size=1 face="sans-serif">spacewalk-list-bounces@redhat.com</font><br><hr noshade><br><br><br><font size=3>This email originated from outside of the company. Please
use discretion if opening attachments or clicking on links.</font><hr><font size=3> </font><p><font size=3>The other thread got confused, so I thought I'd move to
a new one since I now have better questions (I think).<br></font><br><font size=3>Problem remains the same - I have a kickstart profile
linked with a configuration channel that works after first boot, but the
files are not being uploaded during the installation and must be loaded
via a hack (thanks William) in a post install script.<br></font><br><font size=3>From my most recent installation (5 mins ago):<br></font><br><font size=3>Before the post install script hack, I run this command:<br><br>date > /root/verify_configs.out<br>rhncfg-client verify >> /root/verify_configs.out</font><br><br><font size=3>and get this:<br></font><br><font size=3>Fri Apr  1 10:43:57 AEDT 2016<br>Using server name emts-res-utils1<br> modified /etc/cntlm.conf<br>  missing /etc/cron.d/15min<br>  missing /etc/cron.quarter_hour/check_nfs_mounts.sh<br>  missing /etc/munge/munge.key<br> modified /etc/netconfig<br>  missing /etc/profile.d/proxy.sh<br>  missing /etc/samba/user<br>  missing /etc/slurm/slurm.conf<br>  missing /etc/slurm/slurmdbd.conf<br> modified /etc/sysctl.conf<br><br></font><br><font size=3>>From this I can see that 7 files are missing. <br></font><br><font size=3>What do the three "modified" files represent?
Does modified represent that :<br> - "the default installation files are in place, they are different
from what's in the Configuration Channel in question, so we represent this
as modified" OR</font><br><font size=3> - "we have uploaded these files in particular,
but not the others"?</font><br><font size=3><br></font><font size=3 color=blue>Modified means that the file exists but
it does not match what exists in the configuration channel.   These
files, should be part of the rpms that are installed during initial kickstart.
Find the rpms: "rpm -qf {path/to/configfile} or yum whatprovides {path/to/configfile}".</font><font size=3><br><br></font><br><font size=3>I noticed in the ks-rhn-post.log that there were a bunch
of attempts to get to the centos mirror list (I have no idea why that is
happening and would rather it didn't tbh) that were failing because of
IPv6 problems. IPv6 isn't supported in house (out of my control) and part
of my config change is that IPv6 is disabled.<br><br></font><font size=3 color=#0000e0>We faced the same issue.  Even if
you "disable"or remove all of the files in /etc/yum.repos.d/,
they could still be enabled or added back via the centos-release rpm. It
would be nice, if registered to a spacewalk, that these would just be disabled
or removed.  Also, if a server would have access to the public CentOS
repos, anything newer that would be available in the public yum CentOS
repo could override the spacewalk channel as it would be newer.  In
addition this work around provides some security/administration benefits
(In our opinion).  Any third party application defaults to /etc/yum.repos.d/,
thus they will not be able to install anything without an admin blessing
the conf file.  Besides the notes below, we found that by doing this
reduced the amount of time to build a server because it doesn't attempt
and wait for failures.<br></font><br><font size=3 color=#0000e0>The work around that can be put in place
is a post nochroot script prior to registration and server actions.</font><br><font size=3 color=#0000e0><br>%post -nochroot<br><br></font><tt><font size=3 color=#0000e0># Whenever centos-release rpm is
updated, will lay down new files in /etc/yum.repos.d/<br># This has caused issues with updates and with rhn_check in the registration.
<br># Creating a new directory and updating yum.conf </font></tt><font size=3 color=#0000e0><br>mkdir -p </font><tt><font size=3 color=#0000e0>/mnt/sysimage/</font></tt><font size=3 color=#0000e0>etc/yum.repos.d/{mynewdir}<br>echo "reposdir=/etc/yum.repos.d/{mynewdir}" >> </font><tt><font size=3 color=#0000e0>/mnt/sysimage</font></tt><font size=3 color=#0000e0>/etc/yum.conf</font><font size=3><br></font><br><font size=3>Obv, with those files being uploaded in a post script,
it's not happening in time for the cobbler.ks script.<br></font><br><font size=3>So I put --noipv6 in the network line of my Advanced Options,
but that has obviously failed to do what I expected it to do - as I can
see because the ks-rhn-post.log still makes an attempt to connect via ipv6
to the centos mirrors. (by the by, we have a proxy, so the curl would most
likely fail anyway - the cntlm file I'm uploading would solve that).</font><br><br><font size=3 color=#0000e0>If --noipv6 is not working (did not work
for me either), however we still pass it just in case.<br><br>%post script. <br>        The following normally works, except
for Cent7.</font><br><font size=3 color=#0000e0>        sed
-i -e 's/NETWORKING_IPV6=yes/NETWORKING_IPV6=no/' /etc/sysconfig/network</font><br><br><font size=3 color=#0000e0>         #However
based off of Red hat documentation(solution 8709) and the google on how
to disable ipv6  This is what comes out of it.<br>        #Note: </font><tt><font size=3 color=#0000e0>ie:
ntpd, ssh, X11 forwarding, and bonding are some of the items that could
break per the google.</font></tt><br><tt><font size=3 color=#0000e0>        #This
is not exact code. Make sure you backup files.</font></tt><br><font size=3 color=#0000e0>        Linux7:
</font><br><font size=3 color=#0000e0>         
      sed -i "s/GRUB_CMDLINE_LINUX=\"\(.*\)\"/GRUB_CMDLINE_LINUX=\"\1
ipv6.disable=1\"/" /etc/default/grub</font><br><font size=3 color=#0000e0>         
      grub2-mkconfig -o /boot/grub2/grub.cfg</font><br><font size=3 color=#0000e0>        Linux6:</font><br><font size=3 color=#0000e0>         
      echo "options ipv6 disable=1" >> /etc/modprobe.d/ipv6.conf</font><br><font size=3 color=#0000e0>           
            chkconfig ip6tables
off</font><br><font size=3 color=#0000e0>         
      sed -i "/NETWORKING_IPV6/d" /etc/sysconfig/network</font><br><font size=3 color=#0000e0>         
      echo "NETWORKING_IPV6=no" >>
/etc/sysconfig/network</font><br><font size=3 color=#0000e0>        Linux5:</font><br><font size=3 color=#0000e0>         
      chkconfig ip6tables off</font><br><font size=3 color=#0000e0>         
      sed -i "/alias net-pf-10 ipv6/d"
/etc/modprobe.conf</font><br><font size=3 color=#0000e0>         
      echo "alias net-pf-10 off" >>
/etc/modprobe.conf</font><br><font size=3 color=#0000e0>         
      echo "options ipv6 disable=1" >>
/etc/modprobe.conf</font><br><font size=3 color=#0000e0>         
      sed -i "/NETWORKING_IPV6/d" /etc/sysconfig/network</font><br><font size=3 color=#0000e0>         
      echo "NETWORKING_IPV6=no" >>
/etc/sysconfig/network</font><br><font size=3 color=#0000e0>        Linux4:</font><br><br><font size=3 color=#0000e0>         
      sed -i "/alias net-pf-10 ipv6/d"
/etc/modprobe.conf</font><br><font size=3 color=#0000e0>         
      echo "alias net-pf-10 off" >>
/etc/modprobe.conf</font><br><br><font size=3 color=#0000e0>        If Not
Linux4</font><br><font size=3 color=#0000e0>        #This
is to address X11 forwarding.  Disabling ipv6 breaks it.</font><br><font size=3 color=#0000e0>         
      sed -i 's/^[[:space:]]*::/#::/' /etc/hosts</font><br><font size=3 color=#0000e0>         
      sed -i "s/#AddressFamily any/AddressFamily
inet/g" /etc/ssh/sshd_config</font><font size=3><br><br></font><br><font size=3>When I look in the Kickstart File tab of the profile in
question, I see a script getting run that I haven't put in, which I presume
is  the one on my Scripts tab called "Registration and server
actions".<br></font><br><font size=3>In that section, I noticed that there is a small stanza:<br><br># begin Red Hat management server registration<br>mkdir -p /usr/share/rhn/<br>wget </font><a href="http://emts-res-utils1/pub/RHN-ORG-TRUSTED-SSL-CERT"><font size=3 color=blue><u>http://emts-res-utils1/pub/RHN-ORG-TRUSTED-SSL-CERT</u></font></a><font size=3>\<br>    -O /usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT  
<br>perl -Xnpe 's/RHNS-CA-CERT/RHN-ORG-TRUSTED-SSL-CERT/g' -i /etc/sysconfig/rhn/* 
<br>if [ -f /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release ]; then<br>    rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release<br>fi<br>key=1-xxx,1-xxy,1-xyy,1-yyy<br>if [ -f /tmp/key ]; then<br>    key=`cat /tmp/key`,$key<br>fi<br><br>rhnreg_ks --serverUrl=</font><a href="https://emts-res-utils1/XMLRPC"><font size=3 color=blue><u>https://emts-res-utils1/XMLRPC</u></font></a><font size=3>\<br>    --sslCACert=/usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT
--activationkey=$key<br># end Red Hat management server registration</font><br><font size=3><br></font><br><font size=3>I presume it is in here that the error is occurring. <br></font><br><font size=3>I also note that another error in this part of the script
is that </font><br><font size=3><br>if [ -f /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release ]; then<br></font><br><font size=3>will always fail because all our keys are of the format
<br><br>/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7</font><br><br><font size=3>Can I just edit the Kickstart File in that profile tab,
or is there another way I might get some output into a log file to see
where the problem is?<br></font><br><font size=3>An if this is a cobbler snippet, can I just edit the appropriate
file in<br><br>/var/lib/cobbler/snippets</font><br><br><font size=3>or is that not recommended?<br><br></font><font size=3 color=#0020c2>Do not modify those files.  They
will be overwritten when you update Spacewalk (It is painful, because you
upgrade then it breaks and you have to remember to restore that file).</font><font size=3> </font><font size=3 color=#0000e0><br><br>You can validate that the GPG key is installed.  <br>        gpg --quiet --with-fingerprint /etc/pki/rpm-gpg/RP-GPG-KEY-CentOS-7</font><br><font size=3 color=#0000e0>        Output:
 <br>                pub......
/####x##x#  Description</font><br><font size=3 color=#0000e0>         
      key fingerprint =  </font><br><font size=3 color=#0000e0>         
      sub.....<br></font><br><font size=3 color=#0000e0>        The
following will print out the key if it is installed on the new system.</font><br><font size=3 color=#0000e0>        rpm
-q gpg-pubkey --qf '%{version}\n' |grep -i ####x##x#</font><br><font size=3 color=#0000e0><br>If you want to ensure that it is installed:<br>Upload the RPM-GPG-KEY-CentOS-7 to the spacewalk under System->Kickstarts->GPG
and SSL Keys.  Then associate that GPG key to each associated OS kickstart
profile under {ksprofile}-> System Details -> GPG & SSL.  That
will guarantee that the key is imported.  You will be able to see
it in the kickstart.<br><br></font><font size=3><br></font><br><font size=3>cheers</font><br><font size=3>L.</font><br><font size=3><br>------<br>The most dangerous phrase in the language is, "We've always done it
this way."<br><br>- Grace Hopper</font><tt><font size=2>This email originated from outside
of the company.  Please use discretion if opening attachments or clicking
on links.<br><br>_______________________________________________<br>Spacewalk-list mailing list<br>Spacewalk-list@redhat.com<br></font></tt><a href="https://www.redhat.com/mailman/listinfo/spacewalk-list"><tt><font size=2>https://www.redhat.com/mailman/listinfo/spacewalk-list</font></tt></a><br><BR>
<BR>
<BR>
**<BR>
<BR>
<BR>
<BR>
This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient.  Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law.  If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies.<BR>
<BR>
**<BR>