2018-12-13 22:09:22 +00:00
|
|
|
---
|
|
|
|
- block:
|
2019-06-11 08:06:02 +00:00
|
|
|
- name: Copy certs and private key to nginx proxy
|
2018-12-13 22:09:22 +00:00
|
|
|
copy:
|
|
|
|
src: "{{ item.src }}"
|
|
|
|
dest: "{{ item.dest }}"
|
|
|
|
mode: "{{ item.mode }}"
|
|
|
|
with_items:
|
|
|
|
- { src: "{{ droneci_tls_key_source }}", dest: '/etc/pki/tls/private/{{ droneci_tls_key_path | basename }}', mode: '0600' }
|
|
|
|
- { src: "{{ droneci_tls_cert_source }}", dest: '/etc/pki/tls/certs/{{ droneci_tls_cert_path | basename }}', mode: '0750' }
|
|
|
|
loop_control:
|
|
|
|
label: "{{ item.dest }}"
|
|
|
|
delegate_to: "{{ droneci_nginx_server }}"
|
|
|
|
become: True
|
|
|
|
become_user: root
|
2019-06-11 08:06:02 +00:00
|
|
|
when: droneci_nginx_tls_enabled | bool
|
2018-12-13 22:09:22 +00:00
|
|
|
tags: tls_renewal
|
|
|
|
|
|
|
|
- block:
|
|
|
|
- name: Add vhost configuration file
|
|
|
|
template:
|
|
|
|
src: nginx/vhost.j2
|
|
|
|
dest: "{{ droneci_nginx_vhost_dir }}/droneci"
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0640
|
|
|
|
notify: __nginx_reload
|
|
|
|
|
|
|
|
- name: Enable droneci vhost
|
|
|
|
file:
|
|
|
|
src: "{{ droneci_nginx_vhost_dir }}/droneci"
|
|
|
|
dest: "{{ droneci_nginx_vhost_symlink }}/droneci"
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
state: link
|
|
|
|
notify: __nginx_reload
|
|
|
|
when: droneci_nginx_vhost_symlink is defined
|
|
|
|
delegate_to: "{{ droneci_nginx_server }}"
|
|
|
|
become: True
|
|
|
|
become_user: root
|