728x90
반응형

2023/11/19 3

ansible 에러 Failed to connect to the host via ssh: Permission denied

문제점 플레이북 실행시 아래와 같은 에러발생 TASK [Gathering Facts] *********************************************************************************************************************************************************************** fatal: [x.x.x.x]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).", "unreachabl..

[Ansible] 4 . Ansible Playbook 에서 hosts 인벤토리 파일 지정

nsible-playbook 지정 시 Default hosts 파일 경로는 /etc/ansible/hosts 이다. 1 [test@server1 ~]$ cat /etc/ansible/hosts 2 # This is the default ansible 'hosts' file. 3 # 4 # It should live in /etc/ansible/hosts 5 # 6 # - Comments begin with the '#' character 7 # - Blank lines are ignored 8 # - Groups of hosts are delimited by [header] elements 9 # - You can enter hostnames or ip addresses 10 # - A hostname/..

Ansible 운영 - 2. Playbook 활용 및 예제

1. Playbook Ansible은 Playbook을 활용하여 원격 서버들에 대한 설정과 배포를 관리함. YAML 포맷으로 표현되며 각각의 playbook은 한 개 이상의 play로 구성됨. 단독으로 사용되는 것이 아닌 inventory와 playbook의 조합으로 수행. 즉, inventory 파일에서 정의한 대상 서버들이 무엇을 수행할 것인지 playbook을 통해 정의함. * playbook 작성 시 주의 사항 * ● YAML 파일 작성 시 들여쓰기는 TAB 키가 아닌 Space Bar 키로 할 것 ● {{ 변수 } }가 있는 곳은 " "로 감쌀 것 > "{{ 변수 }}" ● 계층 구조상 동일한 수준의 요소들은 들여쓰기 동일하게, 하위 항목은 상위 항목보다 들여 써야 함 2. 예제 1) Ping ..

728x90
반응형