ansible-ffrgb/roles/acertmgr/tasks/main.yml

43 lines
1.2 KiB
YAML
Raw Normal View History

2017-03-26 20:12:50 +02:00
---
- name: Install dependencies
apt: name={{ item }}
2017-03-26 20:12:50 +02:00
with_items:
- git
- python-dateutil
- python-openssl
2017-03-26 20:12:50 +02:00
- python-yaml
- name: Install acertmgr
2018-01-14 19:15:29 +01:00
git: repo=https://github.com/moepman/acertmgr.git dest=/opt/acertmgr depth=1 version=017f55f57cb77628061b6a5f4236055c2e4d5f02
2017-03-26 20:12:50 +02:00
- name: Create config directories
file: path={{ item }} state=directory mode=0755
with_items:
- /etc/acme
- /etc/acme/domains.d
- name: Configure acertmgr
template: src=acme.conf.j2 dest=/etc/acme/acme.conf
- name: Create private keys
command: openssl genrsa -out {{ item }} 4096 creates={{ item }}
with_items:
- /etc/acme/account.key
- /etc/acme/server.key
- name: Ensure private key permissoins
file: path={{ item }} owner=root mode=0400
with_items:
- /etc/acme/account.key
- /etc/acme/server.key
2017-07-03 21:18:45 +02:00
- name: Download Lets Encrypt CA certificate
get_url: url=https://letsencrypt.org/certs/lets-encrypt-x3-cross-signed.pem dest=/etc/acme/lets-encrypt-x3-cross-signed.pem
2017-03-26 20:12:50 +02:00
- name: Create challenge directory
file: path=/var/www/acme-challenge/ owner=root mode=0755 state=directory
- name: Enable acertmgr cronjob
cron: name=certmgr special_time=daily job=/opt/acertmgr/acertmgr.py