{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/2236","labels_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/2236/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/2236/comments","events_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/2236/events","html_url":"https://github.com/ansible/ansible-modules-core/issues/2236","id":110703204,"number":2236,"title":"win_lineinfile changes permissions of target file on update","user":{"login":"pkunszt","id":10047646,"avatar_url":"https://avatars.githubusercontent.com/u/10047646?v=3","gravatar_id":"","url":"https://api.github.com/users/pkunszt","html_url":"https://github.com/pkunszt","followers_url":"https://api.github.com/users/pkunszt/followers","following_url":"https://api.github.com/users/pkunszt/following{/other_user}","gists_url":"https://api.github.com/users/pkunszt/gists{/gist_id}","starred_url":"https://api.github.com/users/pkunszt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pkunszt/subscriptions","organizations_url":"https://api.github.com/users/pkunszt/orgs","repos_url":"https://api.github.com/users/pkunszt/repos","events_url":"https://api.github.com/users/pkunszt/events{/privacy}","received_events_url":"https://api.github.com/users/pkunszt/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ansible/ansible-modules-core/labels/bug_report","name":"bug_report","color":"fbca04"},{"url":"https://api.github.com/repos/ansible/ansible-modules-core/labels/windows","name":"windows","color":"777777"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-10-09T17:28:50Z","updated_at":"2015-12-22T05:19:17Z","closed_at":null,"body":"especially annoying when changing some entries in \\windows\\system32\\drivers\\etc\\hosts\r\nafter win_lineinfile adds an entry, the hosts file loses the users and applications permissions and is therefore not readable also by the network components at all. resetting the permissions is not enough, the network has to be rebooted."},"comment":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/comments/166508578","html_url":"https://github.com/ansible/ansible-modules-core/issues/2236#issuecomment-166508578","issue_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/2236","id":166508578,"user":{"login":"dbpeng","id":3021912,"avatar_url":"https://avatars.githubusercontent.com/u/3021912?v=3","gravatar_id":"","url":"https://api.github.com/users/dbpeng","html_url":"https://github.com/dbpeng","followers_url":"https://api.github.com/users/dbpeng/followers","following_url":"https://api.github.com/users/dbpeng/following{/other_user}","gists_url":"https://api.github.com/users/dbpeng/gists{/gist_id}","starred_url":"https://api.github.com/users/dbpeng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dbpeng/subscriptions","organizations_url":"https://api.github.com/users/dbpeng/orgs","repos_url":"https://api.github.com/users/dbpeng/repos","events_url":"https://api.github.com/users/dbpeng/events{/privacy}","received_events_url":"https://api.github.com/users/dbpeng/received_events","type":"User","site_admin":false},"created_at":"2015-12-22T05:19:17Z","updated_at":"2015-12-22T05:19:17Z","body":"My env\r\n----\r\nansible 2.1.0 (devel c1cec64aa8)\r\ncontrol machine: centos 6.5\r\ntarget machine: windows 2008\r\n\r\nUsed the script in my playbook\r\n```yaml\r\n- name: Make sure service1.myhost.com in hosts\r\n  win_lineinfile: dest=C:\\Windows\\System32\\drivers\\etc\\hosts regexp=service1.myhost.com line=\"{{ service1_ip }} service1.myhost.com\"\r\n  tags:\r\n   - update_host\r\n```"}}