Finish nextcloud role.

This commit is contained in:
yohan 2024-03-23 11:43:51 +01:00
parent d55a9f85b7
commit 44d81b3bc2
4 changed files with 69 additions and 8 deletions

6
TODO
View File

@ -1,8 +1,4 @@
create Nextcloud deployment
==>
- We need to build the image
- we need to retrieve configuration files from secrets and put them in the mount directory
test Nextcloud deployment
Do not restore from backup when container already exists
make sure containers start on reboot

View File

@ -0,0 +1,19 @@
#!/bin/bash
STATEFILE=/var/www/html/.skip_elasticsearch_indexing
pgrep -af fulltextsearch | grep -qv grep
if [ $? -ne 0 ]
then
if ! test -f $STATEFILE
then
su -c "php /var/www/html/occ fulltextsearch:index -q" -s "/bin/bash" www-data
touch $STATEFILE
fi
nohup su -c "php /var/www/html/occ fulltextsearch:live -q" -s "/bin/bash" www-data &>/dev/null &
fi
trap "{ echo EXITING; pkill -f -SIGTERM 'fulltextsearch'; }" SIGKILL SIGTERM
while pgrep -af fulltextsearch | grep -qv grep:
do
sleep 1 # This script is not really doing anything.
done

View File

@ -0,0 +1,29 @@
[supervisord]
nodaemon=true
logfile=/var/log/supervisord/supervisord.log
pidfile=/var/run/supervisord/supervisord.pid
childlogdir=/var/log/supervisord/
logfile_maxbytes=50MB ; maximum size of logfile before rotation
logfile_backups=10 ; number of backed up logfiles
loglevel=error
[program:apache2]
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
command=apache2-foreground
[program:cron]
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
command=/cron.sh
[program:run_elasticsearch]
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
command=/run_elasticsearch.sh

View File

@ -46,18 +46,35 @@
with_items:
- nextcloud
- name: Create /usr/local/docker-mounted-files/docker-nextcloud-stack directory
ansible.builtin.file:
path: "/usr/local/docker-mounted-files/docker-nextcloud-stack"
state: directory
mode: '0755'
become: true
- name: Deploy custom files
ansible.builtin.copy:
src: "{{ item }}"
dest: "/usr/local/docker-mounted-files/docker-nextcloud-stack/{{ item }}"
register: custom_conf_register
become: true
with_items:
- supervisord.conf
- run_elasticsearch.sh
- name: Create nextcloud container
containers.podman.podman_container:
name: nextcloud-full
image: docker.io/nextcloud:18.0.3
image: registry.scimetis.net/nextcloud:19.0.13-apache-full
network:
- reverse-proxy
- mysqlnet
- mailnet
volume:
- /mnt/volumes/nextcloud/data:/var/www/html:Z
- ./supervisord.conf:/supervisord.conf
- ./run_elasticsearch.sh:/run_elasticsearch.sh
- /usr/local/docker-mounted-files/docker-nextcloud-stack/supervisord.conf:/supervisord.conf:z
- /usr/local/docker-mounted-files/docker-nextcloud-stack/run_elasticsearch.sh:/run_elasticsearch.sh:z
become: true
- name: Add cloud.{{ DOMAIN }} to /etc/hosts