Robert Kaussow
998c2ff4dc
All checks were successful
continuous-integration/drone/push Build is passing
49 lines
1.3 KiB
YAML
49 lines
1.3 KiB
YAML
---
|
|
- block:
|
|
- name: Install certbot
|
|
package:
|
|
name: "{{ item }}"
|
|
state: present
|
|
loop: "{{ certbot_packages_extra + __certbot_packages }}"
|
|
|
|
- name: Create certbot user '{{ certbot_user }}'
|
|
user:
|
|
name: "{{ certbot_user }}"
|
|
become: True
|
|
become_user: root
|
|
when: not certbot_user == 'root'
|
|
become: True
|
|
become_user: root
|
|
|
|
- block:
|
|
- name: Create certbot environment
|
|
file:
|
|
path: "{{ item.name }}"
|
|
state: directory
|
|
mode: "{{ item.mode }}"
|
|
loop: "{{ certbot_environment }}"
|
|
loop_control:
|
|
label: "{{ item.name }}"
|
|
|
|
- name: Deploy config file
|
|
template:
|
|
src: config/cli.ini.j2
|
|
dest: "{{ certbot_config_dir }}/cli.ini"
|
|
|
|
- name: Schedule certbot run
|
|
cron:
|
|
name: certbot - letsencrypt certs renewal
|
|
minute: 55
|
|
hour: 3
|
|
user: "{{ certbot_user }}"
|
|
job: >
|
|
certbot
|
|
--config-dir {{ certbot_config_dir }}
|
|
--work-dir {{ certbot_work_dir }}
|
|
--logs-dir {{ certbot_log_dir }}
|
|
{{ certbot_command_arguments | join(' ') }}
|
|
cron_file: "{{ certbot_cronfile | default(omit) }}"
|
|
when: certbot_scheduler_enabled
|
|
become: True
|
|
become_user: "{{ certbot_user }}"
|