public-health-ch/ansible/web.yaml

29 lines
775 B
YAML
Raw Normal View History

2020-05-16 13:12:07 +00:00
---
- name: Deploy web server (NGINX) configuration
hosts: webservers
2020-05-15 22:14:14 +00:00
become: true
gather_facts: true
2020-05-16 13:12:07 +00:00
tasks:
- name: Copy certificate public key
tags: nginx_template_config
copy:
src: cloudflare.pem
dest: "/etc/ssl/certs/cloudflare.pem"
- name: Copy certificate private key
tags: nginx_template_config
copy:
src: cloudflare.key
dest: "/etc/ssl/certs/cloudflare.key"
2020-05-15 22:14:14 +00:00
roles:
- role: nginxinc.nginx
vars:
2020-05-16 13:12:07 +00:00
release_dir: /opt/publichealth
2020-05-15 22:14:14 +00:00
ipv4_addresses: "{{ ansible_all_ipv4_addresses }}"
nginx_http_template_enable: true
nginx_http_template:
default:
2020-05-16 13:12:07 +00:00
template_file: web/nginx.conf.j2
2020-05-15 22:14:14 +00:00
conf_file_name: default.conf
conf_file_location: /etc/nginx/conf.d/