ansible/ansible — pull request #7585 by rstrox (2014-05-28 20:49:16+00:00)
Title: groupname is NoneType when not set

When groupname: is not specified, as in the following task...

```
- name: Add this thing to inventory
local_action:
module: add_host
hostname: "{{ item.name }}"
ansible_ssh_host: "{{ item.accessIPv4 }}"
# bug!
groupname:
with_items: rax.success
when: rax.action == 'create'
```

... the following traceback occurs.

```
TASK: [Add this thing to inventory] *******************************************
fatal: [localhost] => Traceback (most recent call last):
File "/home/rstrox/.venv27/lib/python2.7/site-packages/ansible/runner/__init__.py", line 543, in _executor
exec_rc = self._executor_internal(host, new_stdin)
File "/home/rstrox/.venv27/lib/python2.7/site-packages/ansible/runner/__init__.py", line 675, in _executor_internal
complex_args=complex_args
File "/home/rstrox/.venv27/lib/python2.7/site-packages/ansible/runner/__init__.py", line 839, in _executor_internal_inner
result = handler.run(conn, tmp, module_name, module_args, inject, complex_args)
File "/home/rstrox/.venv27/lib/python2.7/site-packages/ansible/runner/action_plugins/add_host.py", line 81, in run
for group_name in groupnames.split(","):
AttributeError: 'NoneType' object has no attribute 'split'

FATAL: all hosts have already failed -- aborting
```