전적으로 신참입니다. RHEL Centos 7 노드에서 Windows 2012 R2를 구성하려고합니다. Winrm Credssp를 사용하여 이들 간의 연결을 설정할 수 있습니다. 다음은 /etc/ansible/group_vars/windows.yml 파일psexec 모듈을 사용하여 .exe 설치 작업을 오랫동안/무기한으로 실행할 수있는 Playbook
---
ansible_user: admin
ansible_password: XXXXXXX
ansible_winrm_scheme: https
ansible_winrm_transport: credssp
ansible_port: 5986
ansible_connection: winrm
ansible_winrm_server_cert_validation: ignore
validate_certs: false
에서의/etc/ansible/hosts 파일에 내가 정의 창을 내가에서 테스트 연결을위한 모듈을 win_ping 실행 FQDN
[windows]
xx.xx.xx.xx
입니다 중앙 Linux 노드를 Windows 2012 R2 서버로 업그레이드했습니다.
[[email protected] playbooks]# ansible windows -m win_ping
XX.XX.XX.XX | SUCCESS => {
"changed": false,
"ping": "pong"
}
하지만 그것은 아니므로, ansible - 각본의 playbook.yml 명령을 제출 한 후, 그것을 지속적으로 한정없는 때를 기다리고, 각본 파일 이하로 사용하여 로컬 드라이브에 샘플 .EXE (VLC) 파일을 설치하려고 한 경우 .exe 설치 완료. 참고 : PsExec.exe 위치는 PATH 환경 변수에서 업데이트됩니다.
---
- name: Windows ansible playbook
hosts: windows
tasks:
- name: installing VLC
win_psexec:
command: 'E:\\Softwares\\VLC.exe'
system: yes
다음은 위 게임 플레이블용 호환 게임 플레이 명령어를 제출 한 후의 콘솔 출력입니다.
PLAY [Windows ansible playbook] ************************************************
TASK [Gathering Facts] *********************************************************
ok: [192.168.2.14]
TASK [installing VLC] **********************************************************
다음은 지속적으로 동일한 로그입니다. 계속 대기 중입니다. 로그는 매 20 초 동안 같은/업데이트를 계속 위에 은/var/로그/ansible /는
2017-10-27 22:22:32,574 p=4269 u=root | TASK [installing VLC] **********************************************************
2017-10-27 22:22:32,672 requests_credssp.credssp The credentials that will be used in the auth, DOMAIN: '.', USER: 'admin'
2017-10-27 22:22:32,675 requests.packages.urllib3.connectionpool Starting new HTTPS connection (1): 192.168.2.14
2017-10-27 22:22:32,712 requests.packages.urllib3.connectionpool "POST /wsman HTTP/1.1" 401 0
2017-10-27 22:22:32,714 requests_credssp.credssp _start_tls_handshake(): Starting TLS handshake with server
2017-10-27 22:22:32,715 requests.packages.urllib3.connectionpool Resetting dropped connection: 192.168.2.14
2017-10-27 22:22:32,771 requests.packages.urllib3.connectionpool "POST /wsman HTTP/1.1" 401 0
2017-10-27 22:22:32,774 requests.packages.urllib3.connectionpool "POST /wsman HTTP/1.1" 401 0
2017-10-27 22:22:32,775 requests_credssp.credssp _start_tls_handshake(): Handshake complete. Protocol: TLSv1.2, Cipher: ECDHE-RSA-AES256-GCM-SHA384
2017-10-27 22:22:32,775 requests_credssp.credssp _get_authentication_token(): creating NTLM negotiate token and add it to the initial TSRequest
2017-10-27 22:22:32,776 requests_credssp.credssp _get_authentication_token(): NTLM Negotiate Token: TlRMTVNTUAABAAAAMpCI4gEAAQAoAAAAAAAAACkAAAAGAbEdAAAADy4=
2017-10-27 22:22:32,776 requests_credssp.credssp _get_authentication_token(): get NTLM challenge token from the server and add it to the ntlm context
2017-10-27 22:22:32,777 requests.packages.urllib3.connectionpool "POST /wsman HTTP/1.1" 401 0
2017-10-27 22:22:32,779 requests_credssp.credssp _get_authentication_token(): NTLM Challenge Token: TlRMTVNTUAACAAAADwAPADgAAAA2goriAQ4M49EAIqMAAAAAAAAAAJgAmABHAAAACgBaKQAAAA9ERVNLVE9QLUVETEFLRzQCAB4ARABFAFMASwBUAE8AUAAtAEUARABMAEEASwBHADQAAQAeAEQARQBTAEsAVABPAFAALQBFAEQATABBAEsARwA0AAQAHgBEAEUAUwBLAFQATwBQAC0ARQBEAEwAQQBLAEcANAADAB4ARABFAFMASwBUAE8AUAAtAEUARABMAEEASwBHADQABwAIAGOmEf9DT9MBAAAAAA==
2017-10-27 22:22:32,779 requests_credssp.credssp _get_authentication_token(): create NTLM authentication token
2017-10-27 22:22:32,782 requests_credssp.credssp _send_auth_response(): Generate the encrypted public key data and add it to the TSRequest
2017-10-27 22:22:32,783 requests_credssp.credssp _send_auth_response(): Send TSRequest structure containing the final auth token and public key info
2017-10-27 22:22:32,783 requests_credssp.credssp _send_auth_response(): Get the public key structure response from the server
2017-10-27 22:22:32,786 requests.packages.urllib3.connectionpool "POST /wsman HTTP/1.1" 401 0
2017-10-27 22:22:32,786 requests.packages.urllib3.connectionpool "POST /wsman HTTP/1.1" 401 0
2017-10-27 22:22:32,787 requests_credssp.credssp _verify_public_keys(): Get raw public key from the server and decrypt it for verification
2017-10-27 22:22:32,788 requests_credssp.credssp _verify_public_keys(): verification of the server's public key is successful
2017-10-27 22:22:32,788 requests_credssp.credssp _send_encrypted_credentials(): Sending the encrypted credentials to the server
2017-10-27 22:22:32,822 requests.packages.urllib3.connectionpool "POST /wsman HTTP/1.1" 200 1636
2017-10-27 22:22:32,832 requests.packages.urllib3.connectionpool "POST /wsman HTTP/1.1" 200 847
2017-10-27 22:22:33,116 requests.packages.urllib3.connectionpool "POST /wsman HTTP/1.1" 200 753
2017-10-27 22:22:33,889 requests.packages.urllib3.connectionpool "POST /wsman HTTP/1.1" 200 998
2017-10-27 22:22:53,934 requests.packages.urllib3.connectionpool "POST /wsman HTTP/1.1" 500 1320
2017-10-27 22:23:13,978 requests.packages.urllib3.connectionpool "POST /wsman HTTP/1.1" 500 1320
2017-10-27 22:23:34,024 requests.packages.urllib3.connectionpool "POST /wsman HTTP/1.1" 500 1320
2017-10-27 22:23:54,069 requests.packages.urllib3.connectionpool "POST /wsman HTTP/1.1" 500 1320
2017-10-27 22:24:14,114 requests.packages.urllib3.connectionpool "POST /wsman HTTP/1.1" 500 1320
를 기록합니다. 이 작업 .exe 설치가 완료되지 않았습니다.
2017-10-27 22:24:14,114 requests.packages.urllib3.connectionpool "POST /wsman HTTP/1.1" 500 1320
.exe 파일 설치가 완료되도록 Windows 측에서해야 할 변경/업데이트를 제안하십시오.