Since my host_var and group_var s are not getting used since I updated ansible to the latest git checkout last night, I decided to put the variables directly in my inventory file.
Now it seems like they might be getting read, but now I get this error:
ImportError: cannot import name makedirs_safe
This was just trying ansible win7 -m win_ping
win7 | FAILED! => {‘failed’: True, ‘exception’: 'Traceback (most recent call last):\n File "/home/ansible/ansible/lib/ansible/executor/proc
ess/worker.py", line 118, in run\n executor_result = TaskExecutor(host, task, job_vars, new_connection_info, self._new_stdin, self._loade
r, shared_loader_obj).run()\n File “/home/ansible/ansible/lib/ansible/executor/task_executor.py”, line 107, in run\n res = self._execute
()\n File “/home/ansible/ansible/lib/ansible/executor/task_executor.py”, line 211, in _execute\n self._connection = self._get_connection
(variables)\n File “/home/ansible/ansible/lib/ansible/executor/task_executor.py”, line 395, in _get_connection\n connection = connection
_loader.get(conn_type, self._connection_info, self._new_stdin)\n File “/home/ansible/ansible/lib/ansible/plugins/init.py”, line 271, in
get\n self._module_cache[path] = imp.load_source('.'.join([self.package, name]), path)\n File “/home/ansible/ansible/lib/ansible/plug
ins/connections/winrm.py”, line 47, in \n from ansible.utils import makedirs_safe\nImportError: cannot import name makedirs_safe
n’, ‘stdout’: ‘’}
should be fixed now, pull and try again (i was missing path in import
path for make path utility)
Well I don’t see the import error anymore but most of the error is the same:
Now I get this:
win7 | FAILED! => {‘failed’: True, ‘exception’: ‘Traceback (most recent call last):\n File “/home/ansible/ansible/lib/ansible/executor/proc
ess/worker.py”, line 118, in run\n executor_result = TaskExecutor(host, task, job_vars, new_connection_info, self._new_stdin, self._loade
r, shared_loader_obj).run()\n File “/home/ansible/ansible/lib/ansible/executor/task_executor.py”, line 107, in run\n res = self._execute
()\n File “/home/ansible/ansible/lib/ansible/executor/task_executor.py”, line 215, in _execute\n self._handler = self._get_action_handle
r(connection=self._connection, templar=templar)\n File “/home/ansible/ansible/lib/ansible/executor/task_executor.py”, line 422, in _get_act
ion_handler\n shared_loader_obj=self.shared_loader_obj,\n File “/home/ansible/ansible/lib/ansible/plugins/init.py”, line 276, in ge
t\n obj = getattr(self.module_cache[path], self.class_name)(*args, **kwargs)\n File "/home/ansible/ansible/lib/ansible/plugins/action/
init.py", line 64, in init\n self._shell = shell_loader.get(shell_type)\n File "/home/ansible/ansible/lib/ansible/plugins/_init
.py", line 266, in get\n path = self.find_plugin(name)\n File “/home/ansible/ansible/lib/ansible/plugins/init.py”, line 246, in fin
d_plugin\n if not name.startswith(''):\nAttributeError: 'ShellModule' object has no attribute 'startswith'\n’, ‘stdout’: ‘’}
win8 | FAILED! => {‘msg’: u’ERROR! 500 WinRMTransport. [Errno -3] Temporary failure in name resolution’, ‘failed’: True}
that is probably different but unrelated issue, are you relying on
ansible_ssh_host to set the correct address? if so that is a currently
open issue.
I currently am relying on ansible_ssh_host.
I am assuming once our client machines have DNS entries, the ansible server will not need ansible_ssh_host defined correct?
as long as the inventory_hostname is resolvable, there is not need for
ansible_ssh_host
Hi,
I’m having a similar problem since pulling the latest (d681113) revision in git. I’m not relying on ansible_ssh_host though, my trace output is identical to Michael’s win7 host.
Attaching the epdb debugger I outputted the value of name, which just prior to the error had the value:
<ansible.plugins.shell.powershell.ShellModule object at 0x1ab2dd0>
which looks to me to be an object’s memory reference rather than a string (I’m no python developer though, so I’m taking a punt based on other language experience).
looking at the source of ansible/lib/ansible/plugins/action/init.py, it looks like the powershell ShellModule is being pulled off the connection._shell property. I added (a probably incorrect test) to see if shell_type was a string, in which case I called the shell_loader, otherwise I directly assigned the shell_type to self._shell.
if isinstance(shell_type, basestring):
self._shell = shell_loader.get(shell_type)
else:
self._shell = shell_type
Suspect that this’ll break a bunch of other stuff, but it appears to be working for the moment. I figured that I’d push this out here as Brian looks to be far better qualified to say either way.
~Dan
OK, perhaps not the solution - getting errors with module parameters.