You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a simple playbook to add/delete static routes on a SRX.
add a new route works well
delete an existing route does nothing when using the playbook
delete manually the route works.
Run the following playbook twice.
First run : create the route
Second run: delete the route
The debug statement show the command line that should be done on the firewall.
Here my playbook:
`---
hosts: localhost
gather_facts: no
connection: local
vars_prompt:
name: subnet
prompt: Subnet a router
private: no
name: next_hop
prompt: next-hop
private: no
name: action
prompt: set ou delete
private: no
default: set
Hello
ansible-playbook version: 2.13.6
junipernetworks.junos galaxy collection version: 5.1.0
I have a simple playbook to add/delete static routes on a SRX.
add a new route works well
delete an existing route does nothing when using the playbook
delete manually the route works.
Run the following playbook twice.
First run : create the route
Second run: delete the route
The debug statement show the command line that should be done on the firewall.
Here my playbook:
`---
hosts: localhost
gather_facts: no
connection: local
vars_prompt:
name: subnet
prompt: Subnet a router
private: no
name: next_hop
prompt: next-hop
private: no
name: action
prompt: set ou delete
private: no
default: set
tasks:
set_fact:
subnet: "{{subnet }}"
next_hop: "{{next_hop }}"
action: "{{action}}"
hosts:
connection: netconf
gather_facts: no
vars:
ansible_command_timeout: 300
ansible_connect_timeout: 300
tasks:
name: "{{ hostvars['localhost']['action'] }} route on test-srx"
junipernetworks.junos.junos_config:
lines: "{{ hostvars['localhost']['action'] }} logical-systems isv-fw-back routing-instances RI-BVxLAN routing-options static route {{ hostvars['localhost']['subnet'] }} next-hop {{ hostvars['localhost']['next_hop'] }}"
debug:
msg:
...
`
My guess is that delete statement is replace by a set statement.
There was on old issue about this behaviour: ansible/ansible#29775
Kind regards,
The text was updated successfully, but these errors were encountered: