chef-recipes/containers/collabora/tasks.yml

108 lines
3.3 KiB
YAML
Raw Normal View History

2023-02-07 16:28:46 +00:00
# code: language=ansible
---
- hosts: all
name: Collabora CODE container
tasks:
- name: Stop running containers
become_user: containers
become: true
ansible.builtin.systemd:
scope: user
name: container-{{ item }}.service
state: stopped
loop:
- collabora
2023-08-01 08:59:37 +00:00
failed_when: false
2023-02-07 16:28:46 +00:00
# - name: Create podman volumes
# containers.podman.podman_volume:
# state: present
# name: "{{ item }}"
# become_user: containers
# become: true
# loop:
# - collabora-config
- name: Create podman networks
containers.podman.podman_network:
name: "{{ item }}"
recreate: false
state: "present"
become_user: containers
become: true
loop:
- traefik-collabora
- nextcloud-collabora
- name: Pull container images
become_user: containers
become: true
containers.podman.podman_image:
name: docker.io/{{ item }}
loop:
- collabora/code:latest
- name: Add a collabora container
become_user: containers
become: true
containers.podman.podman_container:
name: collabora
image: docker.io/collabora/code:latest
state: present
network:
- traefik-collabora
- nextcloud-collabora
# volume:
# - collabora-config:/etc/coolwsd:Z
label:
io.containers.autoupdate: "registry"
traefik.enable: "true"
traefik.http.routers.collabora.entrypoints: "https"
traefik.http.routers.collabora.rule: "Host(`{{ vault_domain }}`) && (PathPrefix(`/collabora`) || Path(`/browser`))"
2023-02-07 16:28:46 +00:00
traefik.http.routers.collabora.tls: "true"
traefik.http.routers.collabora.tls.certresolver: "wildcard"
traefik.http.routers.collabora.service: "collabora"
traefik.http.services.collabora.loadbalancer.server.port: "9980"
traefik.docker.network: "traefik-collabora"
env:
2023-02-08 09:44:40 +00:00
domain: "chef\\.heaplab\\.deib\\.polimi\\.it"
aliasgroup1: "chef\\.heaplab\\.deib\\.polimi\\.it"
server_name: "chef.heaplab.deib.polimi.it"
2023-02-07 16:28:46 +00:00
username: "{{ vault_collabora_user }}"
password: "{{ vault_collabora_password }}"
extra_params: "--o:ssl.enable=false --o:ssl.termination=true --o:net.service_root=/collabora --o:net.server_name=chef.heaplab.deib.polimi.it/collabora"
2023-02-07 16:28:46 +00:00
generate_systemd:
path: /home/containers/.config/systemd/user/
restart_policy: on-failure
2024-04-12 12:06:57 +00:00
requires: [container-nextcloud.service, container-traefik.service]
2023-02-07 16:28:46 +00:00
names: true
new: true
2023-04-20 15:14:24 +00:00
- name: Change start and stop timeout limits
become_user: containers
become: true
community.general.ini_file:
path: /home/containers/.config/systemd/user/container-collabora.service
section: Service
option: "{{ item }}"
value: 3600
mode: "0664"
state: "present"
no_extra_spaces: true
loop:
- TimeoutStartSec
- TimeoutStopSec
2023-02-07 16:28:46 +00:00
- name: Start containers at boot
become_user: containers
become: true
ansible.builtin.systemd:
scope: user
name: container-{{ item }}.service
enabled: true
state: started
daemon_reload: true
loop:
- collabora