84 lines
2 KiB
YAML
84 lines
2 KiB
YAML
---
|
|
- name: Create volumes
|
|
containers.podman.podman_volume:
|
|
name: "{{ item }}"
|
|
state: present
|
|
recreate: false
|
|
loop:
|
|
- nextcloud_database
|
|
- nextcloud_storage
|
|
|
|
- name: Copy nginx configuration
|
|
ansible.builtin.copy:
|
|
src: cloud.conf
|
|
dest: "{{ ansible_user_dir }}/nextcloud_nginx.conf"
|
|
mode: u=rw,g=r,o=r
|
|
seuser: system_u
|
|
serole: object_r
|
|
setype: container_file_t
|
|
|
|
- name: Create network
|
|
containers.podman.podman_network:
|
|
name: webnet
|
|
state: present
|
|
recreate: false
|
|
disable_dns: true
|
|
|
|
- name: Create pod
|
|
containers.podman.podman_pod:
|
|
name: nextcloud
|
|
state: started
|
|
network: webnet
|
|
recreate: false
|
|
publish:
|
|
- 8080:80
|
|
|
|
|
|
- name: Create database container
|
|
containers.podman.podman_container:
|
|
name: nextcloud-db
|
|
state: started
|
|
image: docker.io/library/mariadb:latest
|
|
pod: nextcloud
|
|
recreate: false
|
|
volumes:
|
|
- "nextcloud_database:/var/lib/mysql:Z"
|
|
env:
|
|
MYSQL_ROOT_PASSWORD: "{{ nc_db_root_secret }}"
|
|
MYSQL_DATABASE: ncdb
|
|
MYSQL_USER: nextcloud
|
|
MYSQL_PASSWORD: "{{ nc_db_secret }}"
|
|
command:
|
|
- '--skip-innodb-read-only-compressed'
|
|
- '--character-set-server=utf8mb4'
|
|
- '--collation-server=utf8mb4_unicode_ci'
|
|
|
|
- name: Create FPM container
|
|
containers.podman.podman_container:
|
|
name: nextcloud-php
|
|
state: started
|
|
image: docker.io/library/nextcloud:fpm
|
|
pod: nextcloud
|
|
recreate: false
|
|
volumes:
|
|
- "nextcloud_storage:/var/www/html:Z"
|
|
env:
|
|
MYSQL_DATABASE: ncdb
|
|
MYSQL_USER: nextcloud
|
|
MYSQL_PASSWORD: "{{ nc_db_secret }}"
|
|
MYSQL_HOST: nextcloud-db
|
|
|
|
- name: Create webserver container
|
|
containers.podman.podman_container:
|
|
name: nextcloud-web
|
|
state: started
|
|
image: docker.io/library/nginx:latest
|
|
pod: nextcloud
|
|
recreate: false
|
|
volumes:
|
|
- "{{ ansible_user_dir }}/nextcloud_nginx.conf:/etc/nginx/nginx.conf:Z"
|
|
volumes_from:
|
|
- nextcloud-php
|
|
env:
|
|
VIRTUAL_HOST: "{{ nextcloud_domain }}"
|