aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain Gonçalves <me@rgoncalves.se>2024-07-01 13:41:46 +0200
committerRomain Gonçalves <me@rgoncalves.se>2024-07-01 13:41:46 +0200
commit21d259bbf44138ea37d66719e26c290de59cbbef (patch)
treeaf46d5bd2779b04974e3276adb48f3c7fb6e72ab
parentcd9298a427aa7f17734d0ffd732d5e1ec2815231 (diff)
downloadrules-21d259bbf44138ea37d66719e26c290de59cbbef.tar.gz
refactor(roles/nextcloud): move dependencies in subtask
-rw-r--r--host_vars/local-hvisor-01.yml1
-rw-r--r--roles/nextcloud/defaults/main.yml6
-rw-r--r--roles/nextcloud/tasks/dependencies.yml36
-rw-r--r--roles/nextcloud/tasks/main.yml22
4 files changed, 46 insertions, 19 deletions
diff --git a/host_vars/local-hvisor-01.yml b/host_vars/local-hvisor-01.yml
index 6fd9797..044fa70 100644
--- a/host_vars/local-hvisor-01.yml
+++ b/host_vars/local-hvisor-01.yml
@@ -6,6 +6,7 @@ sshd__listen_port: "{{ ansible_port }}"
nextcloud__listen_port: 8003
nextcloud__domain_name: cloud.rgoncalves.se
+nextcloud__php_memory_limit: 8192M
__ip:
external: 192.168.1.128
diff --git a/roles/nextcloud/defaults/main.yml b/roles/nextcloud/defaults/main.yml
index 4c10ab5..c920a55 100644
--- a/roles/nextcloud/defaults/main.yml
+++ b/roles/nextcloud/defaults/main.yml
@@ -32,6 +32,8 @@ nextcloud__php_service_name: php82_fpm
nextcloud__php_configuration_file: /etc/php-8.2.ini
nextcloud__php_fpm_configuration_file: /etc/php-fpm.ini
+nextcloud__perl_libdata_dir: /usr/libdata/perl5
+
nextcloud__occ_system_settings:
- option: trusted_domains
value: "1 --value={{ nextcloud__domain_name }}"
@@ -53,6 +55,8 @@ nextcloud__php_fpm_settings:
option: clear_env
value: 0
+nextcloud__php_memory_limit: 1024M
+
nextcloud__php_settings:
# PHP
- section: PHP
@@ -66,7 +70,7 @@ nextcloud__php_settings:
value: 1
- section: PHP
option: memory_limit
- value: 8192M
+ value: "{{ nextcloud__php_memory_limit }}"
- section: PHP
option: zend_extension
value: opcache.so
diff --git a/roles/nextcloud/tasks/dependencies.yml b/roles/nextcloud/tasks/dependencies.yml
new file mode 100644
index 0000000..923aa45
--- /dev/null
+++ b/roles/nextcloud/tasks/dependencies.yml
@@ -0,0 +1,36 @@
+---
+
+- name: copy dependencies binaries to chroot
+ ansible.builtin.include_role:
+ name: copy_bin
+ vars:
+ copy_bin__root_dir: "{{ httpd_pre__chroot_dir }}"
+ copy_bin__name: "{{ nextcloud__loop_dependencies_item }}"
+ loop_control:
+ loop_var: nextcloud__loop_dependencies_item
+ loop:
+ - ffmpeg
+ - ffprobe
+ - perl
+
+- name: copy dependencies for exiftool
+ ansible.builtin.copy:
+ src: /usr/local/bin/exiftool
+ dest: "{{ httpd_pre__chroot_dir }}/bin/exiftool"
+ mode: preserve
+ remote_src: true
+
+- name: create perl dependencies directory
+ ansible.builtin.file:
+ path: "{{ httpd_pre__chroot_dir }}/{{ nextcloud__perl_libdata_dir | dirname }}"
+ owner: 0
+ group: 0
+ mode: "0755"
+ state: directory
+
+- name: copy perl dependencies
+ ansible.builtin.copy:
+ src: "{{ nextcloud__perl_libdata_dir }}"
+ dest: "{{ httpd_pre__chroot_dir }}/{{ nextcloud__perl_libdata_dir | dirname }}"
+ mode: preserve
+ remote_src: true
diff --git a/roles/nextcloud/tasks/main.yml b/roles/nextcloud/tasks/main.yml
index 2a950c4..6eb5d21 100644
--- a/roles/nextcloud/tasks/main.yml
+++ b/roles/nextcloud/tasks/main.yml
@@ -48,6 +48,10 @@
ansible.builtin.import_tasks:
file: php.yml
+- name: import dependencies tasks
+ ansible.builtin.import_tasks:
+ file: dependencies.yml
+
- name: import database tasks
ansible.builtin.import_tasks:
file: database.yml
@@ -82,21 +86,3 @@
owner: 0
group: 0
mode: "0644"
-
-- name: copy dependencies binaries to chroot
- ansible.builtin.include_role:
- name: copy_bin
- vars:
- copy_bin__root_dir: "{{ httpd_pre__chroot_dir }}"
- copy_bin__name: "{{ item }}"
- loop:
- - ffmpeg
- - ffprobe
- - perl
-
-- name: copy dependencies for lowdown
- ansible.builtin.copy:
- src: /usr/local/bin/exiftool
- dest: "{{ httpd_pre__chroot_dir }}/bin/exiftool"
- mode: preserve
- remote_src: true
remember that computers suck.