{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible/issues/15332","repository_url":"https://api.github.com/repos/ansible/ansible","labels_url":"https://api.github.com/repos/ansible/ansible/issues/15332/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/15332/comments","events_url":"https://api.github.com/repos/ansible/ansible/issues/15332/events","html_url":"https://github.com/ansible/ansible/issues/15332","id":146772012,"number":15332,"title":"How to run ansible from linux to deploy on windows machines","user":{"login":"GittyHup","id":4475946,"avatar_url":"https://avatars.githubusercontent.com/u/4475946?v=3","gravatar_id":"","url":"https://api.github.com/users/GittyHup","html_url":"https://github.com/GittyHup","followers_url":"https://api.github.com/users/GittyHup/followers","following_url":"https://api.github.com/users/GittyHup/following{/other_user}","gists_url":"https://api.github.com/users/GittyHup/gists{/gist_id}","starred_url":"https://api.github.com/users/GittyHup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GittyHup/subscriptions","organizations_url":"https://api.github.com/users/GittyHup/orgs","repos_url":"https://api.github.com/users/GittyHup/repos","events_url":"https://api.github.com/users/GittyHup/events{/privacy}","received_events_url":"https://api.github.com/users/GittyHup/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-04-07T23:38:38Z","updated_at":"2016-04-08T23:04:11Z","closed_at":null,"body":"Here is what I have after setting kerberos according to ansible:\r\nhttp://docs.ansible.com/ansible/intro_windows.html\r\n\r\n\t[libdefaults]\r\n\t\t\tdefault_realm = MY.DOMAIN.COM\r\n\t…\r\n\t[realms]\r\n\t\t\tMY.DOMAIN.COM = {\r\n\t\t\t\t\tdefault_domain = my.domain.com\r\n\t\t\t\t\tkdc = <domain-controller-server>.my.domain.com\r\n\t\t\t\t\tkpasswd_server = <domain-controller-server>.my.domain.com\r\n\t\t\t}\r\n\t…\r\n\t[domain_realm]\r\n\t\t\t.my.domain.com = MY.DOMAIN.COM\r\n\t…\r\n\r\nI was able to create a kerberos ticket, here is my output:\r\n\r\n\troot@alex-VirtualBox:/etc/ansible# klist\r\n\tTicket cache: FILE:/tmp/krb5cc_0\r\n\tDefault principal: <user_name>@MY.DOMAIN.COM\r\n\r\n\tValid starting       Expires              Service principal\r\n\t04/07/2016 13:58:52  04/07/2016 23:58:52  krbtgt/MY.DOMAIN.COM@MY.DOMAIN.COM\r\n\t\t   renew until 04/08/2016 13:58:48\r\n\t04/07/2016 14:02:20  04/07/2016 23:58:52  HTTP/<windows-target-server>.my.domain.com@MY.DOMAIN.COM\r\n\t\t   renew until 04/08/2016 13:58:48\r\n\r\nSo what I am trying to do is run ansible playbook or even a simple command on <windows-target-server>. But I am getting this error which I am pretty sure have nothing to do with ansible:\r\n\r\n    root@alex-VirtualBox:/etc/ansible# ansible windows -m win_ping --ask-vault-pass\r\n    Vault password: \r\n\t<windows-target-server>.my.domain.com | FAILED! => {\r\n\t\t\t\"failed\": true, \r\n\t\t\t\"msg\": \"kerberos: (('Unspecified GSS failure.  Minor code may provide more information', 851968), ('Server not found in Kerberos database', -1765328377)), plaintext: 401 Unauthorized.\"\r\n\t\t}\r\n\r\nI even went ahead and created the keytab file:\r\n\r\n\t> ktutil\r\n\t  ktutil:  addent -password -p <user_name>@MY.DOMAIN.COM -k 1 -e rc4-hmac\r\n\t  provide password\r\n\t  ktutil:  wkt <user_name>.keytab\r\n\t  ktutil:  quit\r\n\r\nBut then I get different error:\r\n\r\n    root@alex-VirtualBox:/etc/ansible# ansible windows -m win_ping --ask-vault-pass\r\n\tn2-2wbp-wbsvr01.na.msds.rhi.com | FAILED! => {\r\n\t\t\"failed\": true, \r\n\t\t\"msg\": \"kerberos: (('An invalid name was supplied', 131072), ('Success', 100001)), plaintext: 401 Unauthorized.\"\r\n\t}\r\n"},"comment":{"url":"https://api.github.com/repos/ansible/ansible/issues/comments/207641753","html_url":"https://github.com/ansible/ansible/issues/15332#issuecomment-207641753","issue_url":"https://api.github.com/repos/ansible/ansible/issues/15332","id":207641753,"user":{"login":"GittyHup","id":4475946,"avatar_url":"https://avatars.githubusercontent.com/u/4475946?v=3","gravatar_id":"","url":"https://api.github.com/users/GittyHup","html_url":"https://github.com/GittyHup","followers_url":"https://api.github.com/users/GittyHup/followers","following_url":"https://api.github.com/users/GittyHup/following{/other_user}","gists_url":"https://api.github.com/users/GittyHup/gists{/gist_id}","starred_url":"https://api.github.com/users/GittyHup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GittyHup/subscriptions","organizations_url":"https://api.github.com/users/GittyHup/orgs","repos_url":"https://api.github.com/users/GittyHup/repos","events_url":"https://api.github.com/users/GittyHup/events{/privacy}","received_events_url":"https://api.github.com/users/GittyHup/received_events","type":"User","site_admin":false},"created_at":"2016-04-08T23:04:11Z","updated_at":"2016-04-08T23:04:11Z","body":"Alrighty, here are my configurations. (By the way I did include the ansible_password, ansible_ssh_pass, tried without password variable too, no luck)\r\n\r\n/etc/krb5.conf\r\n\r\n\t[libdefaults]\r\n\t\tdefault_realm = NA.ABCD.XYZ.COM\r\n\t\tkrb4_config = /etc/krb.conf\r\n\t\tkrb4_realms = /etc/krb.realms\r\n\t\tkdc_timesync = 1\r\n\t\tccache_type = 4\r\n\t\tforwardable = true\r\n\t\tproxiable = true\r\n\r\n\t\tv4_instance_resolve = false\r\n\t\tv4_name_convert = {\r\n\t\t\thost = {\r\n\t\t\t\trcmd = host\r\n\t\t\t\tftp = ftp\r\n\t\t\t}\r\n\t\t\tplain = {\r\n\t\t\t\tsomething = something-else\r\n\t\t\t}\r\n\t\t}\r\n\t\tfcc-mit-ticketflags = true\r\n\r\n\t[realms]\r\n\t\t\tNA.ABCD.XYZ.COM = {                \r\n\t\t\t\t\tkdc = domain-controller.na.abcd.xyz.com\r\n\t\t\t}\r\n\r\n\t[domain_realm]\r\n\t\t\t.na.abcd.xyz.com = NA.ABCD.XYZ.COM\r\n\r\n\t[login]\r\n\t\tkrb4_convert = true\r\n\t\tkrb4_get_tickets = false\r\n\r\n/etc/ansible/host\r\n\r\n\t[windows]\r\n\tmy-windows-server.na.msds.rhi.com\r\n\r\n/etc/ansible/group_vars/windows.yml\r\n\r\n\tansible_user: myusername@NA.ABCD.XYZ.COM\r\n\tansible_password: mypassword\r\n\tansible_port: 5986\r\n\tansible_connection: winrm\r\n\tansible_winrm_server_cert_validation: ignore\r\n\r\nCommands I run:\r\n\r\nCommand:\r\n\r\n       kinit myusername@NA.ABCD.XYZ.COM\r\n\r\nOutput:      \r\n \r\n       Password for myusername@NA.ABCD.XYZ.COM: \r\n\r\n\r\nCommand:\r\n\r\n       klist \r\n\r\nOutput:\r\n\r\n\tTicket cache: FILE:/tmp/krb5cc_0\r\n\tDefault principal: myusername@NA.ABCD.XYZ.COM\r\n\r\n\tValid starting       Expires              Service principal\r\n\t04/08/2016 15:57:30  04/09/2016 01:57:30  krbtgt/NA.ABCD.XYZ.COM@NA.ABCD.XYZ.COM\r\n\t\trenew until 04/09/2016 15:57:26\r\n\r\nCommand:\r\n\r\n       ansible windows -i host -m win_ping --ask-vault-pass\r\n\r\nOutput:\r\n\r\n        Vault password:\r\n\tmy-windows-server.na.msds.rhi.com | FAILED! => {\r\n\t\t\"failed\": true, \r\n\t\t\"msg\": \"ssl: 401 Unauthorized. basic auth failed\"\r\n\t}"}}