Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

about junipernetworks.junos.junos_config #404

Open
jungekim opened this issue Apr 12, 2023 · 2 comments
Open

about junipernetworks.junos.junos_config #404

jungekim opened this issue Apr 12, 2023 · 2 comments
Assignees

Comments

@jungekim
Copy link

jungekim commented Apr 12, 2023

This is the ansible-playbook code;

- name: Change inbound and outbound route-maps
  junipernetworks.junos.junos_config:
    lines:
      - "delete protocols bgp group {{ bgp_group_name }} export {{ outbound_route_map }}"
      - "delete protocols bgp group {{ bgp_group_name }} import {{ inbound_route_map }}"
      - "set protocols bgp group {{ bgp_group_name }} export {{ FirstOutboundRoutemap }}"
      - "set protocols bgp group {{ bgp_group_name }} import {{ FirstInboundRoutemap }}"

when i executed the code, it doesn't work.
There is the error;

====
TASK [SetInternetCircuitPriority : Change inbound and outbound route-maps] *****************************************
fatal: [n2_IBBS]: FAILED! => {“changed”: false, “module_stderr”: “”, “module_stdout”: “\n{\“failed\“: true, \“msg\“: \“b’\\\\nconfiguration database modified\\\\n’\“, \“invocation\“: {\“module_args\“: {\“lines\“: [\“delete protocols bgp group LGU_1 export BGP_OUT_LGU_AS_prepend4\“, \“delete protocols bgp group LGU_1 import BGP_IN_100\“, \“set protocols bgp group LGU_1 export BGP_OUT_1\“, \“set protocols bgp group LGU_1 import BGP_IN_210\“], \“update\“: \“merge\“, \“confirm\“: 0, \“comment\“: \“configured by junos_config\“, \“confirm_commit\“: false, \“check_commit\“: false, \“backup\“: false, \“zeroize\“: false, \“src\“: null, \“src_format\“: null, \“replace\“: null, \“backup_options\“: null, \“rollback\“: null}}}\n\n{\“failed\“: true, \“msg\“: \“b’\\\\nConfiguration database is not open\\\\n’\“, \“invocation\“: {\“module_args\“: {\“lines\“: [\“delete protocols bgp group LGU_1 export BGP_OUT_LGU_AS_prepend4\“, \“delete protocols bgp group LGU_1 import BGP_IN_100\“, \“set protocols bgp group LGU_1 export BGP_OUT_1\“, \“set protocols bgp group LGU_1 import BGP_IN_210\“], \“update\“: \“merge\“, \“confirm\“: 0, \“comment\“: \“configured by junos_config\“, \“confirm_commit\“: false, \“check_commit\“: false, \“backup\“: false, \“zeroize\“: false, \“src\“: null, \“src_format\“: null, \“replace\“: null, \“backup_options\“: null, \“rollback\“: null}}}\n”, “msg”: “MODULE FAILURE\nSee stdout/stderr for the exact error”}

When i set the configuration manually, on a device, i does work

delete protocols bgp group LGU_1 export BGP_OUT_LGU_AS_prepend4
delete protocols bgp group LGU_1 import BGP_IN_100 
set protocols bgp group LGU_1 export BGP_OUT_1
set protocols bgp group LGU_1 import BGP_IN_210
@jungekim
Copy link
Author

  1. ansible-playbook --version
    ansible-playbook [core 2.12.5]
    config file = /etc/ansible/ansible.cfg
    configured module search path = ['/home/ansible/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
    ansible python module location = /usr/local/lib/python3.9/site-packages/ansible
    ansible collection location = /home/ansible/.ansible/collections:/usr/share/ansible/collections
    executable location = /usr/local/bin/ansible-playbook
    python version = 3.9.6 (default, Aug 25 2021, 16:22:38) [GCC 8.5.0 20210514 (Red Hat 8.5.0-3)]
    jinja version = 3.1.1
    libyaml = True

  2. ansible-galaxy collection list junipernetworks.junos

/usr/local/lib/python3.9/site-packages/ansible_collections

Collection Version


junipernetworks.junos 2.10.0

/home/ansible/.ansible/collections/ansible_collections

Collection Version


junipernetworks.junos 4.1.0
[ansible@8b0e6919cabc GSLB-status]$

@avermeer-tc
Copy link
Contributor

"configuration database modified" usually means that there is already a configure session going on the router. Login to the router, type configure. You should see something like: user a already has an exclusive commit under pid 1234.

request system logout pid 1234

Try to run the script again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants