26.8. Ansible 플레이북을 사용하여 서비스의 Kerberos 주체 별칭이 있는지 확인

일부 시나리오에서는 IdM 관리자가 Kerberos 주체 별칭을 사용하여 IdM 사용자, 호스트 또는 서비스에서 Kerberos 애플리케이션에 인증할 수 있도록 하는 것이 좋습니다. 이러한 시나리오에는 다음이 포함됩니다.

  • 사용자 이름이 변경되었지만 사용자는 이전 사용자 이름과 새 사용자 이름을 모두 사용하여 시스템에 로그인할 수 있어야 합니다.
  • IdM Kerberos 영역이 이메일 도메인과 다른 경우에도 사용자는 이메일 주소를 사용하여 로그인해야 합니다.

client.idm.example.com 에서 실행되는 HTTP 서비스에 대한 HTTP/mycompany.idm.example.com 의 주요 별칭을 생성하려면 다음 절차를 따르십시오.

사전 요구 사항

  • IdM 관리자 암호를 알고 있습니다.
  • 다음 요구 사항을 충족하도록 Ansible 제어 노드를 구성했습니다.

    • Ansible 버전 2.14 이상을 사용하고 있습니다.
    • Ansible 컨트롤러에 ansible-freeipa 패키지가 설치되어 있습니다.
    • 이 예제에서는 ~/MyPlaybook/ 디렉터리에서 IdM 서버의 FQDN(정규화된 도메인 이름)을 사용하여 Ansible 인벤토리 파일을 생성했다고 가정합니다.
    • 이 예제에서는 secret.yml Ansible 자격 증명 모음이 ipaadmin_password 를 저장한다고 가정합니다.
  • 호스트에 HTTP 서비스를 설정했습니다.
  • HTTP 서비스를 IdM에 등록했습니다.
  • HTTP를 설정한 호스트는 IdM 클라이언트입니다.

절차

  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-member-principal-present.yml Ansible 플레이북 파일을 복사합니다. 예를 들어 다음과 같습니다.

    $ cp /usr/share/doc/ansible-freeipa/playbooks/service/service-member-principal-present.yml /usr/share/doc/ansible-freeipa/playbooks/service/service-member-principal-present-copy.yml
  4. 편집할 /usr/share/doc/ansible-freeipa/playbooks/service-member-principal-present-copy.yml Ansible 플레이북 파일을 엽니다.
  5. 다음을 변경하여 파일을 조정합니다.

    • ipaadmin_password 변수에서 지정한 IdM 관리자 암호입니다.
    • name 변수로 지정된 서비스의 이름입니다. 이는 서비스의 정식 주체 이름입니다. 현재 예에서는 HTTP/client.idm.example.com 입니다.
    • 보안 주체 변수에서 지정한 Kerberos 사용자 별칭입니다. 이는 name 변수로 정의된 서비스에 추가할 별칭입니다. 현재 예에서는 host/mycompany.idm.example.com 입니다.
    • tasks 섹션의 name 변수로 지정된 작업의 이름입니다.

      현재 예제를 위해 조정된 후에는 복사된 파일은 다음과 같습니다.

    ---
    - name: Service member principal present
      hosts: ipaserver
    
      vars_files:
      - /home/user_name/MyPlaybooks/secret.yml
      tasks:
      - name: Service HTTP/client.idm.example.com member principals host/mycompany.idm.exmaple.com present
        ipaservice:
          ipaadmin_password: "{{ ipaadmin_password }}"
          name: HTTP/client.idm.example.com
          principal:
            - host/mycompany.idm.example.com
          action: member
  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-member-principal-present-copy.yml

플레이북을 실행하면 0에 연결할 수 없으며 0 failed 작업이 발생하면 HTTP/client.idm.example.com 서비스에 대한 host/mycompany.idm.example.com Kerberos 주체를 성공적으로 생성했습니다.

추가 리소스