본문 바로가기

인프라/앤서블(Ansible)47

[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.
[Ansible] windows 파일배포 & 압축 해제 윈도우 시스템에 zip파일을 배포 후 압축 해제 함 --- - 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: deploy disk mount file win_copy: src: '/data/ansible/file/Disk_Part.ps1' dest: 'c:\Disk_Part.ps1' - name: run powershell win_shell: 'powershell.exe -ExecutionPolicy Bypass -File c:\Di.. 2022. 7. 27.
반응형