Issue 1:
I am having a confusing problem. It does look like a bug and hence I am reporting here, not sure if duplicate.

I am using ansible version 2.0.0 locally on OSX El Capitan, to run a series of steps which sets up my machine for development for my project. The last step here is to add a few lines to /etc/hosts (~15 lines)

I am using lineinfile to add these lines in a loop.

I have tried become: root with become_ask_pass=True in the cfg file. This does nothing. It does not ask my password and once it hits that task, I get The destination directory (/private/etc) is not writable by the current user.. If I try sudo: yes and ask_sudo_pass=True then I get fatal: [localhost]: FAILED! => {"failed": true, "msg": "ERROR! privilege output closed while waiting for password prompt:\nBECOME-SUCCESS-jpibjiakmfjdrjafspqizphqotvhjikm\n{\"msg\": \"line added\", \"changed\": true, \"backup\": \"\"}\n"}. But infact If i check now, /etc/hosts file now has the first 2 lines of the list of lines I had to add. Running the playbook now doesnt help me at all.. but even more oddly, If i remove the config option to ask for password and run the play it works fully....

Issue 2:
Ansible crashes when creating links with_items and using ansible_connection=local. Here an example playbook for reproducing the behavior:

- name: the last task will throw an error
hosts: localhost
gather_facts: no

tasks:
- name: create files - that will work
copy:
content: "test"
dest: "/tmp/{{ item }}"
with_items:
- testfile1
- testfile2

- name: create links - that will crash
become: yes
file:
src: "/tmp/{{ item }}"
dest: "/tmp/{{ item }}link"
state: link
with_items:
- testfile1
- testfile2

The output is:

PLAY [the last task will throw an error] ***********************************

TASK [create files - that will work] *************************************************************
ok: [localhost] => (item=testfile1)
ok: [localhost] => (item=testfile2)

TASK [create links - that will crash] *************************************************************
fatal: [localhost]: FAILED! => {"failed": true, "msg": "ERROR! privilege output closed while waiting for password prompt:\nBECOME-SUCCESS-smnurvzoeqwqcapbnmmyrhlaautxdumn\n{\"src\": \"/tmp/testfile2\", \"group\": \"root\", \"uid\": 0, \"dest\": \"/tmp/testfile2link\", \"changed\": false, \"owner\": \"root\", \"state\": \"link\", \"gid\": 0, \"mode\": \"0777\", \"invocation\": {\"directory_mode\": null, \"force\": false, \"remote_src\": null, \"path\": \"/tmp/testfile2link\", \"owner\": null, \"follow\": false, \"group\": null, \"state\": \"link\", \"content\": null, \"serole\": null, \"diff_peek\": null, \"setype\": null, \"dest\": \"/tmp/testfile2link\", \"selevel\": null, \"original_basename\": null, \"regexp\": null, \"validate\": null, \"src\": \"/tmp/testfile2\", \"seuser\": null, \"recurse\": false, \"delimiter\": null, \"mode\": null, \"backup\": null}, \"size\": 14}\n"}

PLAY RECAP *********************************************************************
localhost : ok=1 changed=0 unreachable=0 failed=1

I think the local connector misbehaves with more then just the file module, when using with_items. I have another issue open (pip module does not work with_items in Ansible 2.0 #2552) where i suspected the pip module having problems with_items. However, the general error remains the same in both issues:

ERROR! privilege output closed while waiting for password prompt

During the investigation of the other issue, I found out that the error for it was introduced with commit 53e86f3, which was merged with PR #13261. I haven't checked if it is the same for this issue, but it could be a first trace.