我正在学习理智。 我的笔记本电脑正在运行Windows 7并且是域的一部分。 我已经在我的笔记本电脑的虚拟机内部安装了Ubuntu linux,并在其中安装了Ansible以及其他python和kerberos软件包。 也configuration了kerberos,但无法使用windows模块甚至使用win_ping来ping我的笔记本电脑。 Ansible我认为仍然试图使用ssh而不是winrm。
在group_vars / windows.yml文件中添加了用户和密码信息。 域名是lab.test.com
运行命令ansible laptop -m win_ping -vvvvv时得到的消息
Loaded callback minimal of type stdout, v2.0 <laptop.lab.test.com> ESTABLISH SSH CONNECTION FOR USER: None <laptop.lab.test.com> SSH: ansible.cfg set ssh_args: (-o)(ControlMaster=auto)(-o)(ControlPersist=60s) <laptop.lab.test.com> SSH: ansible_password/ansible_ssh_pass not set: (-o)(KbdInteractiveAuthentication=no)(-o)(PreferredA uthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey)(-o)(PasswordAuthentication=no) <laptop.lab.test.com> SSH: ANSIBLE_TIMEOUT/timeout set: (-o)(ConnectTimeout=10) <laptop.lab.test.com> SSH: PlayContext set ssh_common_args: () <laptop.lab.test.com> SSH: PlayContext set ssh_extra_args: () <laptop.lab.test.com> SSH: found only ControlPersist; added ControlPath: (-o)(ControlPath=/home/vagrant/.ansible/cp/ansibl e-ssh-%h-%p-%r) <laptop.lab.test.com> SSH: EXEC ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPa th=/home/vagrant/.ansible/cp/ansible-ssh-%h-%p-%r U0128159-TPL-B.ten.thomsonreuters.com '/bin/sh -c '"'"'( umask 22 && mkdir -p "` echo $HOM E/.ansible/tmp/ansible-tmp-1462196365.95-235238773027827 `" && echo "` echo $HOME/.ansible/tmp/ansible-tmp-1462196365.95-235238773027827 `" )'"'"'' laptop.lab.test.com | UNREACHABLE! => { "changed": false, "msg": "Failed to connect to the host via ssh.", "unreachable": true }
我正在关注的网页是如何为Windowspipe理节点和自定义Windows模块安装一个Ansibletesting实验室
我用googlesearch,但是找不到我面临的问题。 请帮忙。
谢谢
有很多事情我不得不在这里和那里修改。 我写了所有我做的正确configurationpipe理和其他节点,因为我没有find适当的步骤在一个地方。 logging了我使用Ansible使Windows正常工作的所有步骤 – https://aseemkblog.wordpress.com/2016/06/01/configuring-ansible-to-manage-windows-system-over-powershell/ 。
为了解决这个错误,你必须在all.yml文件中指定几个参数来在windows中validation用户。 你也需要使用pip安装pywinrm模块。
pip install pywinrm
这是您的控制器机器上必须安装的软件包。
ansible_user: Administrator ansible_password: SecretPasswordGoesHere ansible_port: 5986 ansible_connection: winrm
但是,当您使用ansible_password进行身份validation时,可以删除ansible_password和用户kinit以创build票证。
如果你的组织 使用一个域名,那么你需要在你的ansible_user:[email protected]上添加这个工作。