From d7041c181036632e8df44fa61412237db68f5864 Mon Sep 17 00:00:00 2001 From: admin Date: Thu, 19 Sep 2024 10:15:02 +0200 Subject: first support for nextcloud (incomplete) --- roles/nextcloud/tasks/installation.yml | 49 ++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 roles/nextcloud/tasks/installation.yml (limited to 'roles/nextcloud/tasks/installation.yml') diff --git a/roles/nextcloud/tasks/installation.yml b/roles/nextcloud/tasks/installation.yml new file mode 100644 index 0000000..5020b88 --- /dev/null +++ b/roles/nextcloud/tasks/installation.yml @@ -0,0 +1,49 @@ +- name: install nfs packages + apt: + name: '{{ nextcloud_nfs_present }}' + install_recommends: 'no' + state: present + +- name: check mountpoint exist + ansible.builtin.file: + path: "{{ nextcloud_data_dir }}" + state: directory + mode: 0640 + owner: www-data + group: www-data + +- name: mount network share + ansible.posix.mount: + src: "{{ nextcloud_data_nfs_share }}" + path: "{{ nextcloud_data_dir }}" + fstype: nfs + opts: "rw,sync" + state: mounted + +- name: "nc_installation | Generate password {{ nextcloud_admin_name }}" + ansible.builtin.set_fact: + nextcloud_admin_pwd: "{{ lookup('password', '/root/ncpasswd.txt') }}" + become: true + when: nextcloud_admin_pwd is not defined + +- name: nc_installation | Set temporary permissions for command line installation + ansible.builtin.file: + path: "{{ nextcloud_webroot }}" + state: directory + recurse: true + owner: "{{ nextcloud_websrv_user }}" + group: "{{ nextcloud_websrv_group }}" + +- name: nc_installation | Verify config.php - check filesize + ansible.builtin.stat: + path: "{{ nextcloud_webroot }}/config/config.php" + register: nc_installation_confsize + failed_when: nc_installation_confsize.stat.size is undefined or nc_installation_confsize.stat.size <= 100 + +- name: nc_installation | Verify config.php - php syntax check + ansible.builtin.command: "php -l {{ nextcloud_webroot }}/config/config.php" + register: nc_installation_confphp + changed_when: false + failed_when: + - nc_installation_confphp.rc is defined + - nc_installation_confphp.rc != 0 -- cgit v1.2.3