initial commit of dehydrated role
This commit is contained in:
parent
73e8afdac8
commit
0137cd9743
4 changed files with 40 additions and 0 deletions
5
roles/dehydrated/defaults/main.yml
Normal file
5
roles/dehydrated/defaults/main.yml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
dehydrated_version: "v0.7.0"
|
||||||
|
dehydrated_location: /usr/local/share/dehydrated
|
||||||
|
dehydrated_path: /usr/local/bin/dehydrated
|
||||||
|
dehydrated_config: /usr/local/etc/dehydrated/
|
27
roles/dehydrated/tasks/main.yml
Normal file
27
roles/dehydrated/tasks/main.yml
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
---
|
||||||
|
- name: Gather package facts.
|
||||||
|
package_facts:
|
||||||
|
manager: "auto"
|
||||||
|
|
||||||
|
- name: Clone dehydrated repo.
|
||||||
|
ansible.builtin.git:
|
||||||
|
repo: git@github.com:dehydrated-io/dehydrated.git
|
||||||
|
dest: "{{ dehydrated_location }}"
|
||||||
|
version: "{{ dehydrated_version }}"
|
||||||
|
|
||||||
|
- name: Ensure dehydrated symlink is present.
|
||||||
|
ansible.builtin.file:
|
||||||
|
src: "{{ dehydrated_location }}/dehydrated"
|
||||||
|
dest: "{{ dehydrated_path }}"
|
||||||
|
state: link
|
||||||
|
|
||||||
|
# copy config
|
||||||
|
- name: Ensure domains.txt is present.
|
||||||
|
ansible.builtin.template:
|
||||||
|
src: /templates/domains.txt.j2
|
||||||
|
dest: "{{ dehydrated_config }}/domains.txt"
|
||||||
|
|
||||||
|
- name: Ensure config is present.
|
||||||
|
ansible.builtin.template:
|
||||||
|
src: /templates/config.j2
|
||||||
|
dest: "{{ dehydrated_config }}/config"
|
2
roles/dehydrated/templates/config.j2
Normal file
2
roles/dehydrated/templates/config.j2
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
HOOK={{ dehydrated_location }}/hook.sh
|
||||||
|
WELLKNOWN=/var/www/letsencrypt
|
6
roles/dehydrated/templates/domains.txt.j2
Normal file
6
roles/dehydrated/templates/domains.txt.j2
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{{ inventory_hostname }}
|
||||||
|
{% if extra_hostnames is defined %}
|
||||||
|
{% for hostname in extra_hostnames %}
|
||||||
|
{{ hostname }}
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
Loading…
Reference in a new issue