--- ######### # Run command line installation. # the web server must be running by now in order to launch the installation - name: Install... Removing possibly old or incomplete config.php file: path: "{{ http_webroot }}/nextcloud/config/config.php" state: absent - name: Install... Create data directory file: path: "{{ item }}" state: directory owner: "{{ nextcloud_websrv_user }}" group: "{{ nextcloud_websrv_group }}" mode: 0770 with_items: - "{{ nc_data_dir }}" - "{{ http_webroot }}/nextcloud/custom_apps" - name: Install... First setup Nextcloud become_user: "{{ nextcloud_websrv_user }}" become: true shell: "{{ php_bin }} occ maintenance:install --database=mysql --database-host={{ db_host }} --database-name={{ nc_db_name }} --database-user={{ nc_db_user }} --database-pass={{ nc_db_password }} --admin-user={{ nc_admin_name }} --admin-pass={{ nc_admin_pwd }} --data-dir={{ nc_data_dir }}" args: chdir: "{{ http_webroot }}/nextcloud" creates: "{{ http_webroot }}/nextcloud/config/config.php" register: setup_nc - name: Install... Removing possibly sample config file: path: "{{ http_webroot }}/nextcloud/config/config.sample.php" state: absent