Provisioning Template issue

Problem: Provisioning Templates issue : I have created centos 8.3 template but which is throwing error so i need help to create customized template on the foreman server . for me Centos 7 which is working fine without any issue while doing provisioning

**Expected outcome: customized template issue

**Foreman and Proxy versions:**3.3.

Foreman and Proxy plugin versions: 3.3.

**Distribution and version:**3.3
Other relevant data:

Problem: Provisioning Templates issue : I have created centos 8.3 template but which is throwing error so i need help to create customized template on the foreman server . for me Centos 7 which is working fine without any issue while doing provisioning

**Expected outcome: customized template issue

**Foreman and Proxy versions:**3.3.

Foreman and Proxy plugin versions: 3.3.

**Distribution and version:**3.3
Other relevant data:

[quote="srikanthm, post:1, topic:33310, full:true"]

Problem: Provisioning Templates issue : I have created centos 8.3 template but which is throwing error so i need help to create customized template on the foreman server . for me Centos 7 which is working fine without any issue while doing provisioning

**Expected outcome: customized template issue

**Foreman and Proxy versions:**3.3.

Foreman and Proxy plugin versions: 3.3.

**Distribution and version:**3.3
Other relevant data:

[/quote]


This kickstart file was rendered from the Foreman provisioning template “Kickstart default”.

install

url --url Sign in to your account

lang en_US.UTF-8
selinux --enforcing
keyboard us
skipx

network --device=00:50:56:81:a5:8e --hostname hylforemanclient.micron.com --noipv6 --bootproto dhcp --mtu=1500 --nameserver=10.70.84.5,10.71.157.5

rootpw --iscrypted $5$nUSqKmJZdnJnLsxI$8eMmDbIAGBPR7rrE6neLN3le9LBDsIeoA2wv407r326
firewall --ssh
authconfig --useshadow --passalgo=sha256 --kickstart
timezone --utc UTC

services --disabled gpm,sendmail,cups,pcmcia,isdn,rawdevices,hpoj,bluetooth,openibd,avahi-daemon,avahi-dnsconfd,hidd,hplip,pcscd

bootloader --location=mbr --append=“nofb quiet splash=quiet”

zerombr
clearpart --all --initlabel
part /boot --fstype xfs --size 500 --asprimary
part pv.01 --ondisk sda --grow --size=8192
volgroup vg0 pv.01
logvol swap --vgname=vg0 --size=2048 --name=lvswap
logvol / --vgname=vg0 --size=2048 --name=lvroot --fstype=xfs
logvol /usr --vgname=vg0 --size=8192 --name=lvusr --fstype=xfs
logvol /tmp --vgname=vg0 --size=4096 --name=lvtmp --fstype=xfs
logvol /opt --vgname=vg0 --size=4096 --name=lvopt --fstype=xfs
logvol /var --vgname=vg0 --size=1024 --name=lvvar --fstype=xfs --grow

text
reboot

%packages
yum
dhclient
-ntp
chrony
wget
@Core
%end

%post --nochroot
exec < /dev/tty3 > /dev/tty3
chvt 3
(

chvt 1
) 2>&1 | tee /mnt/sysimage/root/install.postnochroot.log

%post
exec < /dev/tty3 > /dev/tty3
chvt 3
(
logger “Starting anaconda hylforemanclient.micron.com postinstall”

ens192 interface

real=grep -l 00:50:56:81:a5:8e /sys/class/net/*/{bonding_slave/perm_hwaddr,address} 2>/dev/null | awk -F '/' '// {print $5}' | head -1
sanitized_real=echo $real | sed s/:/_/

cat << EOF > /etc/sysconfig/network-scripts/ifcfg-$sanitized_real
BOOTPROTO=“dhcp”
DOMAIN=“micron.com
DEVICE=$real
HWADDR=“00:50:56:81:a5:8e”
ONBOOT=yes
PEERDNS=yes
PEERROUTES=yes
DEFROUTE=yes
MTU=1500
EOF

echo “Updating system time”
yum -y install ntpdate
systemctl enable --now ntpd
/usr/sbin/hwclock --systohc

update all the base packages from the updates repository

if [ -f /usr/bin/dnf ]; then
dnf -y update
else
yum -t -y update
fi

user_exists=false
getent passwd root >/dev/null 2>&1 && user_exists=true

if $user_exists; then

mkdir -p ~root/.ssh

cat << EOF >> ~root/.ssh/authorized_keys
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC8iRY0QIwm6Lk33F+kbZDJKeSyMJmJFkl3RDowvPAV5BqIk3hqlfaxDiQlRrBvsOYk/LyuKDee0ST+oF6P41ymfDnfulLi5XSzFcFehU7yI+r4josjjS5iaWDN9aho3Hr0QJHeWdfQJiSL63m4R/vC6vrTRoacX+9NWW5zF9RXYpHKVLpiiWXH6Yu6E16I6mZCwfTQ1Wq3l/lHnQNOXsBjHAlx330GQXtxhFKIWEWhMACMfpURe3gXbHNQxU3WKrnCsPjhh79NMHnW72/ac3Q9yJS4+vCyeZPO62kt7f4eW8qEuQ/603vlVGsUS4ANMfB34OF7GO8hPl5het1lQ2iT foreman-proxy@hylformanproxy.micron.com
EOF

chmod 0700 ~root/.ssh
chmod 0600 ~root/.ssh/authorized_keys
chown -R root: ~root/.ssh

Restore SELinux context with restorecon, if it’s available:

command -v restorecon && restorecon -RvF ~root/.ssh || true

else
echo ‘The remote_execution_ssh_user does not exist and remote_execution_create_user is not set to true. remote_execution_ssh_keys snippet will not install keys’
fi

touch /tmp/foreman_built

chvt 1
) 2>&1 | tee /root/install.post.log

copy %pre log files into chroot

%post --nochroot
cp -vf /tmp/.pre..log /mnt/sysimage/root/
%end

%post
if test -f /tmp/foreman_built; then
echo “calling home: build is done!”
if [ -x /usr/bin/curl ]; then
/usr/bin/curl -o /dev/null --noproxy * -H ‘Content-Type: text/plain’ --data @/root/install.post.log --silent ‘http://hylformanproxy.micron.com:8000/unattended/built?token=85b4b3dc-077e-4a9a-bdec-5e5a834429e4
elif [ -x /usr/bin/wget ]; then
/usr/bin/wget -q -O /dev/null --no-proxy --method POST --header ‘Content-Type: text/plain’ --body-file=/root/install.post.log ‘http://hylformanproxy.micron.com:8000/unattended/built?token=85b4b3dc-077e-4a9a-bdec-5e5a834429e4
else
wget -q -O /dev/null --header ‘Content-Type: text/plain’ ‘http://hylformanproxy.micron.com:8000/unattended/built?token=85b4b3dc-077e-4a9a-bdec-5e5a834429e4
fi
else
echo “calling home: build failed!”
if [ -x /usr/bin/curl ]; then
/usr/bin/curl -o /dev/null --noproxy * -H ‘Content-Type: text/plain’ --data @/root/install.post.log --silent ‘http://hylformanproxy.micron.com:8000/unattended/failed?token=85b4b3dc-077e-4a9a-bdec-5e5a834429e4
elif [ -x /usr/bin/wget ]; then
/usr/bin/wget -q -O /dev/null --no-proxy --method POST --header ‘Content-Type: text/plain’ --body-file=/root/install.post.log ‘http://hylformanproxy.micron.com:8000/unattended/failed?token=85b4b3dc-077e-4a9a-bdec-5e5a834429e4
else
wget -q -O /dev/null --header ‘Content-Type: text/plain’ ‘http://hylformanproxy.micron.com:8000/unattended/failed?token=85b4b3dc-077e-4a9a-bdec-5e5a834429e4
fi
fi
sync
%end

This is too hard to read if you don’t put the text into a preformatted block using three backquotes ```

i have verified about the script which is related to %end issue on the kickstart script . currently i am getting another issue . Please see below screenshot and suggest me


i am using below installation media.

Please suggest me .

Meaning? What did you do? What was the problem?

That depends on the question above and still on a readable copy of the kickstart in play.

Same answer as before: it’s better to copy relevant text from the console instead of a image screenshot.

As the error suggests: “Error setting up software source”. It seems wrong in the kickstart file or the network isn’t correct. More indications about the reason should be in the output before that screen or possibly if you select 3 and check what it is using.





Please see above screenshot and suggest on it and i am trying to upload the kickstart image but i am not able to select option.

kickstart.tar (10 KB)
Please see above tart file which is related to kickstart image file

As I wrote before: the Repo URL you are using isn’t working. Either the URL is wrong or the network isn’t working. The URL doesn’t work for me. Use the shell tab and check the URL and the network connection.

there is no issue with network as we can able to install successfully with centos7.9 from the same server .

i am kindly requesting you Please suggest me link to download the software for Almha linux so i will download the software and test the OS

Again: the repo URL is is not working. See installation menu no. 3: “Error setting up software source”. You really have to check that.

Switch to the shell pane and try to connect to that URL using curl. It seems that isn’t working.

This means either the URL is wrong or the network isn’t as you expect.

You don’t know if there is no issue with the network until you check for it. Only because another server gets the correct network configuration doesn’t mean this one gets it, too.

Sorry, but I don’t think it’s a good idea to sidetrack this. You are trying to install CentOS 8.3. That has nothing to do with AlmaLinux…





Please find the screenshot and suggest me
when we use centos 7.9 which is successfully completed with below link Sign in to your account
whereas centos8 having issue.

Again: you really have to check the URL the kickstart is using. You can access the host. O.K. So it’s not a network issue. Still you need to access the exact URL, following redirects.

I cannot access any repository pkts.micron.com. It seems to require a login on any URL. Thus, I cannot tell if the URL is usable at all or not.

I don’t know how you are supposed to authenticate to gain access there. Check the exact URL. Follow redirects or use -L with curl.

If you did not posted screenshots but copied the text into a preformatted block, everything would be so much more readable and easier…


text format could not able to get as i am working on console so i updated screenshot. .
Please any suggestion

while i am using below instllation media which is able to install successfully


only i am getting issue while i am using centos8.

You must understand that it is pointless to use different URLs in all your posts. You are using CentOS 8.3 with the kickstart repo and now you check CentOS 8.4 with the os repo. I don’t know what’s available on ptks.micron.com as it’s not publicly accessible.

So you really must check the URL that you have passed to the installer. It’s pointless to check various other URLs which may be working. You really must check the URL you have passed to the installer… That is the only way to verify if it’s correct or not. Other URLs won’t tell you.

1 Like