4.2. 자동화 실행 환경을 구축할 때 자동화 허브 인증 세부 정보 사용
다음 예제를 사용하여 최종 자동화 실행 환경 이미지에 노출하지 않고 자동화 허브 인증 세부 정보를 자동화 실행 환경 빌드에 전달하도록 기본 정의 파일을 사용자 지정합니다.
사전 요구 사항
-
Red Hat 인증 컬렉션의 API 토큰 검색에서와 같이 API 토큰을 생성하고 이를 안전한 위치(예:
token.txt
라는 파일에 저장)에 저장했습니다. - 자동화 허브 API 토큰으로 채워지는 빌드 인수를 정의합니다.
export ANSIBLE_GALAXY_SERVER_AUTOMATION_HUB_TOKEN=$(cat <token.txt>)
export ANSIBLE_GALAXY_SERVER_AUTOMATION_HUB_TOKEN=$(cat <token.txt>)
additional_build_steps: prepend_galaxy: # define a custom build arg env passthru- we still also have to pass # `--build-arg ANSIBLE_GALAXY_SERVER_AUTOMATION_HUB_TOKEN` to get it to pick it up from the host env - ARG ANSIBLE_GALAXY_SERVER_AUTOMATION_HUB_TOKEN - ENV ANSIBLE_GALAXY_SERVER_LIST=automation_hub - ENV ANSIBLE_GALAXY_SERVER_AUTOMATION_HUB_URL=https://console.redhat.com/api/automation-hub/content/<yourhuburl>-synclist/ - ENV ANSIBLE_GALAXY_SERVER_AUTOMATION_HUB_AUTH_URL=https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token
additional_build_steps:
prepend_galaxy:
# define a custom build arg env passthru- we still also have to pass
# `--build-arg ANSIBLE_GALAXY_SERVER_AUTOMATION_HUB_TOKEN` to get it to pick it up from the host env
- ARG ANSIBLE_GALAXY_SERVER_AUTOMATION_HUB_TOKEN
- ENV ANSIBLE_GALAXY_SERVER_LIST=automation_hub
- ENV ANSIBLE_GALAXY_SERVER_AUTOMATION_HUB_URL=https://console.redhat.com/api/automation-hub/content/<yourhuburl>-synclist/
- ENV ANSIBLE_GALAXY_SERVER_AUTOMATION_HUB_AUTH_URL=https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token
추가 리소스
- 자동화 실행 환경 정의 파일의 다른 부분에 대한 자세한 내용은 정의 파일 콘텐츠 분석을 참조하십시오.