#
# Copyright (c) 2020 Bubble, Inc.  All rights reserved. For personal (non-commercial) use, see license: https://getbubblenow.com/bubble-license/
#
- name: Ensure nginx is stopped
  service:
    name: nginx
    state: stopped

# see https://weakdh.org/sysadmin.html
- name: Create a strong dhparam.pem
  shell: openssl dhparam -out /etc/nginx/dhparams.pem 2048
  args:
    creates: /etc/nginx/dhparams.pem

- name: Create dhparam nginx conf
  template: src=stronger_dhparams.conf dest=/etc/nginx/conf.d/stronger_dhparams.conf

- include: site.yml

- name: Init certbot
  shell: init_certbot.sh {{ letsencrypt_email }} {{ server_name }} {{ server_alias }}

- name: Ensure nginx is restarted
  service:
    name: nginx
    state: restarted
