{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible/issues/19672","repository_url":"https://api.github.com/repos/ansible/ansible","labels_url":"https://api.github.com/repos/ansible/ansible/issues/19672/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/19672/comments","events_url":"https://api.github.com/repos/ansible/ansible/issues/19672/events","html_url":"https://github.com/ansible/ansible/issues/19672","id":197460107,"number":19672,"title":"Ansible:Synchronize module throwing UNREACHABLE! error","user":{"login":"NISHAgl","id":22024677,"avatar_url":"https://avatars.githubusercontent.com/u/22024677?v=3","gravatar_id":"","url":"https://api.github.com/users/NISHAgl","html_url":"https://github.com/NISHAgl","followers_url":"https://api.github.com/users/NISHAgl/followers","following_url":"https://api.github.com/users/NISHAgl/following{/other_user}","gists_url":"https://api.github.com/users/NISHAgl/gists{/gist_id}","starred_url":"https://api.github.com/users/NISHAgl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NISHAgl/subscriptions","organizations_url":"https://api.github.com/users/NISHAgl/orgs","repos_url":"https://api.github.com/users/NISHAgl/repos","events_url":"https://api.github.com/users/NISHAgl/events{/privacy}","received_events_url":"https://api.github.com/users/NISHAgl/received_events","type":"User","site_admin":false},"labels":[{"id":437720699,"url":"https://api.github.com/repos/ansible/ansible/labels/affects_2.2","name":"affects_2.2","color":"5319e7","default":false},{"id":48276055,"url":"https://api.github.com/repos/ansible/ansible/labels/bug_report","name":"bug_report","color":"fbca04","default":false},{"id":496359346,"url":"https://api.github.com/repos/ansible/ansible/labels/module","name":"module","color":"1d76db","default":false},{"id":503572087,"url":"https://api.github.com/repos/ansible/ansible/labels/needs_triage","name":"needs_triage","color":"0e8a16","default":false},{"id":88746767,"url":"https://api.github.com/repos/ansible/ansible/labels/plugin","name":"plugin","color":"bfe5bf","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-12-24T11:50:10Z","updated_at":"2016-12-24T15:02:34Z","closed_at":null,"body":"<!---\r\nVerify first that your issue/request is not already reported on GitHub.\r\nAlso test if the latest release, and master branch are affected too.\r\n-->\r\nHi,\r\nI went through a thread on GitHub but that didnt give a proper resolution(It was downgrading the app).So I have created this new issue.While copying dir. from server1 to server2 using my simple ansible-playbook (AnsibleServer which is 3rd server). So basically, when I use ping all command it connects, but sync it gives error\r\n##### ISSUE TYPE\r\n<!--- Pick one below and delete the rest: -->\r\n - Bug Report\r\n\r\n##### COMPONENT NAME\r\n<!--- Name of the module/plugin/task/feature -->\r\nsynchronize\r\n##### ANSIBLE VERSION\r\n<!--- Paste verbatim output from “ansible --version” between quotes below -->\r\n```\r\nansible 2.2.0.0\r\n  config file = /etc/ansible/ansible.cfg\r\n  configured module search path = Default w/o overrides\r\n\r\n```\r\n\r\n##### CONFIGURATION\r\n<!---\r\nMention any settings you have changed/added/removed in ansible.cfg\r\n(or using the ANSIBLE_* environment variables).\r\n-->\r\nhost_key_checking=False\r\n\r\n[privilege_escalation]\r\nbecome=True\r\nbecome_method=sudo\r\n\r\nOther tahn this all commented\r\n##### OS / ENVIRONMENT\r\n<!---\r\nMention the OS you are running Ansible from, and the OS you are\r\nmanaging, or say “N/A” for anything that is not platform-specific.\r\n-->\r\nCentOS Linux release 7.2.1511 (Core)\r\nNAME=\"CentOS Linux\"\r\nVERSION=\"7 (Core)\"\r\nID=\"centos\"\r\nID_LIKE=\"rhel fedora\"\r\nVERSION_ID=\"7\"\r\nPRETTY_NAME=\"CentOS Linux 7 (Core)\"\r\n\r\n##### SUMMARY\r\n<!--- Explain the problem briefly -->\r\nbelow error:(I tried both pull and push method by changing the delegate_server and hosts)\r\n\r\nTASK [Transfer files from Server1 to Server2] **********************************\r\nfatal: [x.x.x.x]: UNREACHABLE! => {\"changed\": false, \"msg\": \"Failed to connect to the host via ssh: ssh: Could not resolve hostname serv1: Name or service not known\\r\\n\", \"unreachable\": true}\r\nto retry, use: --limit @/etc/ansible/playbook/hello.retry\r\n\r\nPLAY RECAP *********************************************************************\r\n\r\nbut ping is success:\r\nansible -i /etc/ansible/copyHosts -m ping all\r\nx.x.x.x | SUCCESS => {\r\n\"changed\": false,\r\n\"ping\": \"pong\"\r\n##### STEPS TO REPRODUCE\r\n<!---\r\nFor bugs, show exactly how to reproduce the problem, using a minimal test-case.\r\nFor new features, show how the feature would be used.\r\n-->\r\nansible-playbook -i /etc/ansible/copyHosts /etc/ansible/playbook/transfer.yml\r\n<!--- Paste example playbooks or commands between quotes below -->\r\n```yaml\r\n\r\n```\r\n\r\n<!--- You can also paste gist.github.com links for larger files -->\r\n\r\n##### EXPECTED RESULTS\r\n<!--- What did you expect to happen when running the steps above? -->\r\nShould read the inventory file which has server1 and 2 info about IP, keys, ports and users and copy dirctories recursively\r\n##### ACTUAL RESULTS\r\n<!--- What actually happened? If possible run with extra verbosity (-vvvv) -->\r\nUnreachable error\r\n<!--- Paste verbatim command output between quotes below -->\r\n```\r\n\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/ansible/ansible/issues/comments/269087771","html_url":"https://github.com/ansible/ansible/issues/19672#issuecomment-269087771","issue_url":"https://api.github.com/repos/ansible/ansible/issues/19672","id":269087771,"user":{"login":"henderbj","id":7970531,"avatar_url":"https://avatars.githubusercontent.com/u/7970531?v=3","gravatar_id":"","url":"https://api.github.com/users/henderbj","html_url":"https://github.com/henderbj","followers_url":"https://api.github.com/users/henderbj/followers","following_url":"https://api.github.com/users/henderbj/following{/other_user}","gists_url":"https://api.github.com/users/henderbj/gists{/gist_id}","starred_url":"https://api.github.com/users/henderbj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/henderbj/subscriptions","organizations_url":"https://api.github.com/users/henderbj/orgs","repos_url":"https://api.github.com/users/henderbj/repos","events_url":"https://api.github.com/users/henderbj/events{/privacy}","received_events_url":"https://api.github.com/users/henderbj/received_events","type":"User","site_admin":false},"created_at":"2016-12-24T15:02:34Z","updated_at":"2016-12-24T15:02:34Z","body":"Hi,\r\nIt seems to me that you have your ansible hosts file with IP instead of hostnames. So, ansible is pinging IPs, but doesn't know what server is \"serv1\".\r\n\r\nIn ansible hosts file you can have:\r\n\r\n```\r\n#EXAMPLE HOSTS FILE\r\n[nameservers]\r\nalpha.example.org\r\nbeta.example.org\r\n\r\n[ipservers]\r\n192.168.1.100\r\n192.168.1.110\r\n#END HOSTS FILE\r\n\r\n```\r\nIn that hosts file, the servers in nameservers group should be OS solvable (by DNS or /etc/hosts file) or have its IP added on a host_vars file, for example. The ipservers are defined by IP.\r\n\r\nIn your ansible hosts file, the servers seems to be defined by IP, like ipservers on my example. Then, ansible will no be able to access a server called \"serv1\" if its no OS accesible.\r\n\r\nIn short, from your ansible machine you should be able to \"ping serv1\" server in order to your actual ansible configuration to work.\r\n\r\nI hope it helps."}}
{"actor":{"display_login":"henderbj"}}