"NoneType object has no attribute split" when deriving 'inventory_host_shortname'

48 views
Skip to first unread message

Rob

unread,
Feb 20, 2016, 11:35:15 AM2/20/16
to Ansible Project
Ever since moving from Ansible 1.9.4 to 2.0.0.2 on Ubuntu 14.04, running a local play such as...

ansible-playbook -c local deploy.yml
 
... throws...

Traceback (most recent call last):
 
File "/usr/bin/ansible-playbook", line 85, in <module>
    sys
.exit(cli.run())
 
File "/usr/lib/pymodules/python2.7/ansible/cli/playbook.py", line 150, in run
    results
= pbex.run()
 
File "/usr/lib/pymodules/python2.7/ansible/executor/playbook_executor.py", line 148, in run
    result
= self._tqm.run(play=play)
 
File "/usr/lib/pymodules/python2.7/ansible/executor/task_queue_manager.py", line 237, in run
    play_return
= strategy.run(iterator, play_context)
 
File "/usr/lib/pymodules/python2.7/ansible/plugins/strategy/linear.py", line 224, in run
    task_vars
= self._variable_manager.get_vars(loader=self._loader, play=iterator._play, host=host, task=task)
 
File "/usr/lib/pymodules/python2.7/ansible/vars/__init__.py", line 341, in get_vars
    all_vars
['ansible_delegated_vars'] = self._get_delegated_vars(loader, play, task, all_vars)
 
File "/usr/lib/pymodules/python2.7/ansible/vars/__init__.py", line 479, in _get_delegated_vars
    include_hostvars
=False,
 
File "/usr/lib/pymodules/python2.7/ansible/vars/__init__.py", line 245, in get_vars
    all_vars
= combine_vars(all_vars, host.get_vars())
 
File "/usr/lib/pymodules/python2.7/ansible/inventory/host.py", line 129, in get_vars
    results
['inventory_hostname_short'] = self.name.split('.')[0]
AttributeError: 'NoneType' object has no attribute 'split'

The task in question involves a 'composer update' which is the first point in the play that connects to an external source but that's neither here nor there.
I don't have any entries in my /etc/ansible/hosts file as in 1.9.4.
I've tried modifying my local hostname in various formats without luck.
This issue is discussed here but, to be completely honest, I don't understand the conclusion.

I didn't have trouble with this in 1.9.4. Can someone please explain where I should look to resolve this or what has changed between the versions?
Reply all
Reply to author
Forward
0 new messages