16.7. 기존 IdM 서버에 IdM DNS 위치가 할당되어 있는지 확인합니다.

Ansible 플레이북에서 ipaserver ansible-freeipa 모듈을 사용하여 기존 IdM(Identity Management) 서버에 특정 IdM DNS 위치가 할당되었는지 확인합니다.

ipaserver Ansible 모듈은 IdM 서버를 설치하지 않습니다.

사전 요구 사항

  • IdM 관리자 암호를 알고 있습니다.
  • IdM DNS 위치가 있습니다. 예를 들어 location은 germany 입니다.
  • 서버에 대한 루트 액세스 권한이 있어야 합니다. 예제 서버는 server123.idm.example.com 입니다.
  • 다음 요구 사항을 충족하도록 Ansible 제어 노드를 구성했습니다.

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

절차

  1. ~/MyPlaybooks/ 디렉터리로 이동합니다.

    $ cd ~/MyPlaybooks/
  2. /usr/share/doc/ansible-freeipa/playbooks/server/ 디렉터리에 있는 server-location.yml Ansible 플레이북 파일을 복사합니다.

    $ cp /usr/share/doc/ansible-freeipa/playbooks/server/server-location.yml server-location-copy.yml
  3. 편집할 server-location-copy.yml 파일을 엽니다.
  4. ipaserver 작업 섹션에서 다음 변수를 설정하고 파일을 저장하여 파일을 조정합니다.

    • ipaadmin_password 변수를 IdM 관리자 암호로 설정합니다.
    • name 변수를 server123.idm.example.com 으로 설정합니다.
    • 위치 변수를 germany 로 설정합니다.

    현재 예제에 대해 수정된 Ansible 플레이북 파일입니다.

    ---
    - name: Server enabled example
      hosts: ipaserver
      vars_files:
      - /home/user_name/MyPlaybooks/secret.yml
      tasks:
      - name: Ensure server server123.idm.example.com with location “germany” is present
        ipaserver:
          ipaadmin_password: "{{ ipaadmin_password }}"
          name: server123.idm.example.com
          location: germany
  5. Ansible 플레이북을 실행하고 플레이북 파일 및 인벤토리 파일을 지정합니다.

    $ ansible-playbook --vault-password-file=password_file -v -i inventory server-location-copy.yml
  6. SSH 를 사용하여 server123.idm.example.comroot 로 연결합니다.

    ssh root@server123.idm.example.com
  7. 업데이트가 즉시 적용되도록 서버에서 named-pkcs11 서비스를 다시 시작하십시오.

    [root@server123.idm.example.com ~]# systemctl restart named-pkcs11

추가 리소스