Red Hat Training

A Red Hat training course is available for RHEL 8

85.4. Ansible Playbook을 사용하여 DNS 없이 IdM 클라이언트에 HTTP 서비스가 있는지 확인

Ansible 플레이북을 사용하는 DNS 항목이 없는 IdM 클라이언트에서 실행 중인 HTTP 서버가 있는지 확인하려면 다음 절차를 따르십시오. 시나리오는 IdM 호스트에 사용 가능한 DNS A 항목이 없으며 IPv4 대신 IPv6를 사용하는 경우 DNS AAAA 항목이 없다는 것입니다.

사전 요구 사항

절차

  1. 인벤토리 파일을 생성합니다(예: inventory.file:

    $ touch inventory.file
  2. inventory.file 을 열고 [ipaserver] 섹션에서 구성할 IdM 서버를 정의합니다. 예를 들어 server.idm.example.com을 구성하도록 Ansible에 지시하려면 다음을 입력합니다.

    [ipaserver]
    server.idm.example.com
  3. /usr/share/doc/ansible-freeipa/playbooks/service/service-is-present-with-host-force.yml Ansible 플레이북 파일의 복사본을 만듭니다. 예를 들면 다음과 같습니다.

    $ cp /usr/share/doc/ansible-freeipa/playbooks/service/service-is-present-with-host-force.yml /usr/share/doc/ansible-freeipa/playbooks/service/service-is-present-with-host-force-copy.yml
  4. 복사된 파일 /usr/share/doc/ansible-freeipa/playbooks/service/service-is-present-with-host-force-copy.yml 을 열어 편집합니다. ipa service 작업에서 ipaadmin_password이름 변수를 찾습니다.

    ---
    - name: Playbook to manage IPA service.
      hosts: ipaserver
      gather_facts: false
    
      vars_files:
      - /home/user_name/MyPlaybooks/secret.yml
      tasks:
      # Ensure service is present
      - ipaservice:
          ipaadmin_password: "{{ ipaadmin_password }}"
          name: HTTP/ihavenodns.info
          force: yes
  5. 파일을 조정합니다.

    • ipaadmin_password 변수를 IdM 관리자 암호로 설정합니다.
    • name 변수를 HTTP 서비스가 실행 중인 호스트의 이름으로 설정합니다.
  6. 파일을 저장하고 종료합니다.
  7. Ansible 플레이북을 실행합니다. Playbook 파일, secret.yml 파일을 보호하는 암호를 저장하는 파일, 인벤토리 파일을 지정합니다.

    $ ansible-playbook --vault-password-file=password_file -v -i path_to_inventory_directory/inventory.file /usr/share/doc/ansible-freeipa/playbooks/service/service-is-present-with-host-force-copy.yml

검증 단계

  1. IdM 관리자로 IdM 웹 UI에 로그인합니다.
  2. ID서비스로 이동합니다.

이제 서비스 목록에 HTTP/client.idm.example.com@IDM.EXAMPLE.COM 이 표시됩니다.

추가 리소스