Hi, I'm new to Ansible. I wanted to manage my network devices with Ansible so I did this:
- Found this documentation: http://patg.net/ansible,comware,switches/2014/10/16/ansible-comware/ - Created an account on my switch, tested that it can login via SSH (password only, haven't configured an SSH key yet) - Installed ansible (from EPEL), on RHEL7 (see below for version details) - Cloned the comware 5.2 module in $HOME/.ansible/plugins/modules (git clone https://github.com/CaptTofu/comware_5_2.git) - Cloned the Github project to get playbook examples (git clone https://github.com/CaptTofu/comware_5_2_playbooks.git) - Created an inventory file (see below) - Created a playbook (see below) - Ran ansible-playbook (ansible-playbook -i switch1 -u ansiblehpe --ask-pass playbook1.yml) - Got this error message - fatal: [192.168.xx.xx]: FAILED! => {"msg": "module (setup) is missing interpreter line"} - So I though I would add the shebang with the path of the python interpeter on my server running ansible in the setup.py file - Got these errors: - [WARNING]: Unhandled error in Python interpreter discovery for host 192.168.99.41: Failed to connect to the host via ssh: - [WARNING]: sftp transfer mechanism failed on [192.168.99.41]. Use ANSIBLE_DEBUG=1 to see detailed information - [WARNING]: scp transfer mechanism failed on [192.168.99.41]. Use ANSIBLE_DEBUG=1 to see detailed information - I realized ansible wanted to discover where could python be on the remote target, but there isn't any interpreter there, it's a network switch... - I set an empty shebang in the setup.py file and got this error - An exception occurred during task execution. To see the full traceback, use -vvv. The error was: IndexError: list index out of range fatal: [192.168.99.41]: FAILED! => {"msg": "Unexpected failure during module execution.", "stdout": ""} How do I tell ansible that there isn't any interpreter on the target? Any help would be appreciated. Thanks in advance. $ ansible --version ansible 2.8.2 config file = /etc/ansible/ansible.cfg configured module search path = [u'/home/ubellavance/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lib/python2.7/site-packages/ansible executable location = /usr/bin/ansible python version = 2.7.5 (default, Jun 11 2019, 12:19:05) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)] Inventory file: [switch1] 192.168.xx.xx [switch1:vars] switch_host=192.168.xx.xx switch_user=xxxxxxxx switch_password=xxxxxxxx Playbook: - hosts: switch1 tasks: - name: gather facts from switch comware_5_2: gather_facts=true host={{ switch_host }} username={{ switch_user }} password={{ switch_password }} -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/3e24573f-7856-4125-a07c-a197acb3347f%40googlegroups.com.
