Start tasks for letsencrypt for tunuifranken.info
This commit is contained in:
parent
494f388130
commit
f8a1592b69
2 changed files with 23 additions and 0 deletions
20
roles/tunuifranken/tasks/letsencrypt.yml
Normal file
20
roles/tunuifranken/tasks/letsencrypt.yml
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
---
|
||||||
|
- 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
|
|
@ -11,6 +11,9 @@
|
||||||
state: directory
|
state: directory
|
||||||
mode: 0775
|
mode: 0775
|
||||||
|
|
||||||
|
- name: Deploy letsencrypt certificate
|
||||||
|
ansible.builtin.include_tasks: letsencrypt.yml
|
||||||
|
|
||||||
- name: Copy vHost conf
|
- name: Copy vHost conf
|
||||||
become: true
|
become: true
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
|
|
Loading…
Reference in a new issue