xoxys.droneci/tasks/nginx.yml

53 lines
1.8 KiB
YAML
Raw Normal View History

2018-12-13 22:09:22 +00:00
---
- block:
- name: Copy certs and private key to nginx proxy (content)
copy:
content: "{{ 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' }
2019-01-09 19:16:12 +00:00
- { src: "{{ droneci_tls_cert_source }}", dest: '/etc/pki/tls/certs/{{ droneci_tls_cert_path | basename }}', mode: '0750' }
2018-12-13 22:09:22 +00:00
loop_control:
label: "{{ item.dest }}"
when: droneci_tls_source_use_content
- name: Copy certs and private key to nginx proxy (files)
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 }}"
when: droneci_tls_source_use_files
delegate_to: "{{ droneci_nginx_server }}"
become: True
become_user: root
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