2.8. ライフサイクル環境ごとのホストグループの作成
以下の手順を使用して、ライブラリーライフサイクル環境のホストグループを作成し、他のライフサイクル環境向けに、ネストされたホストグループを追加します。
手順
ライフサイクル環境ごとにホストグループを作成するには、以下の Bash スクリプトを実行します。
MAJOR="My_Major_OS_Version" ARCH="My_Architecture" ORG="My_Organization" LOCATIONS="My_Location" PTABLE_NAME="My_Partition_Table" DOMAIN="My_Domain" hammer --output csv --no-headers lifecycle-environment list --organization "${ORG}" | cut -d ',' -f 2 | while read LC_ENV; do [[ ${LC_ENV} == "Library" ]] && continue hammer hostgroup create --name "rhel-${MAJOR}server-${ARCH}-${LC_ENV}" \ --architecture "${ARCH}" \ --partition-table "${PTABLE_NAME}" \ --domain "${DOMAIN}" \ --organizations "${ORG}" \ --query-organization "${ORG}" \ --locations "${LOCATIONS}" \ --lifecycle-environment "${LC_ENV}" done