ansible控制windows安裝及運行error與解決方案

來源:互聯網
上載者:User

標籤:ansible error   ansible windows   

Q1:安裝kerberos報錯

$ sudo pip install kerberosrunning build_extbuilding ‘kerberos‘ extensioncreating buildcreating build/temp.linux-x86_64-2.7creating build/temp.linux-x86_64-2.7/srcgcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c src/base64.c -o build/temp.linux-x86_64-2.7/src/base64.o sh: 1: krb5-config: not foundgcc: error: sh:: No such file or directorygcc: error: 1:: No such file or directorygcc: error: krb5-config:: No such file or directorygcc: error: not: No such file or directorygcc: error: found: No such file or directoryerror: command ‘gcc‘ failed with exit status 1----------------------------------------Command /usr/bin/python -c "import setuptools;__file__=‘/etc/ansible/scripts/build/kerberos/setup.py‘;exec(compile(open(__file__).read().replace(‘\r\n‘, ‘\n‘), __file__, ‘exec‘))" install --single-version-externally-managed --record /tmp/pip-Q3eBF1-record/install-record.txt failed with error code 1Storing complete log in /home/ansible/.pip/pip.log

A1:需要先安裝libkrb5開發包

$ sudo apt-get install libkrb5-dev

安裝後解決


Q:安裝.Net 3.0以上,升級powershell-3.0後ansible依舊報錯

$ ansible windows -m win_ping -vvvUsing /etc/ansible/ansible.cfg as config fileUsing module file /usr/local/lib/python2.7/dist-packages/ansible-2.2.0-py2.7.egg/ansible/modules/core/windows/win_ping.ps1<192.168.1.11> ESTABLISH WINRM CONNECTION FOR USER: Administrator on PORT 5986 TO 192.168.1.11192.168.1.11 | UNREACHABLE! => {    "changed": false,     "msg": "ssl: HTTPSConnectionPool(host=‘192.168.1.11‘, port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x23d8c10>, ‘Connection to 192.168.1.11 timed out. (connect timeout=30)‘))",     "unreachable": true}

A:原因沒有配置winrm

必須將winrm的設定檔設定成下面配置,

> winrm set winrm/config/service  ‘@{AllowUnencrypted="true"}‘ > winrm set winrm/config/service/auth  ‘@{Basic="true"}‘

650) this.width=650;" src="http://s2.51cto.com/wyfs02/M01/89/0A/wKiom1gFy-bhI6y7AABQOm0lSnU082.png-wh_500x0-wm_3-wmp_4-s_3489884060.png" title="winrm_config.png" alt="wKiom1gFy-bhI6y7AABQOm0lSnU082.png-wh_50" />



Q:ansible控制Windows主機error1

$ ansible windows -m win_ping -vvvUsing /etc/ansible/ansible.cfg as config fileUsing module file /usr/local/lib/python2.7/dist-packages/ansible-2.2.0-py2.7.egg/ansible/modules/core/windows/win_ping.ps1<192.168.30.150> ESTABLISH WINRM CONNECTION FOR USER: Administrator on PORT 5986 TO 192.168.30.150192.168.30.150 | UNREACHABLE! => {    "changed": false,     "msg": "ssl: [Errno 1] _ssl.c:504: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed",     "unreachable": true}

A:

將設定檔/etc/ansible/hosts連接埠5986改成5985,即可解決。

[windows:vars]ansible_ssh_port=5985


原因:

 DefaultPorts

 HTTP = 5985

 HTTPS = 5986

上述錯誤是因為ssl選項是關著的


本文出自 “M層” 部落格,請務必保留此出處http://mengix.blog.51cto.com/7194660/1863015

ansible控制windows安裝及運行error與解決方案

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.