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

Ansible 플레이북을 사용하는 DNS 항목이 없는 IdM 클라이언트에서 실행 중인 HTTP 서버가 있는지 확인하려면 다음 절차를 따르십시오. IPv6를 사용하는 경우 IdM 호스트에 DNS A 항목이 없거나 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 을 열어 편집합니다. ipaservice 작업에서 ipaadmin_passwordname 변수를 찾습니다.

    ---
    - 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 플레이북을 실행합니다. 플레이북 파일, 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. IdentityServices 로 이동합니다.

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

추가 리소스