Set commands now failing on junos_install_config
See original GitHub issueIn previous versions of junos_install_config this style of playbook would succeed. This playbook running against an vsrx in eve-ng.
---
- name: Juniper New Out of Box
hosts: srx
gather_facts: false
connection: local
tasks:
- junos_install_config:
file: "~/local_ansible/config.set"
mode: telnet
user: root
port: 32781
host: 10.0.254.1
This now fails under an updated version with the following. The full traceback is:
Traceback (most recent call last):
File "/tmp/ansible_8olY8M/ansible_module_junos_install_config.py", line 1127, in <module>
main()
File "/tmp/ansible_8olY8M/ansible_module_junos_install_config.py", line 750, in main
config_format_choices = juniper_junos_common.CONFIG_FORMAT_CHOICES
AttributeError: 'NoneType' object has no attribute 'CONFIG_FORMAT_CHOICES'
fatal: [vsrx]: FAILED! => {
"changed": false,
"failed": true,
"module_stderr": "Traceback (most recent call last):\n File \"/tmp/ansible_8olY8M/ansible_module_junos_install_config.py\", line 1127, in <module>\n main()\n File \"/tmp/ansible_8olY8M/ansible_module_junos_install_config.py\", line 750, in main\n config_format_choices = juniper_junos_common.CONFIG_FORMAT_CHOICES\nAttributeError: 'NoneType' object has no attribute 'CONFIG_FORMAT_CHOICES'\n",
"module_stdout": "",
"msg": "MODULE FAILURE",
"rc": 0
}
Reading the juniper_junos_config.py file shows updates in what arguments are expected. I have tried interpreting this and changed the playbook as:
- junos_install_config:
load: "override"
src: "config.set"
format: "set"
mode: 'telnet'
user: root
port: 32781
host: 10.0.254.1
Yet the same error persists. It would be nice to get some direction this. Thanks team!
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Loading Configuration Files | Junos OS - Juniper Networks
To load a configuration that contains set configuration mode commands, specify the set option. This option executes the configuration instructions line by line ......
Read more >Problem with Juniper Installation on local machine
These commands worked fine. sudo locale-gen en_US en_US.UTF-8 sudo dpkg-reconfigure locales sudo dpkg --configure -a sudo apt-get update -y ...
Read more >Run arbitrary commands on an Juniper JUNOS device
Sends an arbitrary set of commands to an JUNOS node and returns the results read from the device. This module includes an argument...
Read more >Juniper backup is not working, it is failing with command login ...
Run the remoteloginconsole.exe which is what Config Management is using, to test. Also what is set as the remote console in the Config....
Read more >DAY ONE: AUTOMATING JUNOS® WITH ANSIBLE - NLogic
Create playbooks to execute commands on Junos devices. ▫ Create playbooks to update Junos device configuration, in either “set” or “config” format.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@crosson
I’m sorry I didn’t notice this earlier. This appears to be an installation issue with the new modules. The new modules use a library of shared code which doesn’t appear to be installed on your machine.
Unfortunately, I believe this is likely an issue with the
ansible-galaxycommand. It doesn’t handle upgrades cleanly. Please uninstall the modules, and then install cleanly with:Once this is done, you can confirm that the shared library of code exists by checking for the following file:
Note:
<roles_dir>is usually/etc/ansible/rolescould be different on your machine.I successfully used the following playbook successfully when trying to replicate your issue:
If you wish to update to the new module name and argument syntax, you can also use this equivalent playbook:
If you still have issues after cleanly installing the modules, please provide the version of Ansible you are using, and the version of PyEZ you are using.
I am facing the same issue. I have opened up a new bug on this.