Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

https://www.juniper.net/documentation/en_US/junos-ansible/topics/task/troubleshooting/junos-ansible-configuration-errors-troubleshooting.html









Error messageSolution

fatal: [vsrx1]: FAILED! => {"changed": false, "msg": "jxmlease >= 1.0.1 is required for this module.
However, jxmlease does not appear to be currently installed. See http://jxmlease.readthedocs.io/en/stable/install.html for details on installing jxmlease."}



Solution:

pip install jxmlease
pip install --upgrade pip


TASK [Load conf. Confirm within 5 min. Wait 3 secs between chk and commit] *********************************************
fatal: [172.30.95.194]: FAILED! => {"changed": false, "msg": "Unable to make a PyEZ connection: ConnectAuthError(172.30.95.194)"}





Solution:

host: "{{ inventory_hostname }}"
user: "jansible"
passwd: "jansible123"

TASK [Load conf. Confirm within 5 min. Wait 3 secs between chk and commit] *********************************************
fatal: [172.30.95.194]: FAILED! => {"changed": false, "msg": "Failure loading the configuraton: ConfigLoadError
(severity: error, bad_element: None, message: error: Cannot open configuration file: 172.30.95.194.conf)"}


Solution:

..change href:  >>>> src:

rpc_contents = open(kvargs['path'], 'rU').read()\nIOError: [Errno 2] No such file or directory:
'172.30.95.194.conf'\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}
to retry, use: --limit @/etc/ansible/roles/ex3400/tasks/load_config_commit_check.retry


Solution:

..copy the file into the ./tasks directory  ( try /files/"{{ inventory_hostname }}.conf"


fatal: [172.30.95.194]: FAILED! => {"changed": false, "msg": "Failure loading the configuraton: ConfigLoadError(severity: error, bad_element: set, message: error: syntax error)"}

TASK [Get Chassis information] *********************************************************
[WARNING]: The value [{'detail': True}] (type list) in a string field was converted
to "[{'detail': True}]" (type string). If this does not look like what you expect, quote
the entire value to ensure it does not change.
ok: [172.30.95.170]

ok: [172.30.95.170]
[WARNING]: Platform linux on host 172.30.95.176 is using the discovered Python
interpreter at /usr/bin/python, but future installation of another Python interpreter
could change this. See
https://docs.ansible.com/ansible/2.9/reference_appendices/interpreter_discovery.html
for more information.

Change the host file hosts:

https://docs.ansible.com/ansible/latest/reference_appendices/python_3_support.html#:~:text=To%20explicitly%20configure%20a%20Python,cfg%20.


[All-95-netw:vars]                                                   <<<<<<<<<<<<<< New bit
ansible_python_interpreter=/usr/bin/python3  

[All-95-netw]
#172.30.95.163
172.30.95.170


Code Block
titleoutput
/project # ansible-playbook rpc_chassishw.yml -vvvvv
ansible-playbook 2.9.5
  config file = /project/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.6/site-packages/ansible
  executable location = /usr/bin/ansible-playbook
  python version = 3.6.8 (default, Apr 22 2019, 10:28:12) [GCC 6.3.0]
Using /project/ansible.cfg as config file
setting up inventory plugins
host_list declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
Skipping due to inventory source not existing or not being readable by the current user
script declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
auto declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
Skipping due to inventory source not existing or not being readable by the current user
yaml declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
Skipping due to inventory source not existing or not being readable by the current user
ini declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
Skipping due to inventory source not existing or not being readable by the current user
toml declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
[WARNING]: No inventory was parsed, only implicit localhost is available
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost doe
Loading callback plugin default of type stdout, v2.0 from /usr/lib/python3.6/site-packages/ansible/plugins
Loading callback plugin jsnapy of type aggregate, v2.0 from /etc/ansible/roles/Juniper.junos/callback_plug

PLAYBOOK: rpc_chassishw.yml ******************************************************************************
Positional arguments: rpc_chassishw.yml
verbosity: 5
connection: smart
timeout: 10
become_method: sudo
tags: ('all',)
inventory: ('/etc/ansible/hosts',)
forks: 5
1 plays in rpc_chassishw.yml
[WARNING]: Could not match supplied host pattern, ignoring: All_95_netw

PLAY [Get facts] *****************************************************************************************
skipping: no hosts matched


chnage the ansible config file


labuser@saltsackmaster:~/project/ansible/gethw$ more ansible.cfg
[defaults]
ansible_python_interpreter=/usr/bin/python3
deprecation_warnings=False
inventory=/project/hosts <<<<<<<<<<<<<<<<<<<< New stuff
host_key_checking = False