{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible/issues/14643","repository_url":"https://api.github.com/repos/ansible/ansible","labels_url":"https://api.github.com/repos/ansible/ansible/issues/14643/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/14643/comments","events_url":"https://api.github.com/repos/ansible/ansible/issues/14643/events","html_url":"https://github.com/ansible/ansible/issues/14643","id":136129051,"number":14643,"title":"Module setup fails on Windows Server 2008 R2 with Ansible 2.0","user":{"login":"liquidat","id":1998084,"avatar_url":"https://avatars.githubusercontent.com/u/1998084?v=3","gravatar_id":"","url":"https://api.github.com/users/liquidat","html_url":"https://github.com/liquidat","followers_url":"https://api.github.com/users/liquidat/followers","following_url":"https://api.github.com/users/liquidat/following{/other_user}","gists_url":"https://api.github.com/users/liquidat/gists{/gist_id}","starred_url":"https://api.github.com/users/liquidat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liquidat/subscriptions","organizations_url":"https://api.github.com/users/liquidat/orgs","repos_url":"https://api.github.com/users/liquidat/repos","events_url":"https://api.github.com/users/liquidat/events{/privacy}","received_events_url":"https://api.github.com/users/liquidat/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-02-24T17:27:39Z","updated_at":"2016-02-24T20:51:43Z","closed_at":null,"body":"##### Issue Type:\r\n\r\n - Bug Report\r\n\r\n##### Ansible Version:\r\n\r\n```\r\nansible 2.0.0.2\r\n  config file = /home/liquidat/Development/Ansible-Demo/ansible.cfg\r\n  configured module search path = Default w/o overrides\r\n```\r\n\r\n##### Ansible Configuration:\r\n\r\n```\r\n[defaults]\r\nhostfile = ./inventory/hosts\r\n\r\n[ssh_connection]\r\nssh_args=-o ForwardAgent=yes\r\n```\r\n\r\nCallback plugin (needed for Ansible 1.9, because self signed certificate in Windows):\r\n```\r\nimport ssl\r\nif hasattr(ssl, '_create_default_https_context') and hasattr(ssl, '_create_unverified_context'):\r\n    ssl._create_default_https_context = ssl._create_unverified_context\r\n\r\nclass CallbackModule(object):\r\n    pass\r\n```\r\n\r\n##### Environment:\r\n\r\nAnsible-Run-OS: Fedora 23\r\nAnsible-Managed-OS: Windows Server 2008 R2 (Powershell 3.0)\r\n\r\nThe Windows Server is not part of a domain. The user is a local user, due to that the certificate is self signed and the callback plugin is needed in Ansible 1.9.\r\n\r\n##### Summary:\r\n\r\nSince an upgrade to Ansible 2 the setup module fails on the managed Windows host. Other modules like raw and win_stat still work.\r\n\r\n##### Steps To Reproduce:\r\n\r\n1. get a Windows Server 2008 R2 with Powershell 3.0\r\n2. add callback-plugins (see below)\r\n3. execute Ansible setup module with Ansible 1.9, see working output\r\n4. update Ansible to version 2\r\n5. execute Ansible setup module again, see failure\r\n\r\n```\r\n$ ansible windows-host -m setup                                                                                                                          An exception occurred during task execution. To see the full traceback, use -vvv. The error was: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\nradon | FAILED! => {\r\n    \"changed\": false, \r\n    \"failed\": true, \r\n    \"msg\": \"Cannot find an overload for \\\"Substring\\\" and the argument count: \\\"1\\\".\"\r\n}\r\n```\r\n\r\n##### Expected Results:\r\n\r\nThe ouput should have looked like:\r\n```\r\nradon | success >> {\r\n    \"ansible_facts\": {\r\n        \"ansible_distribution\": \"Microsoft Windows NT 6.1.7601 Service Pack 1\", \r\n        \"ansible_distribution_version\": \"6.1.7601.65536\", \r\n...\r\n```\r\n\r\n##### Actual Results:\r\nThe setup module does not work anymore against the Windows server.\r\nOther modules (raw, win_stat) deliver results.\r\n\r\nI wonder if I am missing something in regards to (I assume) untrusted certificates of the Windows server since it is a local user. But that would not explain why the other modules do work."},"comment":{"url":"https://api.github.com/repos/ansible/ansible/issues/comments/188449073","html_url":"https://github.com/ansible/ansible/issues/14643#issuecomment-188449073","issue_url":"https://api.github.com/repos/ansible/ansible/issues/14643","id":188449073,"user":{"login":"jhawkesworth","id":8440323,"avatar_url":"https://avatars.githubusercontent.com/u/8440323?v=3","gravatar_id":"","url":"https://api.github.com/users/jhawkesworth","html_url":"https://github.com/jhawkesworth","followers_url":"https://api.github.com/users/jhawkesworth/followers","following_url":"https://api.github.com/users/jhawkesworth/following{/other_user}","gists_url":"https://api.github.com/users/jhawkesworth/gists{/gist_id}","starred_url":"https://api.github.com/users/jhawkesworth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhawkesworth/subscriptions","organizations_url":"https://api.github.com/users/jhawkesworth/orgs","repos_url":"https://api.github.com/users/jhawkesworth/repos","events_url":"https://api.github.com/users/jhawkesworth/events{/privacy}","received_events_url":"https://api.github.com/users/jhawkesworth/received_events","type":"User","site_admin":false},"created_at":"2016-02-24T20:51:43Z","updated_at":"2016-02-24T20:51:43Z","body":"The callback plugin is no longer needed in ansible 2.\r\n\r\nInstead set the following in your group vars for windows hosts\r\n\r\n# The following is necessary for Python 2.7.9+ when using default WinRM self-signed certificates:\r\nansible_winrm_server_cert_validation: ignore\r\n\r\nSee the inventory section of the windows setup instructions.\r\n\r\nPlease try with the new group var setting.\r\n\r\nYou will need to move or delete the old callback plug-in as ansible 2 does not work with callback plugins written for ansible 1.x versions.\r\n\r\nJon\r\n\r\n"}}