sync roles with changes from OWS
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
---
|
||||
|
||||
- name: Get latest lego version
|
||||
github_release:
|
||||
user: go-acme
|
||||
@@ -9,12 +10,23 @@
|
||||
run_once: true
|
||||
register: lego_version
|
||||
|
||||
- name: Download lego {{ lego_version.tag }} from GitHub
|
||||
- name: Set architecture alias
|
||||
set_fact:
|
||||
architecture_alias: "amd64" # noqa: var-naming[no-role-prefix]
|
||||
when: ansible_architecture == "x86_64"
|
||||
|
||||
- name: Set architecture alias
|
||||
set_fact:
|
||||
architecture_alias: "arm64" # noqa: var-naming[no-role-prefix]
|
||||
when: ansible_architecture == "aarch64"
|
||||
|
||||
- name: "Download lego from GitHub ({{ lego_version.tag }})"
|
||||
get_url:
|
||||
url: "https://github.com/go-acme/lego/releases/download/\
|
||||
{{ lego_version.tag }}/lego_{{ lego_version.tag }}\
|
||||
_linux_{{ deb_architecture }}.tar.gz"
|
||||
_linux_{{ architecture_alias }}.tar.gz"
|
||||
dest: "/var/tmp/lego.tar.gz"
|
||||
mode: "0644"
|
||||
register: lego_download_archive
|
||||
until: lego_download_archive is succeeded
|
||||
retries: 3
|
||||
@@ -24,8 +36,7 @@
|
||||
unarchive:
|
||||
remote_src: true
|
||||
src: "/var/tmp/lego.tar.gz"
|
||||
dest: "/var/tmp"
|
||||
mode: "0755"
|
||||
dest: "{{ lego_install_dir }}"
|
||||
extra_opts:
|
||||
- --one-top-level
|
||||
include:
|
||||
@@ -37,21 +48,17 @@
|
||||
mode: "0755"
|
||||
state: directory
|
||||
|
||||
- name: Check lego registration
|
||||
stat:
|
||||
path: "{{ lego_config_dir }}/accounts"
|
||||
register: account_dir
|
||||
|
||||
- name: Register lego and create cert
|
||||
command: |
|
||||
{{ lego_install_dir }}/lego --accept-tos
|
||||
{% for dns in certificate_domains %}
|
||||
--domains="{{ dns }}"
|
||||
{% endfor %}
|
||||
{{ lego_cli_params|join(' ') }}
|
||||
{{ lego_cli_params | join(' ') }}
|
||||
run
|
||||
args:
|
||||
creates: "/etc/lego/accounts"
|
||||
environment: '{ "{{ lego_provider|upper }}_API_KEY": "{{ vault_ionos_token_dns }}" }'
|
||||
when: not account_dir.stat.exists
|
||||
|
||||
- name: Copy lego systemd service
|
||||
template:
|
||||
|
||||
Reference in New Issue
Block a user