21 lines
546 B
YAML
21 lines
546 B
YAML
|
---
|
||
|
- name: Get public IP
|
||
|
ansible.builtin.uri:
|
||
|
url: https://ipinfo.io/ip
|
||
|
return_content: true
|
||
|
register: local_public_ip
|
||
|
|
||
|
- name: Get tunuifranken.info public IP
|
||
|
ansible.builtin.set_fact:
|
||
|
target_public_ip: "{{ lookup('community.general.dig', 'tunuifranken.info', '@1.1.1.1') }}"
|
||
|
|
||
|
- name: Do http-01 challenge
|
||
|
ansible.builtin.debug:
|
||
|
msg: "http-01"
|
||
|
when: local_public_ip.content == target_public_ip
|
||
|
|
||
|
- name: Do dns-01 challenge
|
||
|
ansible.builtin.debug:
|
||
|
msg: "dns-01"
|
||
|
when: local_public_ip.content != target_public_ip
|