I am trying to run a task in ansible playbook as below.
- name: Add user to a group
user:
name: "{{ansible_user}}"
groups: docker
append: yes
become: yes
when: node_type == "peer"
I am using macOS and already installed ansible and sshpass. I am able to run different task through ansible on a remote linux machine but when run this group task I am getting error as 'Connection' object has no attribute 'ssh' ansible
.
Kindly guide me what could be the issue ?
EDIT: trace back for issue
ERROR! Unexpected Exception, this is probably a bug: 'Connection' object has no attribute 'ssh'
the full traceback was:
Traceback (most recent call last):
File "/usr/local/bin/ansible-playbook", line 118, in <module>
exit_code = cli.run()
File "/Library/Python/2.7/site-packages/ansible/cli/playbook.py", line 122, in run
results = pbex.run()
File "/Library/Python/2.7/site-packages/ansible/executor/playbook_executor.py", line 156, in run
result = self._tqm.run(play=play)
File "/Library/Python/2.7/site-packages/ansible/executor/task_queue_manager.py", line 291, in run
play_return = strategy.run(iterator, play_context)
File "/Library/Python/2.7/site-packages/ansible/plugins/strategy/linear.py", line 267, in run
results.extend(self._execute_meta(task, play_context, iterator, host))
File "/Library/Python/2.7/site-packages/ansible/plugins/strategy/__init__.py", line 1098, in _execute_meta
connection.reset()
File "/Library/Python/2.7/site-packages/ansible/plugins/connection/paramiko_ssh.py", line 539, in reset
self.close()
File "/Library/Python/2.7/site-packages/ansible/plugins/connection/paramiko_ssh.py", line 606, in close
self.ssh.close()
AttributeError: 'Connection' object has no attribute 'ssh'
EDIT:
I was asked to check ansible.cfg
file. But i am not able to locate this file on mac.
Below are the logs when i use ansible --version
command
ansible 2.7.6
config file = None
configured module search path = [u'/Users/dhiraj/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules'] ansible python module location = /Library/Python/2.7/site-packages/ansible executable location = /usr/local/bin/ansible python version = 2.7.10 (default, Jul 15 2017, 17:16:57) [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)]
ansible.cfg
change from the comments) – mdaniel