configure nginx via nginx_config variable

This commit is contained in:
Mauro Torrez 2019-10-02 09:36:15 -03:00
parent 8354403c41
commit 8297d853e9

View File

@ -28,6 +28,7 @@
login_port: "{{ mariadb_port }}" login_port: "{{ mariadb_port }}"
login_user: root login_user: root
login_password: "{{ mariadb_root_password }}" login_password: "{{ mariadb_root_password }}"
when: roundcube_db_engine in ('mariadb','mysql')
- name: create nextcloud db user - name: create nextcloud db user
mysql_user: mysql_user:
@ -40,6 +41,7 @@
login_port: "{{ mariadb_port }}" login_port: "{{ mariadb_port }}"
login_user: root login_user: root
login_password: "{{ mariadb_root_password }}" login_password: "{{ mariadb_root_password }}"
when: roundcube_db_engine in ('mariadb','mysql')
- name: start nextcloud container - name: start nextcloud container
docker_container: docker_container:
@ -82,27 +84,21 @@
MAIL_FROM_ADDRESS: "{{ nextcloud_mail_from_address }}" MAIL_FROM_ADDRESS: "{{ nextcloud_mail_from_address }}"
MAIL_DOMAIN: "{{ nextcloud_mail_domain }}" MAIL_DOMAIN: "{{ nextcloud_mail_domain }}"
networks: networks:
- name: "{{ docker_network_name }}" - name: "{{ docker_network }}"
ports: ports:
- name: template nginx config - name: export nginx config
copy: set_fact:
content: | nginx_config: >-
{{ nginx_config | default({}) | combine({
location {{ nextcloud_web_root }} { nextcloud_domain: {
proxy_set_header Host $host; "locations": {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; nextcloud_web_root.rstrip('/')+'/': {
proxy_set_header X-Forwarded-Proto $scheme; "proxy_pass": "http://{}:9000/".format(nextcloud_container)
proxy_pass http://{{ nextcloud_container }}:9000; }
} }
dest: "{{ nginx_mountpoint_location }}/nextcloud.conf" }
register: ngconf }) }}
- name: restart frontend
docker_container:
name: "{{ nginx_container }}"
restart: yes
when: ngconf is changed
- name: inspect nextcloud volume - name: inspect nextcloud volume
docker_volume_info: docker_volume_info: