[Spacewalk-list] spacewalk 1.7 provisioning centos 6.3

Lint Thomas Thomas.Lint at external.t-systems.at
Mon Sep 24 13:49:54 UTC 2012


Okay thanks for your answer.

So you can confirm spacewalk 1.7 provisioning does work with centos 6.3 in a 64bit environment?

-----Ursprüngliche Nachricht-----
Von: spacewalk-list-bounces at redhat.com [mailto:spacewalk-list-bounces at redhat.com] Im Auftrag von Wojtak, Greg (Superfly)
Gesendet: Montag, 24. September 2012 15:44
An: spacewalk-list at redhat.com
Betreff: Re: [Spacewalk-list] spacewalk 1.7 provisioning centos 6.3

I've kickstarted several Cent 6.3 servers from my spacewalk install, so I can at the very least let you know it does work.  Where are you seeing it rely on up2date?

Greg Wojtak
Sr. Unix Systems Engineer
Office: (313) 373-4306
Cell: (734) 718-8472


From: Lint Thomas <Thomas.Lint at external.t-systems.at<mailto:Thomas.Lint at external.t-systems.at>>
Reply-To: "spacewalk-list at redhat.com<mailto:spacewalk-list at redhat.com>" <spacewalk-list at redhat.com<mailto:spacewalk-list at redhat.com>>
Date: Monday, September 24, 2012 9:08 AM
To: "spacewalk-list at redhat.com<mailto:spacewalk-list at redhat.com>" <spacewalk-list at redhat.com<mailto:spacewalk-list at redhat.com>>
Subject: [Spacewalk-list] spacewalk 1.7 provisioning centos 6.3

Hello,

while configuring spacewalk 1.7 on centos 6.3 a problem occurred at centos 6.3 provisioning. I guess it is caused by the generated kickstart config  and the ongoing installation procedure that relies on up2date which is not shipped with centos 6.3 anymore.

Setup:
Spacewalk Server
Centos 6.3 x64 minimal
Spacewalk 1.7 postgreSQL

We Configured Spacewalk 1.7 and created a Software Channel, added a Repo and created a kickstart profile which is published via http.
Our client machine initiates the installation over PXE-boot and retrieves the Centos6.3 base install image from cobbler. The automatic generated kickstart file does not work with centos 6.3 even though we selected the correct distribution.

Are there know issues/incompatibilities with centos 6.3? does anyone know when 6.3 will be fully supported or how to fix the described issue?

There the paste of the automatic generated spacewalk kickstart config:

# Kickstart config file generated by Spacewalk Config Management # Profile Label : Centos6_x64-test # Date Created  : Thu Sep 20 17:21:13 CEST 2012

install
text
network --bootproto dhcp
url --url http://spacewalk1.sec/ks/dist/centos6-x64
lang en_US
keyboard us
zerombr
clearpart --all
bootloader --location mbr
timezone America/New_York
auth --enablemd5 --enableshadow
rootpw --iscrypted $1$vtNOYEQs$2T/hfAVCjWc.BlBtroMlQ/
selinux --permissive
reboot
firewall --disabled
skipx
part /boot --fstype=ext3 --size=200
part pv.01 --size=1000 --grow
part swap --size=1000   --maxsize=2000
volgroup myvg pv.01
logvol / --vgname=myvg --name=rootvol --size=1000 --grow

%packages
%end

%pre

wget "http://spacewalk1.sec/cblr/svc/op/trig/mode/pre/profile/Centos6_x64-test:1:SpacewalkDefaultOrganization" -O /dev/null

echo "Saving RHN keys..." > /dev/ttyS0
SYSTEM_ID=/etc/sysconfig/rhn/systemid
rhn_keys_found=no

mkdir -p /tmp/rhn

drives=$(list-harddrives | awk '{print $1}') for disk in $drives; do
    DISKS="$DISKS $(fdisk -l /dev/$disk | grep -v "swap\|LVM\|Extended" | awk '/^\/dev/{print $1}')"
done

# Try to find the keys on ordinary partitions for disk in $DISKS; do
    name=test-$(basename $disk)
    mkdir -p /tmp/$name
    mount $disk /tmp/$name
    [ $? -eq 0 ] || continue # Skip to the next partition if the mount fails

    # Copy current RHN host keys out to be reused
    if [ -f /tmp/${name}$SYSTEM_ID ]; then
        cp -a /tmp/${name}$SYSTEM_ID /tmp/rhn
        rhn_keys_found="yes"
        umount /tmp/$name
        break
    fi
    umount /tmp/$name
    rm -r /tmp/$name
done

# Try LVM if that didn't work
if [ "$rhn_keys_found" = "no" ]; then
    lvm lvmdiskscan
    vgs=$(lvm vgs | tail -n +2 | awk '{ print $1 }')
    for vg in $vgs; do
        # Activate any VG we found
        lvm vgchange -ay $vg
    done

    lvs=$(lvm lvs | tail -n +2 | awk '{ print "/dev/" $2 "/" $1 }')
    for lv in $lvs; do
        tmpdir=$(mktemp -d findkeys.XXXXXX)
        mkdir -p /tmp/${tmpdir}
        mount $lv /tmp/${tmpdir} || continue # Skip to next volume if this fails

        # Let's see if the keys are in there
        if [ -f /tmp/${tmpdir}$SYSTEM_ID ]; then
            cp -a /tmp/${tmpdir}$SYSTEM_ID /tmp/rhn/
            rhn_keys_found="yes"
            umount /tmp/${tmpdir}
            break # We're done!
        fi
        umount /tmp/${tmpdir}
        rm -r /tmp/${tmpdir}
    done

    # And clean up..
    for vg in $vgs; do
        lvm vgchange -an $vg
    done
fi


%end

%post --nochroot
mkdir /mnt/sysimage/tmp/ks-tree-copy
if [ -d /oldtmp/ks-tree-shadow ]; then
cp -fa /oldtmp/ks-tree-shadow/* /mnt/sysimage/tmp/ks-tree-copy elif [ -d /tmp/ks-tree-shadow ]; then cp -fa /tmp/ks-tree-shadow/* /mnt/sysimage/tmp/ks-tree-copy fi cp /etc/resolv.conf /mnt/sysimage/etc/resolv.conf cp -f /tmp/ks-pre.log* /mnt/sysimage/root/ || :

%end

%post --nochroot --interpreter /usr/bin/python
try:
    import xmlrpclib
    import shutil
    import sys
    import os.path
    old_system_id = "/tmp/rhn/systemid"
    new_system_id = "/mnt/sysimage/root/systemid.old"

    new_keys = "1-f8fa019b2fc1d692d9dcad6ce2ddbf8e"
    for key in new_keys.split(','):
        if key.startswith('re-'):
            sys.exit(0)
    if os.path.exists(old_system_id):
        client =  xmlrpclib.Server("http://spacewalk1.sec/rpc/api")
        key = client.system.obtain_reactivation_key(open(old_system_id).read())
        f = open("/mnt/sysimage/tmp/key","w")
        f.write(key)
        f.close()
        shutil.copy(old_system_id, new_system_id)
except:
    # xml rpc due to  a old/bad system id
    # we don't care about those
    # we'll register those as new.
    pass


%end

%post --log /root/ks-rhn-post.log


# --Begin Spacewalk command section--
cat > /tmp/ssl-key-1 <<'EOF'
## <certificate removed by author>

EOF
# ssl-key1
cat /tmp/ssl-key-* > /usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT
perl -pe 's/RHNS-CA-CERT/RHN-ORG-TRUSTED-SSL-CERT/g' -i /etc/sysconfig/rhn/up2date

mkdir -p /tmp/rhn_rpms/optional
cd /tmp/rhn_rpms/optional
wget -P /tmp/rhn_rpms/optional http://spacewalk1.sec/download/package/ecc93e74e509e28e0866753fa36ce6a469d2c3f9/0/1/5705/pyOpenSSL-0.10-2.el6.x86_64.rpm http://spacewalk1.sec/download/package/67b0f77afcf12ec0e87c1dc501192699d5d5d27c/0/1/6295/rhnlib-2.5.51-1.el6.noarch.rpm http://spacewalk1.sec/download/package/52b9915e3a5adedb4420cbdcf37f3f33c733058a/0/1/6014/libxml2-python-2.7.6-4.el6_2.4.x86_64.rpm
rpm -Uvh --replacepkgs --replacefiles /tmp/rhn_rpms/optional/pyOpenSSL* /tmp/rhn_rpms/optional/rhnlib* /tmp/rhn_rpms/optional/libxml2-python*
perl -npe 's|^(\s*(noSSLS\|s)erverURL\s*=\s*[^:]+://)[^/]*/|${1}spacewalk1.sec/|' -i /etc/sysconfig/rhn/up2date

# now copy from the ks-tree we saved in the non-chroot checkout cp -fav /tmp/ks-tree-copy/* / rm -Rf /tmp/ks-tree-copy # --End Spacewalk command section--

# begin cobbler snippet
# set default MOTD
echo "Kickstarted on $(date +'%Y-%m-%d')" >> /etc/motd

# begin Red Hat management server registration mkdir -p /usr/share/rhn/ wget http://spacewalk1.sec/pub/RHN-ORG-TRUSTED-SSL-CERT -O /usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT
perl -npe 's/RHNS-CA-CERT/RHN-ORG-TRUSTED-SSL-CERT/g' -i /etc/sysconfig/rhn/* key=""
if [ -f /tmp/key ]; then
    key=`cat /tmp/key`
fi

if [ $key ]; then
    rhnreg_ks --serverUrl=https://spacewalk1.sec/XMLRPC --sslCACert=/usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT --activationkey=$key,1-f8fa019b2fc1d692d9dcad6ce2ddbf8e
else
     rhnreg_ks --serverUrl=https://spacewalk1.sec/XMLRPC --sslCACert=/usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT --activationkey=1-f8fa019b2fc1d692d9dcad6ce2ddbf8e
fi
# end Red Hat management server registration

# end cobbler snippet

rhn_check

# Start post_install_network_config generated code # End post_install_network_config generated code

%end


%post


# Start koan environment setup
echo "export COBBLER_SERVER=spacewalk1.sec" > /etc/profile.d/cobbler.sh echo "setenv COBBLER_SERVER spacewalk1.sec" > /etc/profile.d/cobbler.csh # End koan environment setup



wget "http://spacewalk1.sec/cblr/svc/op/ks/profile/Centos6_x64-test:1:SpacewalkDefaultOrganization" -O /root/cobbler.ks wget "http://spacewalk1.sec/cblr/svc/op/trig/mode/post/profile/Centos6_x64-test:1:SpacewalkDefaultOrganization" -O /dev/null %end



*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
Notice: This e-mail contains information that is confidential and may be privileged.
If you are not the intended recipient, please notify the sender and then delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*

_______________________________________________
Spacewalk-list mailing list
Spacewalk-list at redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-list




More information about the Spacewalk-list mailing list