fix systemd env location
Some checks failed
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/test Pipeline failed
ci/woodpecker/push/docs unknown status
ci/woodpecker/push/notify Pipeline was successful

This commit is contained in:
Robert Kaussow 2024-09-28 22:32:56 +02:00
parent 39a07225b7
commit 032107d955
Signed by: xoxys
GPG Key ID: 4E692A2EAECC03C0
4 changed files with 17 additions and 2 deletions

View File

@ -1,4 +1,15 @@
---
- name: Include OS specific vars
ansible.builtin.include_vars: "{{ lookup('first_found', params) }}"
vars:
params:
files:
- "{{ ansible_lsb.id | default('') | lower }}.yml"
- "{{ ansible_os_family | lower }}.yml"
paths:
- "vars"
errors: "ignore"
- name: Install lego
ansible.legacy.unarchive:
src: https://github.com/go-acme/lego/releases/download/v{{ lego_version }}/lego_v{{ lego_version }}_linux_amd64.tar.gz
@ -62,7 +73,7 @@
- name: Write environment file
ansible.builtin.template:
src: etc/sysconfig/lego.j2
dest: /etc/sysconfig/lego
dest: "{{ __lego_systemd_env }}"
mode: "0600"
notify: __lego_restart

View File

@ -7,7 +7,7 @@ After=network-online.target
[Service]
Type=oneshot
EnvironmentFile=/etc/sysconfig/lego
EnvironmentFile={{ __lego_systemd_env }}
{% for cert in lego_certificates %}
ExecStart={{ __lego_bin_file }} --email="{{ lego_acme_account_email }}" --domains {{ ' --domains '.join(cert.domains) }} $ARGS renew {{ '--renew-hook="' + __lego_base_dir + '/hooks/' + cert.name + '.sh"' if cert.hook is defined else '' }} --days 30

2
vars/debian.yml Normal file
View File

@ -0,0 +1,2 @@
---
__lego_systemd_env: /etc/default/lego

2
vars/redhat.yml Normal file
View File

@ -0,0 +1,2 @@
---
__lego_systemd_env: /etc/sysconfig/lego