Adds test for systemd

This commit is contained in:
Nikolaos Kakouros 2019-05-12 18:29:59 +02:00
parent d446865f13
commit 5e295e8714
4 changed files with 9 additions and 1 deletions

View File

@ -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

View File

@ -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.

View File

@ -11,3 +11,8 @@
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

View File

@ -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 }} renew {{ certbot_auto_renew_options }}
ExecStartPost=/bin/systemctl reload {{ certbot_web_service }}.service