자동화 허브 시작하기

Red Hat Ansible Automation Platform 2.1

Red Hat Automation Hub를 Ansible 컬렉션 콘텐츠의 기본 서버로 구성

Red Hat Customer Content Services

초록

이 가이드에서는 Red Hat 자동화 허브를 인증된 Ansible 컬렉션 콘텐츠의 기본 소스로 사용하는 데 필요한 초기 단계를 안내합니다.
피드백 제공:
이 문서를 개선하기 위한 제안이 있거나 오류를 발견한 경우, Docs 구성 요소를 사용하여 Ansible Automation Platform Jira 프로젝트에서 문제를 생성하기 위해 기술 지원에 문의하십시오 https://access.redhat.com.

머리말

Red Hat Ansible 자동화 허브는 Red Hat 가입자가 Red Hat 및 Red Hat 기술 파트너로부터 지원하는 컨텐츠를 빠르게 찾고 사용할 수 있는 공간을 제공하여 가장 어려운 환경에 대한 추가적인 확신을 제공합니다.

Ansible Galaxy 클라이언트 ansible-gal Galaxy y는 명령줄에서 역할 및 컬렉션을 관리합니다. ansible- gal#178y 클라이언트가 가능한 한 인증된 지원되는 Ansible 컬렉션을 사용하도록 하려면 Ansible 컬렉션의 기본 소스로 Red Hat 자동화 허브를 사용하도록 ansible.cfg 파일을 업데이트해야 합니다.

이 가이드에서는 인증된 Ansible 컬렉션 콘텐츠의 기본 소스로 Red Hat 자동화 허브를 사용하도록 ansible.cfg 파일을 구성하는 데 필요한 단계를 안내합니다.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 용어를 교체하기 위해 최선을 다하고 있습니다. 먼저 마스터(master), 슬레이브(slave), 블랙리스트(blacklist), 화이트리스트(whitelist) 등 네 가지 용어를 교체하고 있습니다. 이러한 변경 작업은 작업 범위가 크므로 향후 여러 릴리스에 걸쳐 점차 구현할 예정입니다. 자세한 내용은 CTO Chris Wright의 메시지를 참조하십시오.

1장. Red Hat 자동화 허브 API 토큰 생성

컬렉션을 업로드하거나 다운로드하여 자동화 허브와 상호 작용할 수 있으려면 API 토큰을 생성해야 합니다. 자동화 허브 API 토큰은 ansible-galxxxy 클라이언트를 Red Hat 자동화 허브 서버에 인증합니다.

자동화 허브 토큰 관리를 사용하여 API 토큰을 생성할 수 있습니다.

사전 요구 사항

  • Red Hat Ansible Automation Platform에 유효한 서브스크립션 인증 정보.

절차

  1. https://cloud.redhat.com/ansible/automation-hub/token/ 으로 이동합니다.
  2. 토큰 로드 를 클릭합니다.
  3. 복사 아이콘을 클릭하여 API 토큰을 클립보드에 복사합니다.
  4. API 토큰을 파일에 붙여넣고 안전한 위치에 저장합니다.
중요

API 토큰은 콘텐츠를 보호하는 데 사용되는 시크릿 토큰입니다. API 토큰을 안전한 위치에 저장합니다.

이제 자동화 허브를 기본 컬렉션 서버로 구성하거나 ansible- galqcowy 명령줄 도구를 사용하여 컬렉션을 업로드하는 데 API 토큰을 사용할 수 있습니다.

1.1. 오프라인 토큰을 활성 상태로 유지

오프라인 토큰을 활성 상태로 유지하는 것은 사용자가 오프라인인 경우에도 애플리케이션이 사용자를 대신하여 작업을 수행해야 하는 경우에 유용합니다. 예를 들어 일상적인 데이터 백업이 있습니다.

오프라인 토큰은 비활성 후 30일 후에 만료됩니다. 오프라인 토큰을 주기적으로 새로 고침하여 오프라인 토큰이 만료되지 않도록 유지할 수 있습니다.

참고

오프라인 토큰이 만료되면 새 토큰을 요청해야 합니다.

다음 명령을 주기적으로 실행하여 토큰이 만료되지 않도록 합니다.

curl https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token -d grant_type=refresh_token -d client_id="cloud-services" -d refresh_token="{{ user_token }}" --fail --silent --show-error --output /dev/null

2장. Red Hat 자동화 허브를 콘텐츠의 기본 소스로 구성

Red Hat 자동화 허브를 ansible.cfg 구성 파일에 있는 콘텐츠의 기본 소스로 정의할 수 있습니다.

사전 요구 사항

  • 자동화 허브 서버의 API 토큰을 가져옵니다. 자세한 내용은 자동화 허브 API 토큰 생성을 참조하십시오.

절차

  1. [galxxxy] 섹션 아래에 server_list 옵션을 추가하고 하나 이상의 서버 이름을 제공합니다.
  2. 각 서버 이름에 대해 새 섹션을 생성합니다.

    [galaxy_server.<server_name>]
  3. 각 서버 이름에 대해 url 옵션을 설정합니다. 서버 URL에 api/galvncy/ 하위 디렉토리를 포함해야 합니다.

    https://<server_fully_qualified_domain_name>/api/galaxy/
  4. 필요한 경우 auth_url 옵션을 설정합니다. 커뮤니티 Ansible Galaxy에는 auth_url 이 필요하지 않습니다.
  5. 자동화 허브 서버의 API 토큰을 설정합니다.

다음 ansible.cfg 예제에서는 자동화 허브가 기본 소스로 구성되고 Ansible Galaxy 서버를 보조 소스로 구성하여 우선 순위에 따라 여러 서버를 구성하는 방법을 보여줍니다.

ansible.cfg

[galaxy]
server_list = automation_hub, my_org_hub

[galaxy_server.automation_hub]
url=https://cloud.redhat.com/api/automation-hub/api/galaxy/ 1 2
auth_url=https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token

token=my_ah_token

[galaxy_server.my_org_hub]
url=https://automation.my_org/api/galaxy/ 3
username=my_user
password=my_pass

1
후행 슬래시 / 는 서버 URL을 따라야 합니다.
2
Galaxy 서버 URL에 /api/galvncy/ 하위 디렉토리를 포함합니다.
3
자동화 허브 서버 URL에 /api/galvncy/ 하위 디렉터리를 포함합니다.

이제 자동화 허브를 기본 서버로 구성하고 지원되는 컬렉션을 다운로드하여 설치할 수 있습니다.

서버 목록 구성 옵션에 대한 자세한 내용과 Ansible Galaxy를 Ansible 콘텐츠 소스로 사용하는 방법은 Ansible Galaxy 사용자 가이드를 참조하십시오.

법적 공지

Copyright © 2023 Red Hat, Inc.
The text of and illustrations in this document are licensed by Red Hat under a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is available at http://creativecommons.org/licenses/by-sa/3.0/. In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must provide the URL for the original version.
Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.
Red Hat, Red Hat Enterprise Linux, the Shadowman logo, the Red Hat logo, JBoss, OpenShift, Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.
Linux® is the registered trademark of Linus Torvalds in the United States and other countries.
Java® is a registered trademark of Oracle and/or its affiliates.
XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries.
MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other countries.
Node.js® is an official trademark of Joyent. Red Hat is not formally related to or endorsed by the official Joyent Node.js open source or commercial project.
The OpenStack® Word Mark and OpenStack logo are either registered trademarks/service marks or trademarks/service marks of the OpenStack Foundation, in the United States and other countries and are used with the OpenStack Foundation's permission. We are not affiliated with, endorsed or sponsored by the OpenStack Foundation, or the OpenStack community.
All other trademarks are the property of their respective owners.