Ansible 제어 노드 설정
Ansible 제어 노드를 설정하려면 SUSE Multi-Linux Manager Web UI에서 다음 단계를 실행합니다.
To configure a client as the Ansible Control Node, the Ansible package must be installed on that system. Usually, the Ansible package should be obtained from the operating system vendor’s official repositories. For example, on SUSE Linux Enterprise 15 SP6 and SP7, Ansible is available through the |
-
In the SUSE Multi-Linux Manager Web UI, navigate to
, verify thatSUSE Linux Enterprise Server 15 SP6 x86_64
(or later) with theSystems Management Module
and the requiredPython 3 Module
are selected and synchronized. -
Deploy a SUSE Linux Enterprise 15 SP6 (or later) client.
-
In the SUSE Multi-Linux Manager Web UI, navigate to the
page of the client. Select and subscribe the client to theSUSE Linux Enterprise Server 15 SP6 x86_64
(or later SP),Systems Management Module
andPython 3 Module
channels. -
클라이언트의
을 선택합니다.Add-On System Types
목록에서Ansible 제어 노드
를 활성화한 후 속성 업데이트를 클릭합니다. -
클라이언트 개요 페이지로 이동하여
를 선택하고 Highstate 적용을 클릭합니다. -
이벤트 탭을 선택하고 highstate의 상태를 확인합니다.
If you want to install a newer Ansible on a SUSE Linux Enterprise 15 SP4 or SP5 client, you must enable the |
Newer versions of Ansible no longer support managing nodes with outdated Python versions. If a managed node still defaults to an older Python version, you may encounter connection errors or failures during playbook runs. To address this, user should upgrade Python on the managed node, if possible and set the correct Python interpreter in the Ansible inventory or configuration. |
1. Ansible 인벤토리 파일 생성
Ansible Integration 도구는 플레이북을 인벤토리 파일로 배포합니다. _테이블 1_에 나열된 각 운영 체제에 대해 인벤토리 파일을 하나씩 생성합니다.
-
Ansible에서 관리할 인벤토리 파일에 호스트를 생성 및 추가합니다. Ansible 인벤토리의 기본 경로는
/etc/ansible/hosts
입니다.Listing 1. 인벤토리 예시client240.mgr.example.org client241.mgr.example.org client242.mgr.example.org client243.mgr.example.org ansible_ssh_private_key_file=/etc/ansible/some_ssh_key [mygroup1] client241.mgr.example.org client242.mgr.example.org [mygroup2] client243.mgr.example.org [all:vars] ansible_ssh_private_key_file=/etc/ansible/my_ansible_private_key
-
SUSE Multi-Linux Manager Web UI의
Ansible
탭에서 로 이동하여 제어 노드에 인벤토리 파일을 추가합니다. -
Playbook Directories
섹션에서Add a Playbook Directories
필드에/usr/share/scap-security-guide/ansible
을 추가한 후 저장을 클릭합니다. -
인벤토리
에서인벤토리 파일 추가
필드에 인벤토리 파일 위치를 추가하고 저장을 클릭합니다.Listing 2. 예시/etc/ansible/sles15 /etc/ansible/sles12 /etc/ansible/centos7
더 많은 플레이북 예시는 https://github.com/ansible/ansible-examples에서 확인할 수 있습니다.
2. Ansible 노드와 통신 설정하기
-
인벤토리에서 사용 중인 SSH 키를 생성합니다.
ssh-keygen -f /etc/ansible/my_ansible_private_key
-
생성된 SSH 키를 Ansible 관리 클라이언트에 복사합니다. 예시는 다음과 같습니다.
ssh-copy-id -i /etc/ansible/my_ansible_private_key root@client240.mgr.example.org
-
/etc/ansible/ansible.cfg
에 다음과 같이 개인 키를 선언합니다.private_key_file = /etc/ansible/my_ansible_private_key
my_ansible_private_key
를 개인 키가 포함된 파일의 이름으로 바꿉니다. -
제어 노드에서 다음 명령을 실행하여 Ansible 작동 여부를 테스트하십시오.
ansible all -m ping ansible mygroup1 -m ping ansible client240.mgr.example.org -m ping
이제 수정을 실행할 수 있습니다. 자세한 내용은 코드형 규정 준수에서 확인할 수 있습니다.