mirror of
https://github.com/geerlingguy/ansible-role-certbot.git
synced 2025-04-19 17:01:37 +02:00
Adds test for systemd
This commit is contained in:
parent
d446865f13
commit
9b02af1064
@ -10,6 +10,8 @@ env:
|
||||
- MOLECULE_DISTRO: centos6
|
||||
MOLECULE_PLAYBOOK: playbook-source-install.yml
|
||||
- MOLECULE_DISTRO: ubuntu1804
|
||||
- MOLECULE_DISTRO: ubuntu1604
|
||||
CERTBOT_AUTO_RENEW_SYSTEMD: true
|
||||
- MOLECULE_DISTRO: ubuntu1604
|
||||
- MOLECULE_DISTRO: ubuntu1404
|
||||
MOLECULE_PLAYBOOK: playbook-source-install.yml
|
||||
|
@ -5,6 +5,7 @@
|
||||
|
||||
vars:
|
||||
certbot_auto_renew_user: root
|
||||
certbot_auto_renew_systemd: "{{ lookup('env', 'CERTBOT_AUTO_RENEW_SYSTEMD') }}"
|
||||
|
||||
pre_tasks:
|
||||
- name: Update apt cache.
|
||||
|
@ -1,13 +1,25 @@
|
||||
---
|
||||
|
||||
- name: Get absolute path of certbot executable
|
||||
command: "which {{ certbot_script }}"
|
||||
register: certbot_script_absolute
|
||||
changed_when: false
|
||||
|
||||
- name: Create certbot-renew service
|
||||
template:
|
||||
src: certbot-renew.service.j2
|
||||
dest: /etc/systemd/system/certbot-renew.service
|
||||
notify: certbot restart renew timer
|
||||
vars:
|
||||
certbot_script_path: "{{ certbot_script_absolute.stdout }}"
|
||||
|
||||
- name: Create certbot-renew timer
|
||||
template:
|
||||
src: certbot-renew.timer.j2
|
||||
dest: /etc/systemd/system/certbot-renew.timer
|
||||
notify: certbot restart renew timer
|
||||
|
||||
- name: Start certbot-renew timer
|
||||
systemd:
|
||||
name: certbot-renew.timer
|
||||
state: started
|
||||
|
@ -4,6 +4,6 @@ Description=Let's Encrypt renewal service
|
||||
[Service]
|
||||
User={{ certbot_auto_renew_user }}
|
||||
Type=oneshot
|
||||
ExecStart={{ certbot_script }} renew --quiet --agree-tos
|
||||
ExecStart={{ certbot_script_path }} renew {{ certbot_auto_renew_options }}
|
||||
|
||||
ExecStartPost=/bin/systemctl reload {{ certbot_web_service }}.service
|
||||
|
Loading…
x
Reference in New Issue
Block a user