Add cron job, update README
This commit is contained in:
parent
a43de905b6
commit
4b3b89d560
5 changed files with 41 additions and 4 deletions
18
README.md
18
README.md
|
@ -1,5 +1,19 @@
|
||||||
Dehydrated
|
Dehydrated
|
||||||
==========
|
==========
|
||||||
|
|
||||||
Diese Rolle installiert [dehydrated](https://dehydrated.io/), akzeptiert die TOS und erstellt eine `domains.txt`.
|
Setup and configure [Dehydrated](https://dehydrated.io/).
|
||||||
Sie ist zur Verwendung in anderen playbooks gedacht.
|
|
||||||
|
**Feature**
|
||||||
|
- Install Dehydrate
|
||||||
|
- Accept TOS
|
||||||
|
- Create `domains.txt` and domain directory
|
||||||
|
- Create cron job for certificate renewal
|
||||||
|
|
||||||
|
## Variables
|
||||||
|
|
||||||
|
| Name | Default | Descrition |
|
||||||
|
|--|--|--|
|
||||||
|
| `dehydrated_cron_name` | Dehydrated certificate renewal | Name of the cron job |
|
||||||
|
| `dehydrated_cron_hour` | 01 | Hour to run the cron job |
|
||||||
|
| `dehydrated_cron_minute` | 08 | Minute to run the cron job |
|
||||||
|
| `dehydrated_cron_user` | root | User to create the cron job for |
|
||||||
|
|
5
defaults/main.yml
Normal file
5
defaults/main.yml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
dehydrated_cron_name: Dehydrated certificate renewal
|
||||||
|
dehydrated_cron_hour: "01"
|
||||||
|
dehydrated_cron_minute: "08"
|
||||||
|
dehydrated_cron_user: root
|
|
@ -2,8 +2,23 @@
|
||||||
- name: "Dehydrated | Accept TOS"
|
- name: "Dehydrated | Accept TOS"
|
||||||
ansible.builtin.command: dehydrated --register --accept-terms
|
ansible.builtin.command: dehydrated --register --accept-terms
|
||||||
|
|
||||||
|
# https://github.com/dehydrated-io/dehydrated/blob/master/docs/domains_txt.md
|
||||||
- name: "Dehydrated | Create domains.txt"
|
- name: "Dehydrated | Create domains.txt"
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: /etc/dehydrated/domains.txt
|
path: /etc/dehydrated/domains.txt
|
||||||
state: touch
|
state: touch
|
||||||
mode: "0644"
|
mode: "0644"
|
||||||
|
|
||||||
|
- name: "Dehydrated | Create domains directory"
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: /etc/dehydrated/domains.txt.d
|
||||||
|
state: directory
|
||||||
|
mode: "0755"
|
||||||
|
|
||||||
|
- name: Dehydrated | Create cron job
|
||||||
|
ansible.builtin.cron:
|
||||||
|
name: "{{ dehydrated_cron_name }}"
|
||||||
|
hour: "{{ dehydrated_cron_hour }}"
|
||||||
|
minute: "{{ dehydrated_cron_minute }}"
|
||||||
|
user: "{{ dehydrated_cron_user }}"
|
||||||
|
job: "chronic dehydrated --cron -g"
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
---
|
---
|
||||||
- import_tasks: packages.yml
|
- name: Install packages
|
||||||
|
ansible.builtin.import_tasks: packages.yml
|
||||||
tags: packages
|
tags: packages
|
||||||
|
|
||||||
- import_tasks: dehydrated.yml
|
- name: Configure Dehydrated
|
||||||
|
ansible.builtin.import_tasks: dehydrated.yml
|
||||||
tags: dehydrated
|
tags: dehydrated
|
||||||
|
|
|
@ -2,4 +2,5 @@
|
||||||
- name: Packages | Install package
|
- name: Packages | Install package
|
||||||
ansible.builtin.apt:
|
ansible.builtin.apt:
|
||||||
pkg:
|
pkg:
|
||||||
|
- chronic
|
||||||
- dehydrated
|
- dehydrated
|
||||||
|
|
Loading…
Reference in a new issue