add init task

This commit is contained in:
Robert Kaussow 2018-06-25 23:02:24 +02:00
parent cea833294f
commit 74c4011e4b
3 changed files with 16 additions and 2 deletions

View File

@ -1,4 +1,5 @@
---
certbot_initial_run_enabled: False
certbot_work_dir: /var/lib/letsencrypt
certbot_config_dir: /etc/letsencrypt
certbot_log_dir: /var/log/letsencrypt

13
tasks/init.yml Normal file
View File

@ -0,0 +1,13 @@
---
- name: Initialise certbot
block:
- name: Initial run of certbot
shell: >
certbot
--config-dir {{ certbot_config_dir }}
--work-dir {{ certbot_work_dir }}
--logs-dir {{ certbot_log_dir }}
{{ certbot_command_arguments | join(' ') }}
become: True
become_user: "{{ certbot_user }}"
when: certbot_initial_run_enabled

View File

@ -34,11 +34,11 @@
hour: 3
user: "{{ certbot_user }}"
job: >
"certbot
certbot
--config-dir {{ certbot_config_dir }}
--work-dir {{ certbot_work_dir }}
--logs-dir {{ certbot_log_dir }}
{{ certbot_command_arguments | join(' ') }}"
{{ certbot_command_arguments | join(' ') }}
cron_file: "{{ certbot_cronfile | default(omit) }}"
when: certbot_scheduler_enabled
become: True