Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with Oracle 8 kickstart autoinstallation (with ISO) #3887

Closed
vampywiz17 opened this issue Jun 16, 2021 · 11 comments
Closed

Problem with Oracle 8 kickstart autoinstallation (with ISO) #3887

vampywiz17 opened this issue Jun 16, 2021 · 11 comments
Labels
bug Something isn't working P3

Comments

@vampywiz17
Copy link

Version of Uyuni Server and Proxy (if used)

Information for package Uyuni-Server-release:
---------------------------------------------
Repository     : Uyuni Server Stable
Name           : Uyuni-Server-release
Version        : 2021.05-123.2.uyuni
Arch           : x86_64
Vendor         : obs://build.opensuse.org/systemsmanagement:Uyuni
Support Level  : Level 3
Installed Size : 1.4 KiB
Installed      : Yes
Status         : up-to-date
Source package : Uyuni-Server-release-2021.05-123.2.uyuni.src
Summary        : Uyuni Server
Description    :
    Uyuni lets you efficiently manage physical, virtual,
    and cloud-based Linux systems. It provides automated and cost-effective
    configuration and software management, asset management, and system
    provisioning.

Details about issue

I try to install Oracle Linux 8 U4 with kickstart autoinstall (i also try U2m but same result) but i get this every time this error:

image

It seems that a spelling error in kickstart configuration... i use a wizard generated kickstart config and only set the activation key, all other parameter is default.

I also use kickstart autoinstallation with Centos7, but with that system is working well.

@vampywiz17 vampywiz17 added the bug Something isn't working label Jun 16, 2021
@vampywiz17 vampywiz17 changed the title Uyuni Bugreport - Uyuni YYYY.MM Problem with Oracle 8 kickstart autoinstallation (with ISO) Jun 16, 2021
@Shirocco88
Copy link
Contributor

@vampywiz17 : which kickstart skript are you using ?
could you please provide the whole logfile.

@vampywiz17
Copy link
Author

vampywiz17 commented Jun 16, 2021

@Shirocco88

# Kickstart config file generated by Uyuni Config Management
# Profile Label : oracle_8_default
# Date Created  : 2021-06-16 14:18:31.789663

install
text
network --bootproto dhcp
url --url http://******/ks/dist/org/1/oracle_8
lang en_US
keyboard us
zerombr
clearpart --all
bootloader --location mbr
timezone Europe/Paris
auth --enableshadow --passalgo=sha256
rootpw --iscrypted 
selinux --permissive
reboot
firewall --disabled
skipx
repo --name=AppStream --baseurl=http://******/ks/dist/org/1/oracle_8/AppStream
autopart --type=lvm

%packages 
perl
wget
salt-minion
%end

%pre
# Error: no snippet data for kickstart_start




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
if [ -f /usr/bin/python3 ]; then
    interpreter=/usr/bin/python3
else
    interpreter=/usr/bin/python
fi

cat << EOF | ${interpreter}

try:  # python 2
    import xmlrpclib
except ImportError:  # python 3
    import xmlrpc.client as xmlrpclib
import shutil
import sys
import os.path

try:
    old_system_id = "/tmp/rhn/systemid"
    new_system_id = "/mnt/sysimage/root/systemid.old"
    tmp_key = "/mnt/sysimage/tmp/key"

    new_keys = "1-4e17d002b66035967d2c443f223b87a2,1-oracle_8"
    for key in new_keys.split(','):
        if key.startswith('re-'):
            sys.exit(0)
    if os.path.exists(old_system_id):
        client =  xmlrpclib.Server("http://******/rpc/api")
        key = client.system.obtain_reactivation_key(open(old_system_id).read())
        if os.path.exists(tmp_key):
            f = open(tmp_key, "r+")
            contents = f.read()
            if contents and not contents[-1] == ',':
                f.write(',')
        else:
            f = open(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

EOF

%end

%post --log /root/ks-rhn-post.log
# --Begin Uyuni command section--
cat > /tmp/ssl-key-1 <<'EOF'
Certificate:
    Data:
        Version: 3 (0x2)
        Serial Number:
            a7:26:98:7f:bb:48:8e:84
    Signature Algorithm: sha256WithRSAEncryption
        Issuer: C = HU, ST = Jasz-Nagykun-Szolnok, L = Jaszarokszallas, O = Rosenberger, OU = IT, CN = ******
        Validity
            Not Before: Aug  5 13:49:36 2019 GMT
            Not After : Aug  2 13:49:36 2029 GMT
        Subject: C = HU, ST = Jasz-Nagykun-Szolnok, L = Jaszarokszallas, O = Rosenberger, OU = IT, CN = ******
        Subject Public Key Info:
            Public Key Algorithm: rsaEncryption
                Public-Key: (2048 bit)
                Modulus:
                    00:cd:89:0d:d8:e1:bb:20:a2:d9:fc:b8:60:a7:1b:
                    85:9d:91:8b:4e:76:40:fe:b8:88:b2:68:ce:0d:90:
                    da:e7:ca:42:fc:25:ed:a8:cd:27:b5:75:40:af:e1:
                    ec:62:d8:10:bb:50:b7:54:c1:81:9b:05:61:a4:ab:
                    46:57:78:87:45:d3:63:89:f9:c1:27:f7:27:f1:f3:
                    da:e8:4d:d5:9a:1f:a3:02:2c:04:33:35:a1:92:4a:
                    02:ed:11:36:a7:34:eb:eb:fc:68:7a:da:1e:22:b5:
                    ef:14:11:3e:2d:cd:c8:3b:37:aa:f7:3a:e0:0f:5c:
                    c0:67:39:39:34:7d:4e:0a:e3:d8:e1:c7:f7:3d:bb:
                    55:4a:57:e4:8c:a9:34:4b:4c:92:69:7c:8a:d7:a1:
                    8d:7a:21:33:d1:a2:8c:1b:11:f9:d9:18:5f:1d:37:
                    7d:d9:4f:36:cc:d1:ab:5f:f2:6f:55:c8:af:6a:74:
                    7a:6c:66:94:2b:5a:46:e7:6a:d7:67:d0:fc:c2:98:
                    4e:48:02:88:bb:3b:ca:b1:6e:c0:f4:05:97:e4:8e:
                    76:61:b9:d1:3c:92:fc:2b:83:cc:24:94:55:f4:1e:
                    19:79:ab:27:01:b2:0c:75:45:be:02:db:e8:d5:87:
                    b9:2d:89:19:d5:bd:d9:64:66:44:b7:d6:e6:ee:4d:
                    a5:6d
                Exponent: 65537 (0x10001)
        X509v3 extensions:
            X509v3 Basic Constraints: 
                CA:TRUE
            X509v3 Key Usage: 
                Digital Signature, Key Encipherment, Certificate Sign
            X509v3 Extended Key Usage: 
                TLS Web Server Authentication, TLS Web Client Authentication
            Netscape Comment: 
                RHN SSL Tool Generated Certificate
            X509v3 Subject Key Identifier: 
                8D:FB:06:1F:49:89:40:DF:6C:88:E9:BC:EC:07:FA:8E:0E:F2
            X509v3 Authority Key Identifier: 
                keyid:8D:FB:06:1F:49:89:40:FB:32:DF:6A:8E:0E:F2
                DirName:/C=HU/ST=Jasz-Nagykun-Szolnok/L=Jaszarokszallas/O=Rosenberger/OU=IT/CN=******
                serial:A7:26:98:7F:BB:48:8E:84

    Signature Algorithm: sha256WithRSAEncryption
         2e:88:a6:21:d5:3c:be:93:74:16:2b:8f:35:7a:e7:37:65:a3:
         1f:5f:03:ee:c4:67:53:be:da:7f:78:4a:78:09:7d:b9:b2:1e:
         60:db:c7:81:5d:a0:4a:cf:19:f6:9c:91:78:c1:ea:c1:4c:a9:
         b4:fd:54:45:ef:e8:5e:d0:cb:f8:64:d5:b1:41:26:24:47:9b:
         2a:3a:9d:1e:b6:1b:a3:4c:50:d3:90:c5:ee:5b:e6:b1:92:1e:
         f8:80:38:27:c8:26:f7:14:4a:2f:6c:fc:1e:26:ea:d7:2e:01:
         3c:04:37:81:55:fa:ac:ea:73:af:9d:49:83:20:a2:d8:37:1a:
         3d:7a:ba:e5:d8:8f:e8:62:d5:a8:2e:5b:35:06:3c:3e:b3:b5:
         05:1a:c8:37:21:2e:a1:aa:c4:18:69:bf:19:92:f8:3c:0b:a3:
         89:01:6f:96
-----BEGIN CERTIFICATE-----
MIIFCDCCA/CgAwIBAgIJAKcmmH+7SI6EMA0GCSqGSIb3DQEBCwUAMIGTMQswCQYD
VQQGEwJIVTEdMBsGA1UECAwUSmFzei1OYWd5a3VuLVN6b2xub2sxGDAWBgNVBAcM
D0phc3phcm9rc3phbGxhczEUMBIGA1UECgwLUm9zZW5iZXJnZXIxCzAJBgNVBAsM
AklUMSgwJgYDVQQDDB9odW4yNS0xNHYuaGZ0LnJvc2VuYmVyZ2VyLmxvY2FsMB4X
DTE5MDgwNTEzNDkzNloXDTI5MDgwMj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e0Q
OZECRbYCT1KO+4Bd+Ar4S1U/wKNwTm1PjEyvE+qi6h7KUoyaah6MlRCgJnR7Nar8
RpqAyFmW4lD4wd9aDZci+viAOCfIJvcUSi9s/B4m6tcuATwEN4FV+qzqc6+dSYMg
otg3Gj16uuXYj+hi1aguWzUGPD6ztQUayDchLqGqxBhpvxmS+DwLo4kBb5Y=
-----END CERTIFICATE-----

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

perl -npe 's|^(\s*(noSSLS\|s)erverURL\s*=\s*[^:]+://)[^/]*/|${1}******/|' -i /etc/sysconfig/rhn/up2date

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

# begin cobbler snippet

# Start post_install_network_config generated code
# End post_install_network_config generated code

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

# begin SUSE Manager registration
cat <<EOF >"/etc/salt/minion.d/susemanager.conf"
master: ******
server_id_use_crc: adler32
enable_legacy_startup_events: False
enable_fqdns_grains: False
mine_enabled: False

EOF



cat <<EOF >>"/etc/salt/minion.d/susemanager.conf"
grains:
    susemanager:
EOF
cat <<EOF >>"/etc/salt/minion.d/susemanager.conf"
        management_key: "1-4e17d002b66035967d2c443f223b87a2"
EOF
cat <<EOF >>"/etc/salt/minion.d/susemanager.conf"
        activation_key: "1-oracle_8"
EOF

# if you don't want to register, set the 'dont_register' variable

systemctl restart salt-minion
systemctl enable salt-minion

YAOU_SYSCFGFILE="/etc/sysconfig/automatic_online_update"
if [ -f "$YAOU_SYSCFGFILE" ]; then
  echo "* Disable YAST automatic online update."
  sed -i 's/^ *AOU_ENABLE_CRONJOB.*/AOU_ENABLE_CRONJOB="false"/' "$YAOU_SYSCFGFILE"
  for D in /etc/cron.*; do
    test -L $D/opensuse.org-online_update && rm $D/opensuse.org-online_update
  done
fi

echo "* Disable all repos not provided by SUSE Manager Server."
zypper ms -d --all
zypper ms -e --medium-type plugin
zypper mr -d --all
zypper mr -e --medium-type plugin

# end SUSE Manager registration

# end cobbler snippet
%end


%post


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


# Error: no snippet data for kickstart_done


%end

@vampywiz17
Copy link
Author

@Shirocco88

I dont know, where the log that i able to help you investigate the probem.

@vampywiz17
Copy link
Author

@Shirocco88

Now i try with Rocky Linux 8 and Centos 8. Same error...

@sbluhm
Copy link
Contributor

sbluhm commented Aug 2, 2021

@vampywiz17 , I believe that all required files are in the /root directory.
i.e.

ks-post.log.1
ks-rhn-post.log

Can you please attach the files including your kickstart script (instead of posting it)? Posting it might strip/convert some charaters.

@vampywiz17
Copy link
Author

vampywiz17 commented Aug 3, 2021

@sbluhm

Thats all that i see:

image

I only found this in syslog:

image

kickstart script

oracle_8_default.txt

@vampywiz17
Copy link
Author

vampywiz17 commented Sep 1, 2021

@sbluhm @Shirocco88

Today i update latest Uyuni (2021.08) but not help at all. I try Rocky Linux 8 (now it is officially supported) but exactly same problem. All RH7 based distro install well with kickstart, but 8 based distros create exact same issue... I search the net months ago, but not found what cause the problem....

@vampywiz17
Copy link
Author

vampywiz17 commented Sep 6, 2021

what do you think this problem is connected this? sloria/doitlive#45

similar error message, and it cause the multi line commands

It possible that this is the problematic line?

DISKS="$DISKS $(fdisk -l /dev/$disk | grep -v "swap\|LVM\|Extended" | awk '/^\/dev/{print $1}')"

possible that the "\" think that is a line break?

@mcalmer
Copy link
Contributor

mcalmer commented May 2, 2022

I wonder if this is a problem of Uyuni, or a problem of the Kickstart profile or anaconda itself.

@mcalmer mcalmer added the P3 label May 2, 2022
@cbosdo
Copy link
Contributor

cbosdo commented Aug 28, 2023

Is this still an issue? I recall testing Rocky Linux 8 autoinstallation working OK recently

@vampywiz17
Copy link
Author

I not use this system anymore, i migrate all of them to opensuse. So i can not able to test it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P3
Projects
None yet
Development

No branches or pull requests

5 participants