Ansible Role - Certbot (for Let's Encrypt)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible-role-certbot/tasks/setup-hooks.yml

30 lines
891 B

---
- name: Ensure renewal hook directories exist
file:
path: "/etc/letsencrypt/renewal-hooks/{{ item }}"
state: directory
with_items:
- post
- pre
- deploy
- name: Create post-renewal hook
copy:
content: "{{ certbot_renewal_hook_post }}"
dest: "/etc/letsencrypt/renewal-hooks/post/{{ certbot_renewal_hook_post_filename }}"
mode: "0755"
when: certbot_renewal_hook_post != ""
- name: Create pre-renewal hook
copy:
content: "{{ certbot_renewal_hook_pre }}"
dest: "/etc/letsencrypt/renewal-hooks/pre/{{ certbot_renewal_hook_pre_filename }}"
mode: "0755"
when: certbot_renewal_hook_pre != ""
- name: Create deploy-renewal hook
copy:
content: "{{ certbot_renewal_hook_deploy }}"
dest: "/etc/letsencrypt/renewal-hooks/deploy/{{ certbot_renewal_hook_deploy_filename }}"
mode: "0755"
when: certbot_renewal_hook_deploy != ""