Files
configpolicy/roles/nextcloud/tasks/main.yml
Dustin C. Hatch b86e0d8f29 roles/nextcloud: Switch to Fedora package
Fedora now includes a packaged version of Nextcloud.  This will be
_much_ easier to maintain than the tarball-based distribution method.
There are some minor differences in how the Fedora package works,
compared to the upstream tarball.  Notably, it puts the configuration
file in `/etc/` and makes it read-only, and it stores persistent data
separate from the application.  These differences require modifications
to the Apache and PHP-FPM configuration, but the package also included
examples to make this easier.  Since the `config.php` is read-only now,
it has to be managed by the configuration policy; it cannot be modified
by the Administration web UI.
2021-06-24 20:21:48 -05:00

69 lines
1.4 KiB
YAML

- name: ensure rpmfusion repo is installed
package:
name: >-
https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-{{ ansible_distribution_version }}.noarch.rpm
tags:
- install
- name: ensure required packages are installed
package:
name: '{{ nextcloud_packages }}'
state: present
tags:
- install
- name: ensure nextcloud database user exists
become: true
become_user: postgres
postgresql_user:
name: nextcloud
password: '{{ nextcloud_db_password }}'
state: present
- name: ensure nextcloud database exists
become: true
become_user: postgres
postgresql_db:
name: nextcloud
owner: nextcloud
state: present
- name: ensure nextcloud is configured
template:
src: config.php.j2
dest: /etc/nextcloud/config.php
mode: '0600'
owner: apache
group: apache
tags:
- config
- name: ensure php-fpm is configured for nextcloud
template:
src: www.php-fpm.conf.j2
dest: /etc/php-fpm.d/www.conf
mode: '0644'
notify:
- restart php-fpm
tags:
- php-fpm-config
- name: ensure apache is configured to serve nextcloud
template:
src: nextcloud.httpd.conf.j2
dest: /etc/httpd/conf.d/nextcloud.conf
mode: '0644'
notify: reload httpd
tags:
- apache-config
- name: ensure php-fpm starts at boot
service:
name: php-fpm
enabled: true
- meta: flush_handlers
- name: ensure php-fpm service is running
service:
name: php-fpm
state: started