I'm troubleshooting why I keep getting this cryptic errors when I'm attempting to use nxos_config
Ansible Version:
ansible 2.2.0.0
config file = /home/emarq/Solutions.Network.Automation/MAS/Ansible/cisco/nexus/ansible.cfg
configured module search path = Default w/o overrides
Ansible.cfg
[defaults]
hostfile=ansible.hosts
host_key_checking=False
Errors:
ansible-playbook nexus_apply_acl.yml --limit rr1-s11-r01-3172hl-1-1b -vvvvv -t deploy
Using /home/emarq/Solutions.Network.Automation/MAS/Ansible/cisco/nexus/ansible.cfg as config file
Loading callback plugin default of type stdout, v2.0 from /usr/lib/python2.7/dist-packages/ansible/plugins/callback/__init__.pyc
PLAYBOOK: nexus_apply_acl.yml **************************************************
4 plays in nexus_apply_acl.yml
PLAY [Setup Directories] *******************************************************
..
...
...
PLAY [deploy configs] **********************************************************
TASK [setup] *******************************************************************
Using module file /usr/lib/python2.7/dist-packages/ansible/modules/core/system/setup.py
<10.10.236.98> ESTABLISH LOCAL CONNECTION FOR USER: emarq
<10.10.236.98> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1484952187.34-169613523613121 `" && echo ansible-tmp-1484952187.34-169613523613121="` echo $HOME/.ansible/tmp/ansible-tmp-1484952187.34-169613523613121 `" ) && sleep 0'
<10.10.236.98> PUT /tmp/tmpjfMrVn TO /home/emarq/.ansible/tmp/ansible-tmp-1484952187.34-169613523613121/setup.py
<10.10.236.98> EXEC /bin/sh -c 'chmod u+x /home/emarq/.ansible/tmp/ansible-tmp-1484952187.34-169613523613121/ /home/emarq/.ansible/tmp/ansible-tmp-1484952187.34-169613523613121/setup.py && sleep 0'
<10.10.236.98> EXEC /bin/sh -c '/usr/bin/python /home/emarq/.ansible/tmp/ansible-tmp-1484952187.34-169613523613121/setup.py; rm -rf "/home/emarq/.ansible/tmp/ansible-tmp-1484952187.34-169613523613121/" > /dev/null 2>&1 && sleep 0'
ok: [rr1-s11-r01-3172hl-1-1b]
TASK [deployNxosConfig : execute in config mode] *******************************
task path: /home/emarq/Solutions.Network.Automation/MAS/Ansible/cisco/nexus/roles/deployNxosConfig/tasks/main.yml:5
An exception occurred during task execution. The full traceback is:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/ansible/executor/task_executor.py", line 119, in run
res = self._execute()
File "/usr/lib/python2.7/dist-packages/ansible/executor/task_executor.py", line 490, in _execute
result = self._handler.run(task_vars=variables)
File "/usr/lib/python2.7/dist-packages/ansible/plugins/action/net_config.py", line 45, in run
self._handle_template()
File "/usr/lib/python2.7/dist-packages/ansible/plugins/action/net_config.py", line 90, in _handle_template
if os.path.isabs(src) or urlparse.urlsplit('src').scheme:
File "/usr/lib/python2.7/posixpath.py", line 54, in isabs
return s.startswith('/')
AttributeError: 'list' object has no attribute 'startswith'
fatal: [rr1-s11-r01-3172hl-1-1b]: FAILED! => {
"failed": true,
"msg": "Unexpected failure during module execution.",
"stdout": ""
}
to retry, use: --limit @/home/emarq/Solutions.Network.Automation/MAS/Ansible/cisco/nexus/nexus_apply_acl.retry
PLAY RECAP *********************************************************************
rr1-s11-r01-3172hl-1-1b : ok=4 changed=0 unreachable=0 failed=1
Playbook
# connect to the switch and apply to the running-config.
- name: deploy configs
hosts:
- basetortemplate
roles:
- deployNxosConfig
remote_user: admin
gather_facts: no
connection: local
vars:
cli:
host: "{{ ansible_host }}"
transport: cli
username: admin
ssh_keyfile: /srv/tftpboot/masd-rsa.pub
tags: deploy
Roles/deployNxosConfig/main.yml