Closed davehs30 closed 8 years ago
Can you make sure you have the latest code for napalm_install_config.py
? It's not going to fix anything but it gives a nicer error message that might help us.
Confirmed version 2.1 in the napalm_install_config.py, down loaded the 'raw' file and ran diff just to confirm nothing was changed.
Can you try running with -vvvv? On Tue 3 May 2016 at 14:42, davehs30 notifications@github.com wrote:
Confirmed version 2.1 in the napalm_install_config.py, down loaded the 'raw' file and ran diff just to confirm nothing was changed.
— You are receiving this because you commented.
Reply to this email directly or view it on GitHub https://github.com/napalm-automation/napalm-ansible/issues/26#issuecomment-216673708
Sure;
ansible-tst:~/fortigate# ansible-playbook -vvvv fortigate.config-update.yml
PLAY [firewall] ***
GATHERING FACTS ***
What version of python are you using? (python -V). I've seen something similar with <2.7 version. If you suspect that might be the case, you can try setting the interpreter version manually in your command as a test:
ansible-playbook fortigate.config-update.yml --extra-vars "ansible_python_interpreter=/
-mike
Sorry, looks like git omitted my example path (you would replace with your actual path to 2.7): 'ansible-playbook fortigate.config-update.yml --extra-vars "ansible_python_interpreter=/bin/python2.7" -vvvv
output looks the same to me.
ansible-tst:~/fortigate# ansible-playbook fortigate.config-update.yml --extra-vars "ansible_python_interpreter=/usr/bin/python2.7" -vvvv
PLAY [firewall] ***
GATHERING FACTS ***
So if you have confirmed that you're using an updated version of python and its still not working, then my best guess is that you have something defined in your configuration template that napalm_install_config is not happy with, maybe a special character or something? I would try reducing your template config down to something very simple to a point where it works, and then working in the reset to debug what might be the cause..
-mike
It would be interesting if you could try with ansible directly without ansible. It might give some more information.
Looks like I have a problem with Python and Napalm. I am also getting errors when I go to upgrade python modules. Will build a new test system.
ansible-tst:~/fortigate# cl_napalm_configure --user admin --password \ --vendor fortios --strategy merge --optional_arges 'fortios_vdom=global' compiled/homefw/new.conf homefw
Traceback (most recent call last):
File "/usr/bin/cl_napalm_configure", line 9, in
On May 4, 2016, at 3:27 PM, David Barroso notifications@github.com wrote:
It would be interesting if you could try with ansible directly without ansible. It might give some more information.
— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/napalm-automation/napalm-ansible/issues/26#issuecomment-216992483
I recommend you to use virtualenv
and pip
.
JFYI - I've actually had issues getting Ansible (ver 1.9.4) to use the correct python version even when using virtualenv.. Setting it manually via the 'ansible_python_interpreter' var is the only thing that has worked for me. I would recommend a new environment using vagrant.
This is normal with Ansible...you pretty much always want to set the ansible_python_interpreter (especially with a virtualenv).
As @ktbyers setting ansible_python_interpreter: "/usr/bin/env python"
as a global var on your playbook should work fine. If it doesn't in your particular use case for some reason, please, report it to the ansible
community, I am sure they would like to know.
Nothing else to do on this issue...so closing.
I have attached the playbook and the config file that is trying to be updated.
fortigate.config-update.yml.txt
new.conf.txt
This is the output that I am getting from the playbook:
ansible-tst:~/fortigate# ansible-playbook fortigate.config-update.yml
PLAY [firewall] ***
GATHERING FACTS *** ok: [homefw]
TASK: [update config] ***** failed: [homefw] => {"failed": true} msg: cannot install config:
FATAL: all hosts have already failed -- aborting
PLAY RECAP **** to retry, use: --limit @/root/fortigate.config-update.retry
homefw : ok=1 changed=0 unreachable=0 failed=1
Many Thanks!