aboutsummaryrefslogtreecommitdiffstats
path: root/roles/nextcloud/tasks/main.yml
diff options
context:
space:
mode:
authorRomain Gonçalves <me@rgoncalves.se>2024-02-08 13:32:16 +0100
committerRomain Gonçalves <me@rgoncalves.se>2024-02-08 13:33:36 +0100
commit5c5b0fbf68dca224b7f92f5de0913fd684e7d3d9 (patch)
treedfaf322db68eee91a4f8b46f4d89943c646ed089 /roles/nextcloud/tasks/main.yml
parent375f7a47425867eb781ac0d626bded21c80ea51b (diff)
downloadrules-5c5b0fbf68dca224b7f92f5de0913fd684e7d3d9.tar.gz
feat(roles/nextcloud): bring back basic nextcloud setup
Diffstat (limited to 'roles/nextcloud/tasks/main.yml')
-rw-r--r--roles/nextcloud/tasks/main.yml80
1 files changed, 80 insertions, 0 deletions
diff --git a/roles/nextcloud/tasks/main.yml b/roles/nextcloud/tasks/main.yml
new file mode 100644
index 0000000..bb744e7
--- /dev/null
+++ b/roles/nextcloud/tasks/main.yml
@@ -0,0 +1,80 @@
+---
+
+- name: install nextcloud
+ ansible.builtin.package:
+ name: "{{ nextcloud__package_name }}"
+ state: present
+ register: nextcloud__result_install
+ failed_when:
+ - nextcloud__result_install.failed
+ - not nextcloud__result_install.msg is defined
+ - not "because of conflicts" in nextcloud__result_install.msg
+
+- name: update nextcloud
+ ansible.builtin.package:
+ name: nextcloud
+ state: latest
+
+- name: install nextcloud extra dependencies
+ package:
+ name: "{{ nextcloud__package_dependencies }}"
+ state: present
+
+- name: start and enable php-service
+ ansible.builtin.service:
+ name: "{{ nextcloud__php_service_name }}"
+ state: started
+ enabled: true
+
+- name: generate nextcloud httpd configuration
+ template:
+ src: nextcloud.conf.httpd.j2
+ dest: "{{ httpd_pre__configuration_dir }}/nextcloud.conf"
+ owner: 0
+ group: 0
+ mode: "0644"
+
+# - name: generate nextcloud php config
+# template:
+# src: etc-php-7.3.ini.j2
+# dest: /etc/php-7.3.ini
+# owner: "www"
+# group: "www"
+# mode: "0644"
+
+# - name: generate nextcloud custom config
+# template:
+# src: var-www-nextcloud-config-custom.config.php.j2
+# dest: /var/www/nextcloud/config/custom.config.php
+# owner: "www"
+# group: "www"
+# mode: "0644"
+
+# - name: copy configuration for domain name and tls in chroot
+# shell: |
+# mkdir -p /var/www/etc/ssl
+# install -m 444 -o root -g bin /etc/resolv.conf /var/www/etc
+# install -m 444 -o root -g bin /etc/ssl/cert.pem /etc/ssl/openssl.cnf /var/www/etc/ssl/
+
+# - name: enable cron job for nextcloud indexing and housekeeping
+# cron:
+# name: "nextcloud indexing"
+# minute: "*/5"
+# job: "php -f /var/www/nextcloud/cron.php"
+# user: www
+
+# - name: ensure directories are chown to www
+# file:
+# path: "/var/www/nextcloud/{{ item }}"
+# owner: "www"
+# group: "www"
+# recurse: true
+# loop:
+# - "apps"
+# - "updater"
+#
+# - name: ensure php-fpm is restarted and enabled
+# service:
+# name: php73_fpm
+# state: restarted
+# enabled: true
remember that computers suck.