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
|
||||
==========
|
||||
|
||||
Diese Rolle installiert [dehydrated](https://dehydrated.io/), akzeptiert die TOS und erstellt eine `domains.txt`.
|
||||
Sie ist zur Verwendung in anderen playbooks gedacht.
|
||||
Setup and configure [Dehydrated](https://dehydrated.io/).
|
||||
|
||||
**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"
|
||||
ansible.builtin.command: dehydrated --register --accept-terms
|
||||
|
||||
# https://github.com/dehydrated-io/dehydrated/blob/master/docs/domains_txt.md
|
||||
- name: "Dehydrated | Create domains.txt"
|
||||
ansible.builtin.file:
|
||||
path: /etc/dehydrated/domains.txt
|
||||
state: touch
|
||||
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
|
||||
|
||||
- import_tasks: dehydrated.yml
|
||||
- name: Configure Dehydrated
|
||||
ansible.builtin.import_tasks: dehydrated.yml
|
||||
tags: dehydrated
|
||||
|
|
|
@ -2,4 +2,5 @@
|
|||
- name: Packages | Install package
|
||||
ansible.builtin.apt:
|
||||
pkg:
|
||||
- chronic
|
||||
- dehydrated
|
||||
|
|
Loading…
Reference in a new issue