mirror of
https://github.com/nikdoof/ansible-certbot.git
synced 2025-12-13 07:32:15 +00:00
39 lines
1.1 KiB
YAML
39 lines
1.1 KiB
YAML
---
|
|
- name: Certbot - Install certbot
|
|
ansible.builtin.package:
|
|
name: "{{ certbot_packages }}"
|
|
state: present
|
|
|
|
- name: Certbot - Build plugin list
|
|
set_fact:
|
|
_certbot_plugins_used: "{{ certbot_certs | map(attribute='plugin') | list | unique }}"
|
|
|
|
- name: Certbot - Map plugin names to package names
|
|
set_fact:
|
|
_certbot_plugins_used: "{{ [certbot_plugins_package_prefix] | product(_certbot_plugins_used) | map('join') | list }}"
|
|
|
|
- name: Certbot - Install extension packages
|
|
when:
|
|
- _certbot_plugins_used | length > 0
|
|
block:
|
|
- name: Certbot - Install certbot extensions (package manager)
|
|
ansible.builtin.package:
|
|
name: "{{ _certbot_plugins_used }}"
|
|
state: present
|
|
when:
|
|
- certbot_plugins_source == 'package_manager'
|
|
|
|
- name: Certbot - Install certbot extensions (pypi)
|
|
ansible.builtin.pip:
|
|
name: "{{ _certbot_plugins_used }}"
|
|
state: present
|
|
when:
|
|
- certbot_plugins_source == 'pypi'
|
|
|
|
- name: Certbot - Enable certbot renewal timer
|
|
ansible.builtin.systemd:
|
|
name: "{{ certbot_timer_service }}"
|
|
state: started
|
|
enabled: true
|
|
when: certbot_timer_service is defined
|