diff --git a/roles/nextcloud/tasks/main.yml b/roles/nextcloud/tasks/main.yml index 66b07b271..3c9da2154 100644 --- a/roles/nextcloud/tasks/main.yml +++ b/roles/nextcloud/tasks/main.yml @@ -101,6 +101,16 @@ mysql_db: name={{ nextcloud_dbname }} when: mysql_enabled and nextcloud_enabled +- name: Create a user to access the nextcloud database + mysql_user: name={{ nextcloud_dbuser }} host={{ item }} password={{ nextcloud_dbpassword }} priv={{ nextcloud_dbname }}.*:ALL,GRANT + with_items: + - "{{ nextcloud_dbhost }}" + - 127.0.0.1 + - ::1 + - localhost + when: mysql_enabled and nextcloud_enabled + + - name: Restart apache, so it picks up the new aliases service: name={{ apache_service }} state=restarted when: not nextcloud_enabled