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
|
- name: Install lego
|
||||||
ansible.legacy.unarchive:
|
ansible.legacy.unarchive:
|
||||||
src: https://github.com/go-acme/lego/releases/download/v{{ lego_version }}/lego_v{{ lego_version }}_linux_amd64.tar.gz
|
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
|
- name: Write environment file
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: etc/sysconfig/lego.j2
|
src: etc/sysconfig/lego.j2
|
||||||
dest: /etc/sysconfig/lego
|
dest: "{{ __lego_systemd_env }}"
|
||||||
mode: "0600"
|
mode: "0600"
|
||||||
notify: __lego_restart
|
notify: __lego_restart
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ After=network-online.target
|
|||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
EnvironmentFile=/etc/sysconfig/lego
|
EnvironmentFile={{ __lego_systemd_env }}
|
||||||
|
|
||||||
{% for cert in lego_certificates %}
|
{% 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
|
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