2.4. Updating the Details of Multiple Operating Systems
2.4. Updating the Details of Multiple Operating Systems
Use this procedure to update the details of multiple operating systems. This example shows you how to assign each operating system a partition table called Kickstart default, a configuration template called Kickstart default PXELinux, and a provisioning template called Kickstart Default.
Procedure
On Satellite Server, run the following Bash script:
PARTID=$(hammer --csv partition-table list | grep "Kickstart default," | cut -d, -f1)
PXEID=$(hammer --csv template list --per-page=1000 | grep "Kickstart default PXELinux" | cut -d, -f1)
SATID=$(hammer --csv template list --per-page=1000 | grep "provision" | grep ",Kickstart default" | cut -d, -f1)
for i in $(hammer --no-headers --csv os list | awk -F, {'print $1'})
do
hammer partition-table add-operatingsystem --id="${PARTID}" --operatingsystem-id="${i}"
hammer template add-operatingsystem --id="${PXEID}" --operatingsystem-id="${i}"
hammer os set-default-template --id="${i}" --config-template-id=${PXEID}
hammer os add-config-template --id="${i}" --config-template-id=${SATID}
hammer os set-default-template --id="${i}" --config-template-id=${SATID}
done
PARTID=$(hammer --csv partition-table list |grep"Kickstart default,"|cut -d, -f1)PXEID=$(hammer --csv template list --per-page=1000|grep"Kickstart default PXELinux"|cut -d, -f1)SATID=$(hammer --csv template list --per-page=1000|grep"provision"|grep",Kickstart default"|cut -d, -f1)foriin$(hammer --no-headers --csv os list |awk -F, {'print $1'})do
hammer partition-table add-operatingsystem --id="${PARTID}" --operatingsystem-id="${i}"
hammer template add-operatingsystem --id="${PXEID}" --operatingsystem-id="${i}"
hammer os set-default-template --id="${i}" --config-template-id=${PXEID}
hammer os add-config-template --id="${i}" --config-template-id=${SATID}
hammer os set-default-template --id="${i}" --config-template-id=${SATID}done
Copy to ClipboardCopied!Toggle word wrapToggle overflow
Display information about the updated operating system to verify that the operating system is updated correctly:
hammer os info --id 1
# hammer os info --id 1
Copy to ClipboardCopied!Toggle word wrapToggle overflow