forked from Netz39_Admin/netz39-infra-ansible
separate out crin instead of domains
This commit is contained in:
parent
eb6f5a815d
commit
5d8e8f9ded
9 changed files with 67 additions and 64 deletions
4
roles/dehydrated-cron/defaults/main.yml
Normal file
4
roles/dehydrated-cron/defaults/main.yml
Normal file
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
dehydrated_cron_minute: "0"
|
||||
dehydrated_cron_hour: "3"
|
||||
dehydrated_cron_day: "*/5"
|
8
roles/dehydrated-cron/tasks/main.yml
Normal file
8
roles/dehydrated-cron/tasks/main.yml
Normal file
|
@ -0,0 +1,8 @@
|
|||
---
|
||||
- name: Install dehydrated cron job.
|
||||
cron:
|
||||
name: renew dehydrated certs
|
||||
hour: "{{ dehydrated_cron_hour }}"
|
||||
minute: "{{ dehydrated_cron_minute }}"
|
||||
day: "{{ dehydrated_cron_day }}"
|
||||
job: "{{ dehydrated_binary }} -c -g"
|
|
@ -1,4 +1,4 @@
|
|||
# Dehydrated Domains
|
||||
# Dehydrated
|
||||
|
||||
Ansible role to configure domains for use with dehydrated
|
||||
|
|
@ -6,7 +6,3 @@ dehydrated_binary: "/usr/local/bin/dehydrated"
|
|||
dehydrated_config_dir: "/usr/local/etc/dehydrated"
|
||||
dehydrated_certs_dir: "{{ dehydrated_config_dir }}/certs"
|
||||
dehydrated_wellknown_dir: "{{ dehydrated_config_dir }}/challenge"
|
||||
|
||||
dehydrated_cron_minute: "0"
|
||||
dehydrated_cron_hour: "3"
|
||||
dehydrated_cron_day: "*/5"
|
||||
|
|
52
roles/dehydrated/tasks/install.yml
Normal file
52
roles/dehydrated/tasks/install.yml
Normal file
|
@ -0,0 +1,52 @@
|
|||
---
|
||||
- name: Gather package facts.
|
||||
package_facts:
|
||||
manager: "auto"
|
||||
|
||||
- name: Ensure git and curl are installed.
|
||||
package:
|
||||
name:
|
||||
- git
|
||||
- curl
|
||||
state: present
|
||||
|
||||
- name: Clone dehydrated repo.
|
||||
git:
|
||||
repo: 'https://github.com/dehydrated-io/dehydrated.git'
|
||||
dest: "{{ dehydrated_location }}"
|
||||
version: "{{ dehydrated_version }}"
|
||||
|
||||
- name: Ensure dehydrated symlink is present.
|
||||
file:
|
||||
src: "{{ dehydrated_location }}/dehydrated"
|
||||
dest: "{{ dehydrated_binary }}"
|
||||
state: link
|
||||
|
||||
- name: Ensure config directory is present.
|
||||
file:
|
||||
path: "{{ dehydrated_config_dir }}"
|
||||
state: directory
|
||||
mode: "0711"
|
||||
|
||||
- name: Ensure wellknown directory is present.
|
||||
file:
|
||||
path: "{{ dehydrated_wellknown_dir }}"
|
||||
state: directory
|
||||
mode: "0755"
|
||||
|
||||
- name: Ensure certs directory is present.
|
||||
file:
|
||||
path: "{{ dehydrated_certs_dir }}"
|
||||
state: directory
|
||||
mode: "0700"
|
||||
|
||||
- name: Ensure domains.txt is present.
|
||||
file:
|
||||
path: "{{ dehydrated_config_dir }}/domains.txt"
|
||||
state: touch
|
||||
|
||||
- name: Ensure config is present.
|
||||
template:
|
||||
src: config.j2
|
||||
dest: "{{ dehydrated_config_dir }}/config"
|
||||
notify: dehydrated register
|
|
@ -1,60 +1,3 @@
|
|||
---
|
||||
- name: Gather package facts.
|
||||
package_facts:
|
||||
manager: "auto"
|
||||
|
||||
- name: Ensure git and curl are installed.
|
||||
package:
|
||||
name:
|
||||
- git
|
||||
- curl
|
||||
state: present
|
||||
|
||||
- name: Clone dehydrated repo.
|
||||
git:
|
||||
repo: 'https://github.com/dehydrated-io/dehydrated.git'
|
||||
dest: "{{ dehydrated_location }}"
|
||||
version: "{{ dehydrated_version }}"
|
||||
|
||||
- name: Ensure dehydrated symlink is present.
|
||||
file:
|
||||
src: "{{ dehydrated_location }}/dehydrated"
|
||||
dest: "{{ dehydrated_binary }}"
|
||||
state: link
|
||||
|
||||
- name: Ensure config directory is present.
|
||||
file:
|
||||
path: "{{ dehydrated_config_dir }}"
|
||||
state: directory
|
||||
mode: "0711"
|
||||
|
||||
- name: Ensure wellknown directory is present.
|
||||
file:
|
||||
path: "{{ dehydrated_wellknown_dir }}"
|
||||
state: directory
|
||||
mode: "0755"
|
||||
|
||||
- name: Ensure certs directory is present.
|
||||
file:
|
||||
path: "{{ dehydrated_certs_dir }}"
|
||||
state: directory
|
||||
mode: "0700"
|
||||
|
||||
- name: Ensure domains.txt is present.
|
||||
file:
|
||||
path: "{{ dehydrated_config_dir }}/domains.txt"
|
||||
state: touch
|
||||
|
||||
- name: Ensure config is present.
|
||||
template:
|
||||
src: config.j2
|
||||
dest: "{{ dehydrated_config_dir }}/config"
|
||||
notify: dehydrated register
|
||||
|
||||
- name: Install dehydrated cron job.
|
||||
cron:
|
||||
name: renew dehydrated certs
|
||||
hour: "{{ dehydrated_cron_hour }}"
|
||||
minute: "{{ dehydrated_cron_minute }}"
|
||||
day: "{{ dehydrated_cron_day }}"
|
||||
job: "{{ dehydrated_binary }} -c -g"
|
||||
- include_tasks: install.yml
|
||||
- include_tasks: domains.yml
|
Loading…
Reference in a new issue