본문 바로가기

Ansible

ansible 에러

fatal: [localhost]: FAILED! => {"ansible_facts": {}, "changed": false, "failed_modules": {"setup": {"failed": true, "module_stderr": "sudo: a password is required\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}}, "msg": "The following modules failed to execute: setup\n"}

 

해결 방법

1. 일단 ping이 나가는지 확인해야 한다.

ansible all -m ping
== 아래 처럼 떠야한다.
node2 | SUCCESS => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python"
    },
    "changed": false,
    "ping": "pong"
}
node3 | SUCCESS => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python"
    },
    "changed": false,
    "ping": "pong"
}
node1 | SUCCESS => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python"
    },
    "changed": false,
    "ping": "pong"
}

 

2. root 계정에서 vim으로 /etc/sudoers/ 파일 수정해야한다.

vim /etc/sudoers

 99 ## Allow root to run any commands anywhere
100 root    ALL=(ALL)       ALL
101 vagrant ALL=(ALL)       NOPASSWD: ALL

'Ansible' 카테고리의 다른 글

0215  (1) 2024.02.15
ansible!!!  (1) 2024.02.15
ansible 기본 환경설정  (2) 2024.02.13
ansible 수요일  (1) 2024.02.07
ansible 2일차  (2) 2024.02.07