Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

* **role:nextcloud**: The `support` app is enabled by default, as Nextcloud ships it, so an Enterprise instance keeps its subscription record current.
* **role:postgresql_server**: A changed `pg_hba.conf` or `postgresql_server__conf_password_encryption` reloads PostgreSQL instead of restarting it, so open connections are kept; the first run after the update still restarts it once.
* **role:postgresql_server**: The configuration is checked before PostgreSQL is restarted, so a broken setting in `postgresql.conf` or `pg_hba.conf` aborts the run with the error message instead of leaving PostgreSQL down after the restart.
* **role:postfix**: The SMTP greeting banner no longer names Postfix or the OS (`<hostname> ESMTP LFOps`), which satisfies the Lynis check MAIL-8818.
Expand Down Expand Up @@ -146,6 +147,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

* **role:nextcloud**: A Nextcloud upgrade no longer logs an error from a repair step of the `dav` app and no longer rebuilds the calendar search index every time.
* **role:nextcloud**: The admin section of the `support` app is hidden again.
* **role:monitoring_plugins**: The package install works on SLE, where it failed with `No provider of 'linuxfabrik-monitoring-plugins-<version>*' found`.
* **role:postgresql_server**: `postgresql-dump` also saves the roles and tablespaces (`globals.sql.gz`), without which a restored database fails on every object owner, no longer skips the `postgres` database and databases whose name starts with `template`, and uses the client tools of the installed PostgreSQL version.
* **role:postgresql_server**: Clients connecting to `localhost` are accepted over IPv6 as well, where they were rejected with `no pg_hba.conf entry for host "::1"`.
Expand Down
48 changes: 48 additions & 0 deletions extensions/molecule/setup_nextcloud/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,54 @@
- '(__molecule__nextcloud_statusphp_result["content"] | from_json)["installed"] | bool'
fail_msg: 'status.php did not report installed. response: {{ __molecule__nextcloud_statusphp_result["content"] | d("") }}'

# The support app keeps the subscription record of an Enterprise instance current. Its admin
# section stays hidden only while `hide-app` holds the literal string `yes`, a boolean `1`
# shows it again.
- name: 'php occ app:list --output=json (as the web server user)'
ansible.builtin.command: 'php /var/www/html/nextcloud/occ app:list --output=json'
args:
chdir: '/var/www/html/nextcloud/'
become_user: 'apache'
register: '__molecule__nextcloud_app_list_result'
changed_when: false

- name: 'Assert the support app is enabled'
ansible.builtin.assert:
that:
- '"support" in (__molecule__nextcloud_app_list_result["stdout"] | from_json)["enabled"]'
fail_msg: 'The support app is not enabled, so the subscription record of an Enterprise instance is never renewed.'

- name: 'php occ config:app:get support hide-app (as the web server user)'
ansible.builtin.command: 'php /var/www/html/nextcloud/occ config:app:get support hide-app'
args:
chdir: '/var/www/html/nextcloud/'
become_user: 'apache'
register: '__molecule__nextcloud_support_hide_app_result'
changed_when: false

- name: 'Assert the support admin section is hidden'
ansible.builtin.assert:
that:
- '__molecule__nextcloud_support_hide_app_result["stdout"] | trim == "yes"'
fail_msg: 'support hide-app is "{{ __molecule__nextcloud_support_hide_app_result["stdout"] | trim }}", the support app hides its admin section only on "yes".'

# The dav repair step that queues the calendar search index rebuild skips itself only on the
# literal string `yes`. A boolean `1` makes it queue the rebuild on every upgrade and then
# fail with a type conflict when it writes `yes` back.
- name: 'php occ config:app:get dav buildCalendarSearchIndex (as the web server user)'
ansible.builtin.command: 'php /var/www/html/nextcloud/occ config:app:get dav buildCalendarSearchIndex'
args:
chdir: '/var/www/html/nextcloud/'
become_user: 'apache'
register: '__molecule__nextcloud_dav_search_index_result'
changed_when: false

- name: 'Assert the calendar search index repair step is marked as done'
ansible.builtin.assert:
that:
- '__molecule__nextcloud_dav_search_index_result["stdout"] | trim == "yes"'
fail_msg: 'dav buildCalendarSearchIndex is "{{ __molecule__nextcloud_dav_search_index_result["stdout"] | trim }}", the dav repair step skips itself only on "yes".'


# The role installs mysql-selinux so mariadbd gets `mysqld_exec_t` (MDEV-30520). Assert the domain
# of the running process, not the label on the file: only that tells `mysqld_t` apart from
Expand Down
1 change: 1 addition & 0 deletions roles/nextcloud/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ nextcloud__users:
* List of dictionaries containing key-value pairs for configuring apps in Nextcloud.
* Type: List of dictionaries.
* Default: Have a look at [defaults/main.yml](https://github.com/Linuxfabrik/lfops/blob/main/roles/nextcloud/defaults/main.yml)
* Deviates from the upstream default `'no'` for `support hide-app`: the Support section is hidden from the administration settings. Set it to `'no'` to enter an Enterprise subscription key there. The `support` app only accepts the string `'yes'`, not a boolean.
* Subkeys:

* `key`:
Expand Down
8 changes: 3 additions & 5 deletions roles/nextcloud/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ nextcloud__app_configs__role_var:
type: 'integer'
state: 'present'
- key: 'dav buildCalendarSearchIndex'
value: true
type: 'boolean'
value: 'yes'
state: 'present'
- key: 'password_policy enforceHaveIBeenPwned'
value: true
Expand All @@ -38,8 +37,7 @@ nextcloud__app_configs__role_var:
value: 'ch'
state: 'present'
- key: 'support hide-app'
value: true
type: 'boolean'
value: 'yes' # upstream default: 'no'
state: 'present'
- key: 'text workspace_available'
value: false
Expand Down Expand Up @@ -142,7 +140,7 @@ nextcloud__apps__role_var:
- name: 'sharebymail'
state: 'enabled'
- name: 'support'
state: 'disabled'
state: 'enabled'
- name: 'survey_client'
state: 'disabled'
- name: 'systemtags'
Expand Down
Loading