본문 바로가기

인프라/앤서블(Ansible)48

[ANSIBLE] 앤서블 업그레이드 및 윈도우 모듈 동작 방법 개요- ANSIBLE 업그레이드를  할 수 있다.- 명령을 받는 에이전트가 UBUNTU 24.04일 경우 구버전에서는 파이썬 버전 이슈로 플레이북 동작이 안됨 세부내용- 윈도우 모듈의 경우 ansible-galaxy를 통해 별도로 설치해야하며, jenkins에서 동작하기 위해서별도의 공간에 다운로드 및 설치 후 ansible.cfg에 경로지정을 해야한다. # 기존버전 확인$ ansible --versionansible 2.10.8 config file = /etc/ansible/ansible.cfg configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible .. 2025. 3. 4.
[ANSIBLE] 앤서블 ansible Timeout (12s) waiting for privilege escalation prompt 해결방법 개요- 앤서블 플레이북 실행중 아래와 같은 에러가 출력된다 ansible Timeout (12s) waiting for privilege escalation promptfatal: [TEST-game01]: FAILED! => {"msg": "Timeout (12s) waiting for privilege escalation prompt: "} 원인- Test-game01서버의 ssh 로그인 타임이 10초를 초과해서 발생하는 문제다- 나의 경우에 로컬 로그인이 아닌 freeipa연동을 통한 인증이라 ssh인증시 약간의 지연이 있었다- asnible에서 기본 timeout은 10초이다- timeout을 늘려주면 해결된다 해결방법- /etc/ansible/ansible.cfg에서 아래 설정을 한다[defau.. 2024. 10. 18.
[ANSIBLE] 앤서블 ansible.legacy.setup": {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python3 에러 해결방법 개요- ansible 서버 마이그레이션 후 기존에 잘되던 명령이 일부 호스트에아래와 같은 에러를 뱉으면서 수행되 않는 문제가 발생했다.- ansible이 명령을 내리는 host에 설치된 python을 이용하는데 해당 python 모듈이제대로 동작되지 않으면서 발생된 문제다.- test-seo라는 서버에는 python3가 설치되어 있음에도 명령에러가 발생하는 상황이다 fatal: [test-seo]: FAILED! => {"ansible_facts": {}, "changed": false, "failed_modules": {"ansible.legacy.setup": {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python3"}, "excep.. 2024. 10. 17.
[ANSIBLE] 윈도우 업데이트 목록 추출하기 젠킨스를 통해서 윈도우 업데이트 목록을 추출할 수 있다. - hosts: all gather_facts: no vars: ansible_connection: winrm ansible_winrm_server_cert_validation: ignore ansible_winrm_scheme: http ansible_become: false ansible_winrm_transport: basic ansible_port: 5985 tasks: - name: windows update list win_shell: | Get-HotFix | ForEach-Object { [PSCustomObject]@{ FullName = hostname HotFixID = $_.HotFixID Date = (Get-Date $_... 2024. 3. 8.
[ANSIBLE] winrm or requests is not installed: No module named 'winrm' 해결방법 개요 ansible 신규 설치 후 윈도우 서버에 ansible playbook 수행시 다음과 같은 에러가 발생한다 winrm or requests is not installed: No module named 'winrm' 원인 ansible에서 구동되는 python버전과 서버에 설치된 python버전이 달라 pip을 통한 pywinrm 설치시 모듈이 없다고 인식하기 때문이다 위 내역을 보면 ansible python3.11.5를 사용한다고 나와있는데 서버에는 python3.6 pip를 사용하고 잇는 것이다. 그래서 다음과 같이 처리하였다. 해결방법 아래 명령어 수행 # python3.11설치 sudo dnf install python3.11 curl https://bootstrap.pypa.io/get-.. 2024. 2. 7.
반응형