54 lines
1.8 KiB
YAML
54 lines
1.8 KiB
YAML
- name: Container tasks
|
|
block:
|
|
- name: Pod State created
|
|
containers.podman.podman_pod:
|
|
name: "pod_nextcloud"
|
|
state: created
|
|
share: ipc,uts
|
|
hostname: "{{ ansible_host }}"
|
|
restart_policy: always
|
|
|
|
- name: nextcloud Container State created
|
|
containers.podman.podman_container:
|
|
name: "nextcloud_app_1"
|
|
state: created
|
|
pod: "pod_nextcloud"
|
|
image: "docker.io/nextcloud/nextcloud:stable-fpm"
|
|
network: bridge
|
|
ports:
|
|
- 9000:9000
|
|
volumes:
|
|
- "/home/{{ user.name }}/nextcloud/data:/home/step"
|
|
env:
|
|
VIRTUAL_HOST_MULTIPORTS: "{{ lookup('ansible.builtin.template','nextcloud_multiports.json.j2')}}"
|
|
VIRTUAL_PROTO: "https"
|
|
|
|
- name: NGINX Proxy Container State created
|
|
containers.podman.podman_container:
|
|
name: "nextcloud_nginx-proxy_1"
|
|
state: created
|
|
pod: "pod_nextcloud"
|
|
image: "docker.io/nginxproxy/nginx-proxy:latest"
|
|
network: bridge
|
|
ports:
|
|
- 8080:80
|
|
- 4443:443
|
|
volumes:
|
|
- "/home/{{ user.name }}/nginx/html:/usr/share/nginx/html"
|
|
- "/home/{{ user.name }}/nginx/nextcloud_internal_vhost:/etc/nginx/vhost.d/{{ ansible_host }}_location"
|
|
- "/home/{{ user.name }}/nginx/certs:/etc/nginx/certs"
|
|
- "/run/user/{{ getent_passwd[user.name][2] }}/podman/podman.sock:/tmp/docker.sock:ro"
|
|
|
|
- name: Container State started
|
|
containers.podman.podman_container:
|
|
name: "{{ container_to_start }}"
|
|
state: started
|
|
pod: "pod_nextcloud"
|
|
with_items:
|
|
- "nextcloud_app_1"
|
|
- "nextcloud_nginx-proxy_1"
|
|
tags:
|
|
- init
|
|
loop_control:
|
|
loop_var: "container_to_start"
|