restructured tasks such that subtask files are included

this is a preparation for installing certbot from package management
additionally, it might be useful when further tasks are added, e.g. for initial certificate retrieval
This commit is contained in:
exploide 2017-02-23 20:00:42 +01:00
parent 3dedd45961
commit 35ceee9f1b
3 changed files with 23 additions and 19 deletions

View File

@ -0,0 +1,13 @@
---
- name: Clone Certbot into configured directory.
git:
repo: "{{ certbot_repo }}"
dest: "{{ certbot_dir }}"
version: "{{ certbot_version }}"
update: "{{ certbot_keep_updated }}"
force: yes
- name: Ensure certbot-auto is executable.
file:
path: "{{ certbot_dir }}/certbot-auto"
mode: 0755

View File

@ -1,22 +1,5 @@
---
- name: Clone Certbot into configured directory.
git:
repo: "{{ certbot_repo }}"
dest: "{{ certbot_dir }}"
version: "{{ certbot_version }}"
update: "{{ certbot_keep_updated }}"
force: yes
- include: install-from-git.yml
- name: Ensure certbot-auto is executable.
file:
path: "{{ certbot_dir }}/certbot-auto"
mode: 0755
- name: Add cron job for 'certbot-auto renew' (if configured).
cron:
name: Certbot automatic renewal.
job: "{{ certbot_dir }}/certbot-auto renew --quiet --no-self-upgrade"
minute: "{{ certbot_auto_renew_minute }}"
hour: "{{ certbot_auto_renew_hour }}"
user: "{{ certbot_auto_renew_user }}"
- include: renew-cron.yml
when: certbot_auto_renew

8
tasks/renew-cron.yml Normal file
View File

@ -0,0 +1,8 @@
---
- name: Add cron job for 'certbot-auto renew' (if configured).
cron:
name: Certbot automatic renewal.
job: "{{ certbot_dir }}/certbot-auto renew --quiet --no-self-upgrade"
minute: "{{ certbot_auto_renew_minute }}"
hour: "{{ certbot_auto_renew_hour }}"
user: "{{ certbot_auto_renew_user }}"