Update 6 files

- /roles/bookstack/tasks/main.yml
- /roles/bookstack/templates/docker-compose.yml.j2
- /roles/mealie/tasks/main.yml
- /roles/mealie/templates/docker-compose.yml.j2
- /group_vars/all.yml
- /olimp-deploy.yml
This commit is contained in:
Administrator 2025-10-15 12:17:14 +00:00
parent 91795e141b
commit c1dbec2708
6 changed files with 165 additions and 4 deletions

View File

@ -37,4 +37,16 @@ npm_letsencrypt_dir: "/opt/npm/letsencrypt"
heimdall_base_dir: "/opt/heimdall" heimdall_base_dir: "/opt/heimdall"
heimdall_config_dir: "/opt/heimdall/config" heimdall_config_dir: "/opt/heimdall/config"
heimdall_port: "45131" heimdall_port: "45131"
# Bookstack variables
bookstack_base_dir: "/mnt/bookstack"
bookstack_config_dir: "/mnt/bookstack/config"
bookstack_uploads_dir: "/mnt/bookstack/uploads"
bookstack_db_dir: "/mnt/bookstack/db"
bookstack_port: "45131"
# Mealie variables
mealie_base_dir: "/mnt/mealie"
mealie_data_dir: "/mnt/mealie/data"
mealie_port: "45132"

View File

@ -8,6 +8,12 @@
- hosts: gateway - hosts: gateway
roles: roles:
- { role: docker, tags: [deploy_docker] } - { role: docker, tags: deploy_docker }
- { role: npm, tags: [deploy_npm] } - { role: npm, tags: deploy_npm }
- { role: heimdall, tags: [deploy_heimdall] } - { role: heimdall, tags: deploy_heimdall }
- hosts: data
roles:
- { role: docker, tags: deploy_docker }
- { role: mealie, tags: deploy_mealie }
- { role: bookstack, tags: deploy_bookstack }

View File

@ -0,0 +1,48 @@
---
- name: Create Bookstack directory structure
file:
path: "{{ item }}"
state: directory
mode: 0755
loop:
- "{{ bookstack_base_dir }}"
- "{{ bookstack_config_dir }}"
- "{{ bookstack_uploads_dir }}"
- "{{ bookstack_db_dir }}"
when: not item.stat.exists
- name: Check if Bookstack directories exist
assert:
that:
- item.stat.exists
fail_msg: "Directory {{ item.path }} does not exist. Please create it manually."
loop:
- { path: "{{ bookstack_config_dir }}" }
- { path: "{{ bookstack_uploads_dir }}" }
- { path: "{{ bookstack_db_dir }}" }
- name: Deploy Bookstack docker-compose.yml
template:
src: docker-compose.yml.j2
dest: "{{ bookstack_base_dir }}/docker-compose.yml"
mode: 0644
- name: Start Bookstack services
shell: |
cd {{ bookstack_base_dir }}
docker compose up -d
args:
executable: /bin/bash
- name: Wait for services to start
pause:
seconds: 15
- name: Check Bookstack container status
shell: docker ps --filter name=bookstack-mnemo
register: bookstack_status
changed_when: false
- name: Show Bookstack status
debug:
var: bookstack_status.stdout

View File

@ -0,0 +1,36 @@
version: "3"
services:
bookstack:
image: lscr.io/linuxserver/bookstack:latest
container_name: bookstack-mnemo
environment:
- PUID=1000
- PGID=1000
- APP_KEY=base64:eI791ap0I3AbP0Y8Q5Tn4sTZxTUOdWLid2r6pBjfXus=
- APP_URL=https://mnemo.zailon.ru
- DB_HOST=bookstack_db
- DB_USERNAME=bookstack
- DB_PASSWORD=12qwaszx
- DB_DATABASE=bookstackapp
volumes:
- {{ bookstack_config_dir }}:/config
- {{ bookstack_uploads_dir }}:/data
ports:
- "{{ bookstack_port }}:80"
restart: unless-stopped
depends_on:
- bookstack_db
bookstack_db:
image: lscr.io/linuxserver/mariadb:latest
container_name: bookstack-mnemo-db
environment:
- PUID=1000
- PGID=1000
- MYSQL_ROOT_PASSWORD=13qeadZC
- MYSQL_DATABASE=bookstackapp
- MYSQL_USER=bookstack
- MYSQL_PASSWORD=12qwaszx
volumes:
- {{ bookstack_db_dir }}:/config
restart: unless-stopped

View File

@ -0,0 +1,44 @@
---
- name: Create Mealie directory structure
file:
path: "{{ item }}"
state: directory
mode: 0755
loop:
- "{{ mealie_base_dir }}"
- "{{ mealie_data_dir }}"
when: not item.stat.exists
- name: Check if Mealie data directory exists
assert:
that:
- item.stat.exists
fail_msg: "Directory {{ item.path }} does not exist. Please create it manually."
loop:
- { path: "{{ mealie_data_dir }}" }
- name: Deploy Mealie docker-compose.yml
template:
src: docker-compose.yml.j2
dest: "{{ mealie_base_dir }}/docker-compose.yml"
mode: 0644
- name: Start Mealie container
shell: |
cd {{ mealie_base_dir }}
docker compose up -d
args:
executable: /bin/bash
- name: Wait for Mealie to start
pause:
seconds: 15
- name: Check Mealie container status
shell: docker ps --filter name=mealie
register: mealie_status
changed_when: false
- name: Show Mealie status
debug:
var: mealie_status.stdout

View File

@ -0,0 +1,15 @@
version: '3.8'
services:
mealie:
image: hkotel/mealie:latest
container_name: mealie
restart: unless-stopped
ports:
- "{{ mealie_port }}:80"
volumes:
- {{ mealie_data_dir }}:/app/data
environment:
- PUID=1000
- PGID=1000
- TZ={{ timezone }}
- ALLOW_SIGNUP=true