If i delete a non-existing firewall rule and an existing rule starts with the same numbers as the ID i deleted, ansible will show a change, even if it does not change the config.
---
- name: Test vyos idempotency
hosts: devhost
tasks:
- name: Create a test rule
vyos.vyos.vyos_config:
lines:
- set firewall ipv4 input filter rule 999 description "testrule"
- set firewall ipv4 input filter rule 999 action accept
- name: Delete non-existing rule
vyos.vyos.vyos_config:
lines:
- delete firewall ipv4 input filter rule 8
- name: Delete non-existing rule with id that starts similar to an existing one
vyos.vyos.vyos_config:
lines:
- delete firewall ipv4 input filter rule 9The Third step will always show a change, even if there was no rule deleted, the second step will just show an "ok" since it did not change anything.
Tested with:
ansible [core 2.17.12] python version = 3.12.3 (main, Jun 18 2025, 17:59:45) [GCC 13.3.0] (/usr/bin/python3) jinja version = 3.1.2 vyos.vyos 6.0.0