summaryrefslogtreecommitdiff
path: root/roles/letsencrypt/tasks/main.yml
blob: a41b9aa1a88b062d3f3054d026cf09079d8156a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
---

- name: Install letsencrypt client for Xenial
  apt: pkg={{item}} state=installed
  with_items:
      - letsencrypt
      - python-letsencrypt-apache
  when: ansible_distribution_release == "xenial"

- name: Install cert for {{hostname}}
  command: letsencrypt -n --apache --agree-tos --email "{{email}}" -d "{{hostname}}"
  args:
      creates: /etc/letsencrypt/live/{{hostname}}/fullchain.pem
  when: ansible_distribution_release == "xenial"

- name: Ensure letsencrypt renewal cron is installed
  template: src=letsencrypt-crontab.cron dest=/etc/cron.d/letsencrypt-crontab
  when: ansible_distribution_release == "xenial"