Getting error in using register module

22 views
Skip to first unread message

sajal tiwari

unread,
Feb 19, 2019, 11:54:27 AM2/19/19
to Ansible Project
Hello,
I am getting below error while using register module with network modules(ios_command & nxos_command).
Can someone help on the issue.

ERROR! Module "register" shadows the name of a reserved keyword. Please rename or remove this module. Found at /opt/rh/python27/root/usr/lib/python2.7/site-packages/setuptools/command/register.py

Karthik Chandrashekar

unread,
Feb 19, 2019, 11:59:45 AM2/19/19
to ansible...@googlegroups.com
If you could show your code that would be much better to understand.

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/cfc7b1ce-928f-4bcb-bfcd-75fb4ce0dc76%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

sajal tiwari

unread,
Feb 19, 2019, 12:03:33 PM2/19/19
to Ansible Project
The script being used.

# For Cisco Devices
 - hosts: Cisco_SW
   gather_facts: true
   connection: local


   tasks:
     - name: show run
       ios_command:
         commands:
           - show run
         host: "{{ ansible_host }}"
         username: "{{ un }}"
         password: "{{ pwd }}"
       register: config

     - name: save output to /etc/ansible/backups
       copy:
         content: "{{ config.stdout[0] }}"
         dest: "/etc/ansible/backups/show_run_{{ inventory_hostname }}_{{ansible_date_time.date}}.txt"

Matt Martz

unread,
Feb 19, 2019, 12:07:53 PM2/19/19
to ansible...@googlegroups.com
The problem for whatever reason, is that ansible has been instructed to look in /opt/rh/python27/root/usr/lib/python2.7/site-packages/setuptools/command/ for ansible modules.

It located a file named register.py in that directory, and it is causing issues with ansible.

You may have some misconfiguration that is causing this, and using `ansible-config dump --only-changed` may reveal the issue.

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


--
Matt Martz
@sivel
sivel.net

sajal tiwari

unread,
Feb 19, 2019, 1:18:53 PM2/19/19
to Ansible Project
Below is the output from the command.

DEFAULT_MODULE_PATH(/etc/ansible/ansible.cfg) = [u'/usr/share/my_modules', u'/opt/rh/python27/root/usr/lib/python2.7/site-packages/icontrol', u'/usr/lib/python2.7/site-packages/ansible/utils/module_docs_fragments']

DEFAULT_ROLES_PATH(/etc/ansible/ansible.cfg) = [u'/etc/ansible/roles', u'/usr/share/ansible/roles']
PARAMIKO_HOST_KEY_AUTO_ADD(/etc/ansible/ansible.cfg) = True

Reply all
Reply to author
Forward
0 new messages