ansible_inventory 썸네일형 리스트형 ansible inventory(인벤토리) 설정 Ansible inventory 설정 Ansible은 인벤토리로 알려진 목록 또는 목록 그룹을 사용하여 인프라의 여러 관리 노드 또는 "호스트"에 대해 동시에 작동합니다. 인벤토리가 정의되면 패턴을 사용하여 Ansible을 실행할 호스트 또는 그룹을 선택합니다.(대상 서버 리스트) 구성 설정(Configuration settings) ANSIBLE_CONFIG (환경 변수에 지정한 경우) ansible.cfg (현재 디렉토리) ~/.ansible.cfg (홈 디렉토리) /etc/ansible/ansible.cfg (기본) vim ~/.ansible.cfg cat ~/.ansible.cfg [defaults] inventory = ~/inventory/hosts.ini host_key_checking = .. 더보기 [Ansible] lineinfile 모듈 Ansible lineinfile 모듈 lineinfile 모듈 - 호스트 파일 편집(/etc/ansible/hosts) $ ansible dbs -m lineinfile -b -K -a "dest=/etc/hosts line='10.31.3.72 galera01' state=present" BECOME password: db1 | CHANGED => { "backup": "", "changed": true, "msg": "line added" } db3 | CHANGED => { "backup": "", "changed": true, "msg": "line added" } db2 | CHANGED => { "backup": "", "changed": true, "msg": "line added" } $.. 더보기 이전 1 다음