--- # tasks file for nextcloud - name: Main... Check Nextcloud debug speed set_fact: debug_speed_check: "{{ debug_speed }}" # include os specific tasks - include_tasks: "prep_os/{{ ansible_os_family }}.yml" # install required packages - include_tasks: "prep_php/{{ ansible_os_family }}.yml" - name: Main... Check if a mysql/mariadb database is available shell: mysql --host={{ db_host }} --user={{ nc_db_user }} --password={{ nc_db_password }} -e 'SHOW DATABASES;' | grep -cx {{ nc_db_name }} register: dbstatus failed_when: "dbstatus.stdout|int != 1" no_log: true - name: Main... Check Nextcloud installed stat: path: "{{ http_webroot }}/nextcloud/index.php" register: nc_nextcloud_installed - name: Main... Download and Install Nextcloud include_tasks: "nc_download.yml" when: (nc_nextcloud_installed.stat.isreg is undefined) or (not nc_nextcloud_installed.stat.isreg) - name: Main... Check Nextcloud is installed shell: grep installed {{ http_webroot }}/nextcloud/config/config.php | grep true | wc -l register: nc_installation_configured - name: Main... Install nextcloud include_tasks: nc_install.yml when: nc_installation_configured.stdout|int == 0 - name: Main... Check Selinux include_tasks: "selinux.yml" when: - (ansible_os_family == "RedHat") - (ansible_selinux.status == "enabled") - name: Main... Setup nextcloud include_tasks: nc_setup.yml - name: Main... Restart {{ http_service_name }} service service: name: "{{ http_service_name }}" state: restarted - name: Main... First run Cron become_user: "{{ nextcloud_websrv_user }}" become: true shell: "{{ php_bin }} -f cron.php" args: chdir: "{{ http_webroot }}/nextcloud"