100장. Ansible을 사용하여 IdM 서버 관리
Red Hat Ansible Engine 을 사용하여 IdM(Identity Management) 토폴로지에서 서버를 관리할 수 있습니다. ansible-freeipa 패키지에서 server 모듈을 사용하여 IdM 토폴로지에 서버가 있거나 없는지 확인할 수 있습니다. 복제본을 숨기거나 복제본을 볼 수도 있습니다.
섹션에는 다음 항목이 포함되어 있습니다.
100.1. Ansible을 사용하여 IdM 서버가 있는지 확인 링크 복사링크가 클립보드에 복사되었습니다!
Ansible 플레이북에서 ipaserver ansible-freeipa 모듈을 사용하여 IdM(Identity Management) 서버가 있는지 확인할 수 있습니다.
ipaserver Ansible 모듈에서는 IdM 서버를 설치하지 않습니다.
사전 요구 사항
-
IdM
관리자암호를 알고 있습니다. 다음 요구 사항을 충족하도록 Ansible 제어 노드를 구성했습니다.
- Ansible 버전 2.14 이상을 사용하고 있습니다.
-
Ansible 컨트롤러에
ansible-freeipa패키지가 설치되어 있습니다. - 이 예제에서는 ~/MyPlaybook/ 디렉터리에서 IdM 서버의 FQDN(정규화된 도메인 이름)을 사용하여 Ansible 인벤토리 파일을 생성했다고 가정합니다.
-
이 예제에서는 secret.yml Ansible 자격 증명 모음이
ipaadmin_password를 저장하는 것으로 가정합니다.
ansible-freeipa모듈이 실행되는 노드인 대상 노드는 IdM 도메인의 일부인 IdM 클라이언트, 서버 또는 복제본입니다.-
제어 노드에서 인벤토리 파일에 정의된 IdM 서버로의
SSH연결이 올바르게 작동합니다.
-
제어 노드에서 인벤토리 파일에 정의된 IdM 서버로의
절차
~/MyPlaybooks/ 디렉터리로 이동합니다.
cd ~/MyPlaybooks/
$ cd ~/MyPlaybooks/Copy to Clipboard Copied! Toggle word wrap Toggle overflow /usr/share/doc/ansibleAnsible 플레이북 파일을 복사합니다.-freeipa/playbooks/server/ 디렉터리에 있는 server-present.ymlcp /usr/share/doc/ansible-freeipa/playbooks/server/server-present.yml server-present-copy.yml
$ cp /usr/share/doc/ansible-freeipa/playbooks/server/server-present.yml server-present-copy.ymlCopy to Clipboard Copied! Toggle word wrap Toggle overflow -
편집을 위해
server-present-copy.yml파일을 엽니다. ipaserver작업 섹션에서 다음 변수를 설정하여 파일을 수정하고 파일을 저장합니다.-
ipaadmin_password변수를 IdM관리자의암호로 설정합니다. -
name변수를 서버의FQDN으로 설정합니다. 예제 서버의FQDN은 server123.idm.example.com 입니다.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Ansible 플레이북을 실행하고 플레이북 파일 및 인벤토리 파일을 지정합니다.
ansible-playbook --vault-password-file=password_file -v -i inventory server-present-copy.yml
$ ansible-playbook --vault-password-file=password_file -v -i inventory server-present-copy.ymlCopy to Clipboard Copied! Toggle word wrap Toggle overflow