인프라/앤서블(Ansible)48 [ansible] Failed to connect to the host via ssh: ssh_exchange_identification: read: Connection reset by peer 개요 - 에러내용 처리 UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: ssh_exchange_identification: read: Connection reset by peer", "unreachable": true} 실제 ansible서버에서 해당 목적지로 ssh 계정명@서버아이피로 접근 시 아래와 같은 에러발생 ssh_exchange_identification: read: Connection reset by peer 해결방법 - /etc/hsots.allow에 아래 코드 입력 sshd: 10.10.10.10 ##ansible서버 아이피 2023. 2. 8. [ANSIBLE] POSSIBLE DNS SPOOFING DETECTED 서버자체가 변경되면 ~/.ssh/known_hosts 파일에 등록된 키값이 달라 아래와 같이 문제가 발생한다. TASK [Gathering Facts] ********************************************************* fatal: [testserver01]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ \r\n@ WARNING: POSSIBLE DNS SPOOFING DETECTED! @\r\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@.. 2022. 9. 2. [Ansible] ansible windows dns 설정 윈도우 dns주소를 ansible로 설정할 수 있다. --- - hosts: all vars: ansible_port: 5985 ansible_connection: winrm ansible_winrm_server_cert_validation: ignore ansible_winrm_scheme: http ansible_winrm_transport: basic tasks: - name: set dns win_dns_client: adapter_nates: Ethernet ipv4_addresses: "{{ vardns }}" - name: result win_shell: "powershell ipconfig /all | findstr 'DNS'" register: result - name: print deb.. 2022. 8. 8. [Ansible] 앤서블 와일드카드 find 아스테리크 - hosts: all become: yes vars: ansible_become_password: "{{ sudopasswd }}" tasks: - name: deploy check script copy: src: /data/ansible/file/scripttest.sh dest: /tmp/Unix_v1.3.3_contain_web_was.sh mode: 0755 #user: "infra" - name: exec check script shell: cmd: /tmp/scripttest.sh register: result - name: result debug: msg: "{{ result.stdout_lines }}" - name: find result file find: paths: "/home/in.. 2022. 7. 30. [Ansible] ansible fetch 앤서블 파일 끌어오기 앤서블이 제어하는 인벤토리 호스트에서의 파일을 끌어오기 위한 플러그인 취약점 결과를 파일로 남겨 앤서블 서버에 결과파일을 업로딩하는 플레이북 --- - hosts: all become: yes vars: ansible_become_password: "{{ sudopasswd }}" tasks: # 인벤토리 호스트의 /root/에 check.sh 스크립트 배포 - name: deploy check script copy: src: /data/ansible/file/check.sh dest: /root/check.sh # 실행을 위한 권한 수정 - name: exec chmod check script shell: cmd: chmod 755 /root/check.sh # check.sh 스크립트 실행&결과 저장.. 2022. 7. 29. 이전 1 2 3 4 5 6 7 ··· 10 다음 반응형