I've resolved this. There was an update made to junos-eznc that broke the 
version of Juniper-junos on Ansible-Galaxy. I had to pull a more recent 
version from the git repo.

Daniel

On Tuesday, April 11, 2017 at 5:59:54 AM UTC-7, Daniel Ratcliffe wrote:
>
> Hello,
>
> I installed Ansible(2.2.1.0), the Juniper.junos(1.4.0) role from Ansible 
> galaxy with junos-eznc (2.1.1). I tried to create a test playbook to obtain 
> the version of my test switch as shown below.
>
> ---
> - name: Get Device Facts
>   hosts: juniper
>   roles:
>     - Juniper.junos
>   connection: local
>   gather_facts: no
>   tasks:
>     - name: Checking NETCONF connectivity
>       wait_for: host={{ inventory_hostname }} port=830 timeout=5
>
>     - name: Get Facts
>       junos_get_facts:
>         host={{ inventory_hostname }}
>         savedir=/home/dratcliffe/ansible
>       register: junos
>
>     - name: Show Version
>       debug: msg="{{ junos.facts.version }}" 
>
> when I run the playback I get the following error.
>
> [user@ansible ~]$ ansible-playbook test.yml
>
> PLAY [Get Device Facts] 
> ********************************************************
>
> TASK [Checking NETCONF connectivity] 
> *******************************************
> ok: [X.X.X.X]
>
> TASK [Get Facts] 
> ***************************************************************
> An exception occurred during task execution. To see the full traceback, 
> use -vvv. The error was: RuntimeError: facts are read-only!
> fatal: [X.X.X.X]: FAILED! => {"changed": false, "failed": true, 
> "module_stderr": "Traceback (most recent call last):\n  File 
> \"/tmp/ansible_SkXS6C/ansible_module_junos_get_facts.py\", line 235, in 
> <module>\n    main()\n  File 
> \"/tmp/ansible_SkXS6C/ansible_module_junos_get_facts.py\", line 176, in 
> main\n    dev.facts['has_2RE'] = dev.facts['2RE']\n  File 
> \"/usr/lib/python2.7/site-packages/jnpr/junos/factcache.py\", line 171, in 
> __setitem__\n    raise RuntimeError(\"facts are 
> read-only!\")\nRuntimeError: facts are read-only!\n", "module_stdout": "", 
> "msg": "MODULE FAILURE"}
> to retry, use: --limit @/home/dratcliffe/test.retry
>
> PLAY RECAP 
> *********************************************************************
> X.X.X.X              : ok=1    changed=0    unreachable=0    failed=1   
>
>
> It seems when it gets the facts it tried to write something and I get an 
> error saying it is read-only? Has anyone encountered this?
>

-- 
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/a95dfedb-3bcd-433c-bfaf-9d67b3996ef9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to