인프라/앤서블(Ansible)47 [ansible] ansible mssql loginame 리스트 조회 개요 - mssql에 로그인계정으로 등록된 계정중 sysadmin 권한을 가진 계정의 리스트를 조회한다. 세부내용 - ansible이 수행하는 로그인계정으로 실행하기위해 윈도우 인증을 사용하였다. - 해당 플레이북이 실행되려면 mssql loginname에 ansible 접속 윈도우계정도 등록해야한다. - ansible 2.5로 구동하기 때문에 별도의 모듈이 아닌 쉘명령어 win_command를 사용해야 한다. - 윈도우 명령어 sqlcmd에서 윈도우 인증으로 접속하여 쿼리를 수행하려면 -E 옵션이 있어야 한다. --- - name: print net user hosts: all gather_facts: no vars: ansible_connection: winrm ansible_port: 5985 an.. 2023. 2. 20. [ansilbe] basic: the specified credentials were rejected by the server 개요 - 앤서블 ansible 플레이븍 실행시 basic: the specified credentials were rejected by the server 에러에 대한 에러를 처리할 수 있다. fatal: [test-seo]: UNREACHABLE! => {"changed": false, "msg": "basic: the specified credentials were rejected by the server", "unreachable": true} 해결방법 - playbook내에 아래 옵션을 추가한다. no_log: false 2023. 2. 13. [ansible] 앤서블 병렬 실행 옵션 개요 - ansible로 실행대상 서버에게 yml 플레이북을 병렬 실행 할 수있다. - 쉘스크립트와 다르게 병렬처리가 가능하다고 하는데 블로그나 강의 영상 어디에서도 정작 어떻게 병렬처리를 하는지 안알려준다(어쩌라는건지... 핵심을 왜 안알려주는겨..) 사용방법 옵션 -f 숫자 : 동시에 yml파일을 실행할 갯수를 뜻한다. 최대갯수는 컴퓨터 사양이나 네트워크 환경에 따라 다르다고 하고 테스트해본 결과 옵션이 아예 없는 것과 있는 것(-f 15)의 실행속도 차이는 가 있었다 서버의 경우 -f 15와 -f 30의 실행완료시간 차이는 크게 차이나지 않았다. 아래 명령어는 15개를 병렬(동시에)로 처리하는 명령어다 ansible-playbook /data/ansible/$job -i /data/ansible/h.. 2023. 2. 12. [ansible] Failed to create temporary directory.In some cases, you may have been able to authenticate and did not have permissions on the target directory. Consider changing the remote tmp path in ansible.cfg to a path rooted in 개요 - ansible playbook 실행시 아래와 같은 오류를 해결할 수 있다. UNREACHABLE! => {"changed": false, "msg": "Failed to create temporary directory.In some cases, you may have been able to authenticate and did not have permissions on the target directory. Consider changing the remote tmp path in ansible.cfg to a path rooted in \"/tmp\", for more error information use -vvv. Failed command was: ( umask 77 && mkdir -p .. 2023. 2. 9. [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. 이전 1 2 3 4 5 6 ··· 10 다음 반응형