7장. Ansible 플레이북을 사용하여 글로벌 IdM 설정 구성
Ansible config
모듈을 사용하여 IdM(Identity Management)에 대한 글로벌 구성 매개변수를 검색하고 설정할 수 있습니다.
7.1. Ansible 플레이북을 사용하여 IdM 구성 검색
다음 절차에서는 Ansible 플레이북을 사용하여 현재 글로벌 IdM 구성에 대한 정보를 검색하는 방법을 설명합니다.
사전 요구 사항
제어 노드에서 다음을 수행합니다.
- Ansible 버전 2.15 이상을 사용하고 있습니다.
-
freeipa.ansible_freeipa
컬렉션을 설치했습니다. - 이 예제에서는 ~/MyPlaybooks/ 디렉터리에서 IdM 서버의 FQDN(정규화된 도메인 이름)을 사용하여 Ansible 인벤토리 파일을 생성했다고 가정합니다.
-
이 예제에서는 secret.yml Ansible vault가
ipaadmin_password
를 저장하고 secret.yml 파일을 보호하는 암호를 저장하는 파일에 대한 액세스 권한이 있다고 가정합니다.
-
freeipa.ansible_freeipa
모듈이 실행되는 대상 노드인 대상 노드는 IdM 도메인의 일부입니다. IdM 클라이언트, 서버 또는 복제본입니다.
프로세스
[optional]
/usr/share/ansible/collections/ansible_collections/freeipa/ansible_freeipa/playbooks/config/retrieve-config.yml
Ansible 플레이북 파일을 확인합니다.--- - name: Playbook to handle global IdM configuration hosts: ipaserver become: no gather_facts: no vars_files: - /home/user_name/MyPlaybooks/secret.yml tasks: - name: Query IPA global configuration freeipa.ansible_freeipa.ipaconfig: ipaadmin_password: "{{ ipaadmin_password }}" register: serverconfig - debug: msg: "{{ serverconfig }}"
--- - name: Playbook to handle global IdM configuration hosts: ipaserver become: no gather_facts: no vars_files: - /home/user_name/MyPlaybooks/secret.yml tasks: - name: Query IPA global configuration freeipa.ansible_freeipa.ipaconfig: ipaadmin_password: "{{ ipaadmin_password }}" register: serverconfig - debug: msg: "{{ serverconfig }}"
Copy to Clipboard Copied! Ansible 플레이북을 실행합니다. 플레이북 파일을 지정하고 secret.yml 파일을 보호하는 암호를 저장하는 파일 및 인벤토리 파일을 지정합니다.
ansible-playbook --vault-password-file=password_file -v -i path_to_inventory_directory/inventory.file /usr/share/ansible/collections/ansible_collections/freeipa/ansible_freeipa/playbooks/config/retrieve-config.yml
$ ansible-playbook --vault-password-file=password_file -v -i path_to_inventory_directory/inventory.file /usr/share/ansible/collections/ansible_collections/freeipa/ansible_freeipa/playbooks/config/retrieve-config.yml [...] TASK [debug] ok: [server.idm.example.com] => { "msg": { "ansible_facts": { "discovered_interpreter_ }, "changed": false, "config": { "ca_renewal_master_server": "server.idm.example.com", "configstring": [ "AllowNThash", "KDC:Disable Last Success" ], "defaultgroup": "ipausers", "defaultshell": "/bin/bash", "emaildomain": "idm.example.com", "enable_migration": false, "groupsearch": [ "cn", "description" ], "homedirectory": "/home", "maxhostname": "64", "maxusername": "64", "pac_type": [ "MS-PAC", "nfs:NONE" ], "pwdexpnotify": "4", "searchrecordslimit": "100", "searchtimelimit": "2", "selinuxusermapdefault": "unconfined_u:s0-s0:c0.c1023", "selinuxusermaporder": [ "guest_u:s0$xguest_u:s0$user_ ], "usersearch": [ "uid", "givenname", "sn", "telephonenumber", "ou", "title" ] }, "failed": false } }
Copy to Clipboard Copied!