Initialise repository structure and placeholder files. Generic functionality works i guess, need to come up with a better solution for compose templates

This commit is contained in:
boris committed 2026-07-08 10:29:51 +01:00
commit 53695f4fff
411 files changed
+7817

No files matched your search

+7
View File
@@ -0,0 +1,7 @@
# ocis
Deploys ownCloud Infinite Scale using Docker Compose with externalized config
and data directories.
Tags: `ocis`, `config`, `compose`, `firewall`.
+20
View File
@@ -0,0 +1,20 @@
---
ocis_dir: /srv/docker/ocis
ocis_image: owncloud/ocis:latest
ocis_http_port: 9200
ocis_url: https://ocis.example.invalid
ocis_domain: "{{ ocis_url | regex_replace('^https?://', '') | regex_replace('/.*$', '') }}"
ocis_routing_mode: "{{ nbops_service_routing_mode }}"
ocis_traefik_network: "{{ nbops_proxy_network }}"
ocis_traefik_entrypoint: "{{ nbops_traefik_entrypoint }}"
ocis_traefik_tls: "{{ nbops_traefik_tls }}"
ocis_config_dir: /srv/config/ocis
ocis_data_dir: /srv/data/ocis
ocis_insecure: "false"
ocis_admin_password: "{{ vault_ocis_admin_password | default('CHANGE_ME_IN_VAULT') }}"
ocis_env:
OCIS_URL: "{{ ocis_url }}"
OCIS_INSECURE: "{{ ocis_insecure }}"
IDM_ADMIN_PASSWORD: "{{ ocis_admin_password }}"
ocis_tcp_ports:
- "{{ ocis_http_port }}"
+1
View File
@@ -0,0 +1 @@
+6
View File
@@ -0,0 +1,6 @@
---
- name: restart ocis
community.docker.docker_compose_v2:
project_src: "{{ ocis_dir }}"
state: restarted
+55
View File
@@ -0,0 +1,55 @@
---
- name: Create oCIS directories
ansible.builtin.file:
path: "{{ item }}"
state: directory
owner: root
group: root
mode: "0755"
loop:
- "{{ ocis_dir }}"
- "{{ ocis_config_dir }}"
- "{{ ocis_data_dir }}"
tags: [ocis]
- name: Render oCIS environment
ansible.builtin.template:
src: env.j2
dest: "{{ ocis_dir }}/.env"
owner: root
group: root
mode: "0600"
no_log: true
tags: [ocis, config]
- name: Ensure oCIS proxy network exists
community.docker.docker_network:
name: "{{ ocis_traefik_network }}"
state: present
when: ocis_routing_mode == "traefik"
tags: [ocis, docker]
- name: Render oCIS Compose file
ansible.builtin.template:
src: compose.yaml.j2
dest: "{{ ocis_dir }}/compose.yaml"
owner: root
group: root
mode: "0644"
notify: restart ocis
tags: [ocis, compose]
- name: Allow oCIS ports
community.general.ufw:
rule: allow
port: "{{ item }}"
proto: tcp
loop: "{{ ocis_tcp_ports }}"
when: ocis_routing_mode == "host"
tags: [ocis, firewall]
- name: Start oCIS
community.docker.docker_compose_v2:
project_src: "{{ ocis_dir }}"
state: present
tags: [ocis, compose]
+29
View File
@@ -0,0 +1,29 @@
services:
ocis:
image: {{ ocis_image }}
restart: unless-stopped
command: server
env_file: .env
{% if ocis_routing_mode == "host" %}
ports:
- "{{ ocis_http_port }}:9200"
{% endif %}
{% if ocis_routing_mode == "traefik" %}
# internal HTTP service port: 9200; not published on the Docker host
labels:
- traefik.enable=true
- traefik.http.routers.ocis.rule=Host(`{{ ocis_domain }}`)
- traefik.http.routers.ocis.entrypoints={{ ocis_traefik_entrypoint }}
- traefik.http.routers.ocis.tls={{ ocis_traefik_tls | bool | ternary('true', 'false') }}
- traefik.http.services.ocis.loadbalancer.server.port=9200
networks:
- {{ ocis_traefik_network }}
{% endif %}
volumes:
- {{ ocis_config_dir }}:/etc/ocis
- {{ ocis_data_dir }}:/var/lib/ocis
{% if ocis_routing_mode == "traefik" %}
networks:
{{ ocis_traefik_network }}:
external: true
{% endif %}
+4
View File
@@ -0,0 +1,4 @@
{% for key, value in ocis_env.items() %}
{{ key }}={{ value }}
{% endfor %}