netter nging location definition
This commit is contained in:
parent
a9ff4f484b
commit
5d36d9edc5
@ -1,7 +1,7 @@
|
||||
---
|
||||
# domain, webroot
|
||||
roundcube_domain: example.com
|
||||
roundcube_web_root: /
|
||||
roundcube_domain: default
|
||||
roundcube_web_root: /roundcube
|
||||
|
||||
# container
|
||||
roundcube_image: roundcube/roundcubemail
|
||||
|
@ -29,7 +29,7 @@
|
||||
login_user: root
|
||||
login_password: "{{ mariadb_root_password }}"
|
||||
when: roundcube_db_type in ('mariadb','mysql')
|
||||
|
||||
|
||||
- name: create roundcube db user
|
||||
mysql_user:
|
||||
state: present
|
||||
@ -66,23 +66,28 @@
|
||||
- name: "{{ docker_network_name }}"
|
||||
ports:
|
||||
|
||||
- name: template nginx config
|
||||
copy:
|
||||
content: |
|
||||
location {{ roundcube_web_root }} {
|
||||
- name: template nginx domain config
|
||||
when: roundcube_domain != 'default'
|
||||
include_role:
|
||||
name: nginx-docker
|
||||
tasks_from: domain.yml
|
||||
vars:
|
||||
ng_domain_name: "{{ roundcube_domain }}"
|
||||
|
||||
- name: template nginx location config
|
||||
include_role:
|
||||
name: nginx-docker
|
||||
tasks_from: location.yml
|
||||
vars:
|
||||
ng_domain_name: "{{ roundcube_domain }}"
|
||||
ng_location_name: "{{ roundcube_web_root }}"
|
||||
ng_location_content: |
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_pass http://{{ roundcube_container }};
|
||||
}
|
||||
dest: "{{ nginx_location_mountpoint }}/roundcube.conf"
|
||||
register: ngconf
|
||||
|
||||
- name: restart frontend
|
||||
docker_container:
|
||||
name: "{{ nginx_container_name }}"
|
||||
restart: yes
|
||||
when: ngconf is changed
|
||||
- meta: run_handlers
|
||||
|
||||
- name: inspect roundcube volume
|
||||
docker_volume_info:
|
||||
|
Loading…
x
Reference in New Issue
Block a user