fix systemd env location
This commit is contained in:
parent
39a07225b7
commit
032107d955
@ -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
|
||||
|
||||
|
@ -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
2
vars/debian.yml
Normal file
@ -0,0 +1,2 @@
|
||||
---
|
||||
__lego_systemd_env: /etc/default/lego
|
2
vars/redhat.yml
Normal file
2
vars/redhat.yml
Normal file
@ -0,0 +1,2 @@
|
||||
---
|
||||
__lego_systemd_env: /etc/sysconfig/lego
|
Loading…
Reference in New Issue
Block a user