2026-SEP-09

This commit is contained in:
il
2026-09-09 23:13:28 +09:00
parent 9226043696
commit 99536c5355
34 changed files with 2779 additions and 37 deletions
@@ -0,0 +1,118 @@
---
- name: Create groupoffice directory
ansible.builtin.file:
path: "{{ node['home_path'] }}/{{ item }}"
state: "directory"
owner: "{{ services['groupoffice']['subuid'] }}"
group: "{{ node['group'] }}"
mode: "0770"
loop:
- "data/containers/groupoffice"
- "data/containers/groupoffice/data"
- "containers/groupoffice"
- "containers/groupoffice/ssl"
- "containers/groupoffice/config"
become: true
- name: Deploy root certificate
ansible.builtin.copy:
content: |
{{ hostvars['console']['ca']['root']['crt'] }}
dest: "{{ node['home_path'] }}/containers/groupoffice/ssl/{{ root_cert_filename }}"
owner: "{{ services['groupoffice']['subuid'] }}"
group: "{{ node['group'] }}"
mode: "0440"
become: true
notify: "notification_restart_groupoffice"
no_log: true
- name: Register secret value to podman secret
containers.podman.podman_secret:
name: "{{ item.name }}"
data: "{{ item.value }}"
state: "present"
force: true
loop:
- name: "GROUPOFFICE_DB_PASSWORD"
value: "{{ hostvars['console']['mariadb']['password']['groupoffice'] }}"
notify: "notification_restart_groupoffice"
no_log: true
- name: Deploy config files
ansible.builtin.template:
src: "{{ hostvars['console']['node']['config_path'] }}/services/containers/app/groupoffice/config/{{ item }}.j2"
dest: "{{ node['home_path'] }}/containers/groupoffice/config/{{ item }}"
owner: "{{ services['groupoffice']['subuid'] }}"
group: "{{ node['group'] }}"
mode: "0640"
loop:
- "config.php"
- "groupoffice-ca.ini"
- "Connection.php"
- "Authenticator.php"
- "configfile.php"
become: true
notify: "notification_restart_groupoffice"
- name: Pull image
containers.podman.podman_image:
name: "docker.io/intermesh/groupoffice"
tag: "{{ version['containers']['groupoffice'] }}"
state: "present"
pull: true
- name: Deploy groupoffice.container file
ansible.builtin.template:
src: "{{ hostvars['console']['node']['config_path'] }}/services/containers/app/groupoffice/groupoffice.container.j2"
dest: "{{ node['home_path'] }}/.config/containers/systemd/groupoffice.container"
owner: "{{ ansible_user }}"
group: "{{ node['group'] }}"
mode: "0644"
notify: "notification_restart_groupoffice"
- name: Deploy groupoffice-cron service
ansible.builtin.copy:
src: "{{ hostvars['console']['node']['config_path'] }}/services/containers/app/groupoffice/services/{{ item }}"
dest: "{{ node['home_path'] }}/.config/systemd/user/{{ item }}"
owner: "{{ ansible_user }}"
group: "{{ node['group'] }}"
mode: "0644"
loop:
- "groupoffice-cron.service"
- "groupoffice-cron.timer"
- name: Enable groupoffice.service
ansible.builtin.systemd:
name: "groupoffice.service"
state: "started"
enabled: true
daemon_reload: true
scope: "user"
- name: Enable groupoffice-cron.timer
ansible.builtin.systemd:
name: "groupoffice-cron.timer"
state: "started"
enabled: true
daemon_reload: true
scope: "user"
- name: Check container archive images
ansible.builtin.stat:
path: "{{ node['home_path'] }}/archives/containers/docker.io_intermesh_groupoffice_{{ version['containers']['groupoffice'] }}.tar"
register: container_archive_images
- name: Save container archive images
containers.podman.podman_save:
image:
- "docker.io/intermesh/groupoffice:{{ version['containers']['groupoffice'] }}"
dest: "{{ node['home_path'] }}/archives/containers/docker.io_intermesh_groupoffice_{{ version['containers']['groupoffice'] }}.tar"
format: "oci-archive"
force: false
when: not container_archive_images.stat.exists
- name: Fetch container archive images
ansible.builtin.fetch:
src: "{{ node['home_path'] }}/archives/containers/docker.io_intermesh_groupoffice_{{ version['containers']['groupoffice'] }}.tar"
dest: "{{ hostvars['console']['node']['data_path'] }}/images/containers/"
flat: true
@@ -43,14 +43,6 @@
scope: "user"
when: is_redis_conf.changed or is_redis_containerfile.changed # noqa: no-handler
- name: Add user in video, render group
ansible.builtin.user:
name: "{{ ansible_user }}"
state: "present"
groups: "video, render"
append: true
become: true
- name: Create immich directory
ansible.builtin.file:
path: "{{ node['home_path'] }}/{{ item }}"
@@ -0,0 +1,84 @@
---
- name: Create kaneo directory
ansible.builtin.file:
path: "{{ node['home_path'] }}/{{ item }}"
state: "directory"
owner: "{{ services['kaneo']['subuid'] }}"
group: "{{ node['group'] }}"
mode: "0770"
loop:
- "containers/kaneo"
- "containers/kaneo/ssl"
become: true
- name: Deploy root certificate
ansible.builtin.copy:
content: |
{{ hostvars['console']['ca']['root']['crt'] }}
dest: "{{ node['home_path'] }}/containers/kaneo/ssl/{{ root_cert_filename }}"
owner: "{{ services['kaneo']['subuid'] }}"
group: "{{ node['group'] }}"
mode: "0440"
become: true
notify: "notification_restart_kaneo"
no_log: true
- name: Register secret value to podman secret
containers.podman.podman_secret:
name: "{{ item.name }}"
data: "{{ item.value }}"
state: "present"
force: true
loop:
- name: "KANEO_AUTH_SECRET"
value: "{{ hostvars['console']['kaneo']['secret_key'] }}"
- name: "KANEO_DB_PASSWORD"
value: "{{ hostvars['console']['postgresql']['password']['kaneo'] }}"
- name: "KANEO_OIDC_CLIENT_SECRET"
value: "{{ hostvars['console']['kaneo']['oidc']['secret'] }}"
notify: "notification_restart_kaneo"
no_log: true
- name: Pull image
containers.podman.podman_image:
name: "ghcr.io/usekaneo/kaneo"
tag: "{{ version['containers']['kaneo'] }}"
state: "present"
pull: true
- name: Deploy kaneo.container file
ansible.builtin.template:
src: "{{ hostvars['console']['node']['config_path'] }}/services/containers/app/kaneo/kaneo.container.j2"
dest: "{{ node['home_path'] }}/.config/containers/systemd/kaneo.container"
owner: "{{ ansible_user }}"
group: "{{ node['group'] }}"
mode: "0644"
notify: "notification_restart_kaneo"
- name: Enable kaneo.service
ansible.builtin.systemd:
name: "kaneo.service"
state: "started"
enabled: true
daemon_reload: true
scope: "user"
- name: Check container archive images
ansible.builtin.stat:
path: "{{ node['home_path'] }}/archives/containers/ghcr.io_usekaneo_kane_{{ version['containers']['kaneo'] }}.tar"
register: container_archive_images
- name: Save container archive images
containers.podman.podman_save:
image:
- "ghcr.io/usekaneo/kaneo:{{ version['containers']['kaneo'] }}"
dest: "{{ node['home_path'] }}/archives/containers/ghcr.io_usekaneo_kane_{{ version['containers']['kaneo'] }}.tar"
format: "oci-archive"
force: false
when: not container_archive_images.stat.exists
- name: Fetch container archive images
ansible.builtin.fetch:
src: "{{ node['home_path'] }}/archives/containers/ghcr.io_usekaneo_kane_{{ version['containers']['kaneo'] }}.tar"
dest: "{{ hostvars['console']['node']['data_path'] }}/images/containers/"
flat: true
@@ -0,0 +1,90 @@
---
- name: Check model directory in data volume
ansible.builtin.find:
path: "{{ node['home_path'] }}/data/containers/llama/models"
file_type: "file"
patterns: "*.gguf"
hidden: true
recurse: true
register: llama_models
- name: Failure when models directory in data volume
ansible.builtin.fail:
msg: "There are no models in data directory, please ensure download some model files for llama.cpp"
when: llama_models.matched == 0
- name: Create llama directory
ansible.builtin.file:
path: "{{ node['home_path'] }}/{{ item }}"
state: "directory"
owner: "{{ ansible_user }}"
group: "{{ node['group'] }}"
mode: "0770"
loop:
- "containers/llama"
- "containers/llama/models"
- "containers/llama/config"
- name: Sync model data (--delete=true)
delegate_to: "{{ inventory_hostname }}"
ansible.posix.synchronize:
src: "{{ node['home_path'] }}/data/containers/llama/models/"
dest: "{{ node['home_path'] }}/containers/llama/models/"
owner: true
group: true
perms: true
delete: true
notify: "notification_restart_llama"
- name: Deploy configuration file
ansible.builtin.template:
src: "{{ hostvars['console']['node']['config_path'] }}/services/containers/app/llama/config/models.ini.j2"
dest: "{{ node['home_path'] }}/containers/llama/config/models.ini"
owner: "{{ ansible_user }}"
group: "{{ node['group'] }}"
mode: "0640"
notify: "notification_restart_llama"
- name: Pull image
containers.podman.podman_image:
name: "ghcr.io/ggml-org/llama.cpp"
tag: "{{ version['containers']['llama'] }}"
state: "present"
pull: true
- name: Deploy container file
ansible.builtin.template:
src: "{{ hostvars['console']['node']['config_path'] }}/services/containers/app/llama/llama.container.j2"
dest: "{{ node['home_path'] }}/.config/containers/systemd/llama.container"
owner: "{{ ansible_user }}"
group: "{{ node['group'] }}"
mode: "0644"
notify: "notification_restart_llama"
- name: Enable llama.service
ansible.builtin.systemd:
name: "llama.service"
state: "started"
enabled: true
daemon_reload: true
scope: "user"
- name: Check container archive images
ansible.builtin.stat:
path: "{{ node['home_path'] }}/archives/containers/ghcr.io_ggml-org_llama.cpp_{{ version['containers']['llama'] }}.tar"
register: container_archive_images
- name: Save container archive images
containers.podman.podman_save:
image:
- "ghcr.io/ggml-org/llama.cpp:{{ version['containers']['llama'] }}"
dest: "{{ node['home_path'] }}/archives/containers/ghcr.io_ggml-org_llama.cpp_{{ version['containers']['llama'] }}.tar"
format: "oci-archive"
force: false
when: not container_archive_images.stat.exists
- name: Fetch container archive images
ansible.builtin.fetch:
src: "{{ node['home_path'] }}/archives/containers/ghcr.io_ggml-org_llama.cpp_{{ version['containers']['llama'] }}.tar"
dest: "{{ hostvars['console']['node']['data_path'] }}/images/containers/"
flat: true
@@ -0,0 +1,84 @@
---
- name: Create openwebui directory
ansible.builtin.file:
path: "{{ node['home_path'] }}/{{ item }}"
state: "directory"
owner: "{{ ansible_user }}"
group: "{{ node['group'] }}"
mode: "0770"
loop:
- "data/containers/openwebui"
- "data/containers/openwebui/data"
- "containers/openwebui"
- "containers/openwebui/ssl"
- name: Deploy root certificate
ansible.builtin.copy:
content: |
{{ hostvars['console']['ca']['root']['crt'] }}
dest: "{{ node['home_path'] }}/containers/openwebui/ssl/{{ root_cert_filename }}"
owner: "{{ ansible_user }}"
group: "{{ node['group'] }}"
mode: "0440"
notify: "notification_restart_openwebui"
no_log: true
- name: Register secret value to podman secret
containers.podman.podman_secret:
name: "{{ item.name }}"
data: "{{ item.value }}"
state: "present"
force: true
loop:
- name: "OPEN_WEBUI_SECRET_KEY"
value: "{{ hostvars['console']['openwebui']['secret_key'] }}"
- name: "OPEN_WEBUI_POSTGRES_PASSWORD"
value: "{{ hostvars['console']['postgresql']['password']['openwebui'] }}"
- name: "OPEN_WEBUI_OAUTH_CLIENT_SECRET"
value: "{{ hostvars['console']['openwebui']['oidc']['secret'] }}"
notify: "notification_restart_openwebui"
no_log: true
- name: Pull image
containers.podman.podman_image:
name: "ghcr.io/open-webui/open-webui"
tag: "{{ version['containers']['openwebui'] }}"
state: "present"
pull: true
- name: Deploy container file
ansible.builtin.template:
src: "{{ hostvars['console']['node']['config_path'] }}/services/containers/app/openwebui/openwebui.container.j2"
dest: "{{ node['home_path'] }}/.config/containers/systemd/openwebui.container"
owner: "{{ ansible_user }}"
group: "{{ node['group'] }}"
mode: "0644"
notify: "notification_restart_openwebui"
- name: Enable openwebui.service
ansible.builtin.systemd:
name: "openwebui.service"
state: "started"
enabled: true
daemon_reload: true
scope: "user"
- name: Check container archive images
ansible.builtin.stat:
path: "{{ node['home_path'] }}/archives/containers/ghcr.io_open-webui_open-webui_{{ version['containers']['openwebui'] }}.tar"
register: container_archive_images
- name: Save container archive images
containers.podman.podman_save:
image:
- "ghcr.io/open-webui/open-webui:{{ version['containers']['openwebui'] }}"
dest: "{{ node['home_path'] }}/archives/containers/ghcr.io_open-webui_open-webui_{{ version['containers']['openwebui'] }}.tar"
format: "oci-archive"
force: false
when: not container_archive_images.stat.exists
- name: Fetch container archive images
ansible.builtin.fetch:
src: "{{ node['home_path'] }}/archives/containers/ghcr.io_open-webui_open-webui_{{ version['containers']['openwebui'] }}.tar"
dest: "{{ hostvars['console']['node']['data_path'] }}/images/containers/"
flat: true
@@ -0,0 +1,91 @@
---
- name: Check model directory in data volume
ansible.builtin.find:
path: "{{ node['home_path'] }}/data/containers/stablediffusion/models"
file_type: "file"
patterns:
- "*.gguf"
- "*.safetensors"
hidden: true
recurse: true
register: stablediffusion_models
- name: Failure when models directory in data volume
ansible.builtin.fail:
msg: "There are no models in data directory, please ensure download some model files for stable-diffusion.cpp"
when: stablediffusion_models.matched == 0
- name: Create stablediffusion directory
ansible.builtin.file:
path: "{{ node['home_path'] }}/{{ item }}"
state: "directory"
owner: "{{ ansible_user }}"
group: "{{ node['group'] }}"
mode: "0770"
loop:
- "containers/stablediffusion"
- "containers/stablediffusion/models"
- name: Sync model data (--delete=true)
delegate_to: "{{ inventory_hostname }}"
ansible.posix.synchronize:
src: "{{ node['home_path'] }}/data/containers/stablediffusion/models/"
dest: "{{ node['home_path'] }}/containers/stablediffusion/models/"
owner: true
group: true
perms: true
delete: true
notify: "notification_restart_stablediffusion"
- name: Set active model
ansible.builtin.set_fact:
stabeldiffusion_active_model: "{{ services['stablediffusion']['dependency']['models']['active'] }}"
- name: Pull image
containers.podman.podman_image:
name: "ghcr.io/leejet/stable-diffusion.cpp"
tag: "{{ version['containers']['stablediffusion'] }}"
state: "present"
pull: true
- name: Deploy container file
ansible.builtin.template:
src: "{{ hostvars['console']['node']['config_path'] }}/services/containers/app/stablediffusion/stablediffusion.container.j2"
dest: "{{ node['home_path'] }}/.config/containers/systemd/stablediffusion.container"
owner: "{{ ansible_user }}"
group: "{{ node['group'] }}"
mode: "0644"
notify: "notification_restart_stablediffusion"
- name: Enable stablediffusion.service
ansible.builtin.systemd:
name: "stablediffusion.service"
state: "started"
enabled: true
daemon_reload: true
scope: "user"
- name: Set stable-diffusion archive version
ansible.builtin.set_fact:
stablediffusion_archive_version: >-
{{ version['containers']['stablediffusion'].split('@sha256:')[0] }}@{{ version['containers']['stablediffusion'].split('@sha256:')[1][0:7] }}
- name: Check container archive images
ansible.builtin.stat:
path: "{{ node['home_path'] }}/archives/containers/ghcr.io_leejet_stable-diffusion.cpp_{{ stablediffusion_archive_version }}.tar"
register: container_archive_images
- name: Save container archive images
containers.podman.podman_save:
image:
- "ghcr.io/leejet/stable-diffusion.cpp:{{ version['containers']['stablediffusion'] }}"
dest: "{{ node['home_path'] }}/archives/containers/ghcr.io_leejet_stable-diffusion.cpp_{{ stablediffusion_archive_version }}.tar"
format: "oci-archive"
force: false
when: not container_archive_images.stat.exists
- name: Fetch container archive images
ansible.builtin.fetch:
src: "{{ node['home_path'] }}/archives/containers/ghcr.io_leejet_stable-diffusion.cpp_{{ stablediffusion_archive_version }}.tar"
dest: "{{ hostvars['console']['node']['data_path'] }}/images/containers/"
flat: true