본문 바로가기

인프라/앤서블(Ansible)48

ansible playbook debug passwd 프린트 하기 원하는 호스트의 /etc/passwd에 있는 계정리스트를 출력하고자한다. {{ 변수명.stdout_lines }}의 stdout_lines를 쓰면 결과가 깔끔하게 출력됨 --- - name: print passwd hosts: "{{ varhost }}" tasks: - name: print passwdaa shell: cat /etc/passwd | awk -F ':' '{print $1}' register: print_result - name: debug print debug: msg: "{{ print_result.stdout_lines }}" 수행명령어 ansible-playbook printpasswd.yml -e "varhost=localhost" -k 2022. 5. 24.
Using a SSH password instead of a key is not possible because Host Key checking is enabled and sshpass does not support this. Please add this host's fingerprint to your known_hosts file to manage this host. 문제점 젠킨스에서 ansible 명령어 수행시 아래와같은 에러가 발생함, console에서는 잘 수행됨 Using a SSH password instead of a key is not possible because Host Key checking is enabled and sshpass does not support this. Please add this host's fingerprint to your known_hosts file to manage this host. 해결방법 /etc/ansible/ansible.cfg 파일에 아래 내역 추가 후 다시 명령 수행 [defaults] host_key_checking = False 2022. 5. 23.
ansible "msg": "Missing sudo password" ansible 명령어 수행시 "msg": "Missing sudo password" 에러가 발생한다. PLAY [linux] ************************************************************************************************************************************************************************** TASK [Gathering Facts] **************************************************************************************************************************************.. 2022. 5. 16.
리눅스 linux playbook 예제 /etc/passwd 조회 후 특정 계정 출력 --- - hosts: linux tasks: - name: get value shell: cmd: cat /etc/passwd | grep magnus register: grep_output ignore_errors: yes changed_when: false - name: Print debug: msg: "{{ inventory_hostname }}: '{{ grep_output.stdout }}'" 2022. 5. 16.
ansible command "python setup.py egg_info" failed with error code 1 문제점 pip3 install pywinrm 명령어 수행시 아래와 같은 에러코드가 출력됨 command "python setup.py egg_info" failed with error code 1 해결방안 아래 명령어 수행 sudo -H pip3 install --upgrade --ignore-installed pip setuptools 2022. 5. 12.
반응형