initial commit of dehydrated role

This commit is contained in:
David Kilias 2021-02-01 20:24:38 +01:00
parent 73e8afdac8
commit 0137cd9743
4 changed files with 40 additions and 0 deletions

View 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/

View 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"

View file

@ -0,0 +1,2 @@
HOOK={{ dehydrated_location }}/hook.sh
WELLKNOWN=/var/www/letsencrypt

View file

@ -0,0 +1,6 @@
{{ inventory_hostname }}
{% if extra_hostnames is defined %}
{% for hostname in extra_hostnames %}
{{ hostname }}
{% endfor %}
{% endif %}