17.5. Ansible 플레이북을 사용하여 IdM 호스트 항목이 없는지 확인

Ansible 플레이북을 사용하여 IdM(Identity Management)에 호스트 항목이 없는지 확인하려면 다음 절차를 따르십시오.

사전 요구 사항

  • IdM 관리자 인증 정보

절차

  1. 인벤토리 파일(예: inventory.file )을 생성하고 ipaserver 를 이 파일에 정의합니다.

    [ipaserver]
    server.idm.example.com
  2. 보장하려는 IdM에 없는 호스트의 FQDN( 정규화된 도메인 이름 )을 사용하여 Ansible 플레이북 파일을 생성합니다. IdM 도메인에 DNS가 통합된 경우 updatedns: yes 옵션을 사용하여 DNS에서 호스트에 대한 모든 종류의 연결된 레코드를 제거합니다.

    이 단계를 단순화하기 위해 /usr/share/doc/ansible-freeipa/playbooks/host/delete-host.yml 파일에서 예제를 복사하고 수정할 수 있습니다.

    ---
    - name: Host absent
      hosts: ipaserver
    
      vars_files:
      - /home/user_name/MyPlaybooks/secret.yml
      tasks:
      - name: Host host01.idm.example.com absent
        ipahost:
          ipaadmin_password: "{{ ipaadmin_password }}"
          name: host01.idm.example.com
          updatedns: yes
          state: absent
  3. 플레이북을 실행합니다.

    $ ansible-playbook --vault-password-file=password_file -v -i path_to_inventory_directory/inventory.file path_to_playbooks_directory/ensure-host-absent.yml
참고

절차는 다음과 같습니다.

  • IdM Kerberos 영역에는 호스트가 존재하지 않습니다.
  • IdM LDAP 서버에 호스트 항목이 없습니다.

클라이언트 호스트 자체에서 SSSD(System Security Services Daemon)와 같은 시스템 서비스의 특정 IdM 구성을 제거하려면 클라이언트에서 ipa-client-install --uninstall 명령을 실행해야 합니다. 자세한 내용은 IdM 클라이언트 설치 제거를 참조하십시오.

검증 단계

  1. admin으로 ipaserver 에 로그인합니다.

    $ ssh admin@server.idm.example.com
    Password:
    [admin@server /]$
  2. host01.idm.example.com 에 대한 정보를 표시합니다.

    $ ipa host-show host01.idm.example.com
    ipa: ERROR: host01.idm.example.com: host not found

출력은 호스트가 IdM에 없음을 확인합니다.