-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.yml
24 lines (19 loc) · 876 Bytes
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
---
# tasks file for oaf.certbot
- name: Install Certbot PPA
apt_repository:
repo: ppa:certbot/certbot
- name: Install certbot and plugins
apt:
pkg: "{{ item }}"
with_items:
- certbot
- python-certbot-{{ certbot_webserver }}
- name: Install certificates with certbot
command: certbot run --non-interactive --keep --expand --{{ certbot_webserver }} -m {{ item.email }} {{ ['-d'] | product(item.domains) | map('join', ' ') | join(' ') }}
loop: "{{ certbot_certs| flatten(levels=1) }}"
when: certbot_webroot is undefined
- name: Install certificates with certbot via webroot
command: certbot certonly --non-interactive --keep --expand --webroot -w {{ certbot_webroot }} -m {{ item.email }} {{ ['-d'] | product(item.domains) | map('join', ' ') | join(' ') }}
loop: "{{ certbot_certs| flatten(levels=1) }}"
when: certbot_webroot is defined