Fix playbook check if delegate_to host is accessible
This commit is contained in:
parent
233e8e4ecf
commit
dfb9cf5ee7
2 changed files with 6 additions and 6 deletions
|
@ -5,7 +5,7 @@
|
||||||
- wireguard
|
- wireguard
|
||||||
|
|
||||||
- name: Check if wg_server is reachable
|
- name: Check if wg_server is reachable
|
||||||
ansible.builtin.command: echo "Test if wg_server is reachable"
|
ansible.builtin.command: echo "reachable"
|
||||||
delegate_to: wireguard_server
|
delegate_to: wireguard_server
|
||||||
register: result
|
register: result
|
||||||
changed_when: false
|
changed_when: false
|
||||||
|
@ -17,10 +17,10 @@
|
||||||
* server not reachable
|
* server not reachable
|
||||||
* no matching ssh-key
|
* no matching ssh-key
|
||||||
changed_when: true
|
changed_when: true
|
||||||
when: result.unreachable is defined and result.unreachable
|
when: result.stdout is not defined or result.stdout!="reachable"
|
||||||
|
|
||||||
- name: Configure WG Server
|
- name: Configure WG Server
|
||||||
when: result.unreachable is not defined or not result.unreachable
|
when: result.stdout is defined and result.stdout=="reachable"
|
||||||
block:
|
block:
|
||||||
- name: Set facts wg_clientname
|
- name: Set facts wg_clientname
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
when: cert_client_active.stat.exists
|
when: cert_client_active.stat.exists
|
||||||
|
|
||||||
- name: Check if radius-server is reachable
|
- name: Check if radius-server is reachable
|
||||||
ansible.builtin.command: echo "Test if radius-server is reachable"
|
ansible.builtin.command: echo "reachable"
|
||||||
delegate_to: radius_server
|
delegate_to: radius_server
|
||||||
register: radius_reachable
|
register: radius_reachable
|
||||||
changed_when: false
|
changed_when: false
|
||||||
|
@ -40,12 +40,12 @@
|
||||||
- "* server not reachable"
|
- "* server not reachable"
|
||||||
- "* no matching ssh-key"
|
- "* no matching ssh-key"
|
||||||
changed_when: true
|
changed_when: true
|
||||||
when: radius_reachable.unreachable is defined and radius_reachable.unreachable
|
when: radius_reachable.stdout is not defined or radius_reachable.stdout!='reachable'
|
||||||
|
|
||||||
- name: Issue radius certificate
|
- name: Issue radius certificate
|
||||||
ansible.builtin.include_tasks: eap-tls_issue-certificate.yaml
|
ansible.builtin.include_tasks: eap-tls_issue-certificate.yaml
|
||||||
when:
|
when:
|
||||||
- radius_reachable.unreachable is not defined or not radius_reachable.unreachable
|
- radius_reachable.stdout is defined and radius_reachable.stdout=="reachable"
|
||||||
- |
|
- |
|
||||||
( not cert_client_active.stat.exists ) or
|
( not cert_client_active.stat.exists ) or
|
||||||
(cert_serial.stdout | replace('serial=','') | int(base=16) ) in ( radius_crl.revoked_certificates | map(attribute='serial_number') | list ) or
|
(cert_serial.stdout | replace('serial=','') | int(base=16) ) in ( radius_crl.revoked_certificates | map(attribute='serial_number') | list ) or
|
||||||
|
|
Loading…
Add table
Reference in a new issue