devfund-website/playbooks/setup_certificate.yaml

37 lines
1.0 KiB
YAML

---
- hosts: https
gather_facts: false
become: true
roles: [common]
tasks:
- name: Creating various directories
ansible.builtin.file: path={{ item }} state=directory owner={{ nginx.user }} group={{ nginx.group }} mode=0644
with_items:
- "{{ dir.errors }}"
- name: Copying error pages
ansible.builtin.template:
src: "templates/nginx/errors/503-service-unavailable.html"
dest: "{{ dir.errors }}/503-service-unavailable.html"
mode: 0644
- import_tasks: common/tasks/nginx/add_upstreaminfo_log_format.yaml
- name: Copying nginx config
ansible.builtin.template:
src: templates/nginx/https.conf
dest: "{{ nginx_conf_dir }}/sites-available/{{ service_name }}.conf"
mode: 0644
tags:
- nginx
- config
- import_tasks: common/tasks/nginx/enable_site.yaml
vars:
config_file: "{{ service_name }}.conf"
- import_tasks: common/tasks/nginx/get_certificate.yaml
notify:
- test nginx