nextcloud/roles/nginx_fpm_proxy/tasks/main.yml

38 lines
1.4 KiB
YAML
Raw Normal View History

---
- name: Create directory for nginx config
ansible.builtin.file:
path: "{{ nextcloud_nginx_basepath }}"
state: directory
mode: 0750
- name: Template nginx reverse proxy config for nextcloud
ansible.builtin.template:
src: nextcloud-nginx.conf.j2
dest: "{{ nextcloud_nginx_config }}"
vars:
fpm_server: "{{ nextcloud_nginx_fpm_server_ip }}"
fpm_server_port: "{{ nextcloud_nginx_fpm_server_port }}"
fpm_socket: "{{ nextcloud_nginx_fpm_socket_path }}"
domain: "{{ nextcloud_nginx_servernames }}"
notify: restart-nextcloud-nginx
- name: Ensure nginx docker image is pulled
community.general.docker_image:
name: "{{ nextcloud_nginx_container_image_ref }}"
state: present
source: pull
force_source: "{{ nextcloud_nginx_container_image_force_pull }}"
- name: Ensure nginx is running for FPM and static file serving
community.docker.docker_container:
env: "{{ nextcloud_nginx_container_env }}"
name: "{{ nextcloud_nginx_container_name }}"
image: "{{ nextcloud_nginx_container_image_ref }}"
ports: "{{ nextcloud_nginx_container_ports | default(omit, true) }}"
volumes: "{{ nextcloud_nginx_container_volumes }}"
labels: "{{ nextcloud_nginx_container_labels | default(omit, true) }}"
networks: "{{ nextcloud_nginx_container_networks | default(omit, true) }}"
restart_policy: "{{ nextcloud_nginx_container_restart_policy }}"
state: started