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

Add tasks to clean unconfigured P2s #67

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions tasks/ipsecphase1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,22 @@
loop_control:
loop_var: p2

- name: "IPSec ike phase2 search configured uniqid for ikeid {{ ikeid }}"
delegate_to: localhost
community.general.xml:
path: "{{ local_config_path }}"
xpath: "/opnsense/ipsec/phase2[ikeid='{{ ikeid }}']/uniqid"
content: text
register: phase2ikeiduniqid_all

- name: "IPSec ike phase2 cleanup for ikeid {{ ikeid }}"
delegate_to: localhost
community.general.xml:
path: "{{ local_config_path }}"
xpath: "/opnsense/ipsec/phase2[ikeid='{{ ikeid }}' and uniqid='{{ item.uniqid }}']"
state: absent
pretty_print: yes

Check failure on line 101 in tasks/ipsecphase1.yml

View workflow job for this annotation

GitHub Actions / ansible lint

yaml[truthy]

Truthy value should be one of \[false, true]
Jonybat marked this conversation as resolved.
Show resolved Hide resolved
when: item.uniqid not in ipsecphasevar.phase2
with_items: "{{ phase2ikeiduniqid_all.matches }}"

...
Loading