Skip to content

Commit

Permalink
Add OSDISK SUT_NETDEVICE for agama profile dynamic variable
Browse files Browse the repository at this point in the history
  • Loading branch information
Dawei-Pang committed Mar 7, 2025
1 parent 8191ec8 commit a9e713a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 16 deletions.
19 changes: 4 additions & 15 deletions data/autoyast_hanaperf/agama-config.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
storage: {
drives: [
{
search: '/dev/disk/by-id/scsi-SATA_DELLBOSS_VD_b68e1f8449390010',
search: '/dev/disk/by-id/{{OSDISK}}',
partitions: [
{ search: '*', delete: true },
{ generate: 'default' },
Expand Down Expand Up @@ -63,24 +63,13 @@
chroot: true,
body: |||
#!/usr/bin/env bash
HOST_INFO_DB=(
"hana01","2c:ea:7f:ea:b0:24"
"hana02","2c:ea:7f:ea:ad:0c"
"hana03","2c:ea:7f:ea:bd:7c"
"hana04","5c:6f:69:14:14:12"
"hana05","5c:6f:69:13:f3:84"
)
for HOST_INFO in ${HOST_INFO_DB[@]}; do
IFS=',' read -r HOST_SHORT_NAME HOST_MAC <<< "${HOST_INFO}"
if ip link show | grep -qi "${HOST_MAC}";then
break
fi
done
echo 'PermitRootLogin yes' > /etc/ssh/sshd_config.d/root.conf
# Workaround for sshd service deactivated bsc#1238590
systemctl enable sshd
# Workaround for NetworkManager to make sure the expected NIC up only
rm -f /etc/NetworkManager/system-connections/default_connection.nmconnection
echo -e "[main]\nno-auto-default=type:ethernet" > /etc/NetworkManager/conf.d/disable_auto.conf
echo -e "[connection]\nid=nic0\nuuid=$(uuidgen)\ntype=ethernet\n[ethernet]\nmac-address=${HOST_MAC}\n[ipv4]\nmethod=auto\n" > /etc/NetworkManager/system-connections/nic0.nmconnection
echo -e "[connection]\nid=nic0\nuuid=$(uuidgen)\ntype=ethernet\n[ethernet]\nmac-address={{SUT_NETDEVICE}}\n[ipv4]\nmethod=auto\n" > /etc/NetworkManager/system-connections/nic0.nmconnection
chmod 0600 /etc/NetworkManager/system-connections/nic0.nmconnection
# Workaround to set SELinux as permissive
cp /boot/grub2/grub.cfg /boot/grub2/grub.cfg.orig
Expand Down
2 changes: 1 addition & 1 deletion lib/autoyast.pm
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ sub expand_variables {
# Expand other variables
my @vars = qw(SCC_REGCODE SCC_REGCODE_HA SCC_REGCODE_GEO SCC_REGCODE_HPC
SCC_REGCODE_LTSS SCC_REGCODE_WE SCC_REGCODE_SLES4SAP SCC_URL ARCH LOADER_TYPE NTP_SERVER_ADDRESS
AGAMA_PRODUCT_ID
AGAMA_PRODUCT_ID OSDISK SUT_NETDEVICE
REPO_SLE_MODULE_DEVELOPMENT_TOOLS SCC_REGCODE_LIVE);
# Push more variables to expand from the job setting
my @extra_vars = push @vars, split(/,/, get_var('AY_EXPAND_VARS', ''));
Expand Down

0 comments on commit a9e713a

Please sign in to comment.