Skip to content

Commit

Permalink
Add the ability to create a custom configuration json file (ONLYOFFIC…
Browse files Browse the repository at this point in the history
…E#55)

* Allow injecting arbitrary settings into local.json (ONLYOFFICE#41)

* allow injecting arbitrary settings into local.json

* use FQCN

* start all task names wit a capital letter and use the new handler name

* fix: name[template]: Jinja templates should only be at the end of 'name'

* fix: key-order[task]: You can improve the task key order to: name, when, block (warning)

* fix: risky-file-permissions

* onlyoffice_local_json : mark experienced usage only in a comment

* narrow down options and allow changing onlyoffice_local_json_config only

* add links to node-config page

* Move local.json override value in the main tasks

* Add information about config example

* Update link on example configs

Co-authored-by: Klaus Zerwes <[email protected]>
  • Loading branch information
danilapog and zerwes authored Jan 16, 2023
1 parent e43d341 commit fd66de9
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ The option for being able to install the package by URL.

None.

## Overwriting config values

The values in the `local.json` file can be redefined. To do this, you need to override the necessary values in the `vars/main.yml` file in the `onlyoffice_local_json: {}` field.

## Example Playbook

- hosts: all
Expand Down
9 changes: 9 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,12 @@
group: root
mode: 0644
when: onlyoffice_license is defined

- name: "Configure {{ onlyoffice_local_json_config }}"
ansible.builtin.copy:
dest: "{{ onlyoffice_local_json_config }}"
content: "{{ onlyoffice_local_json | to_nice_json(indent=2, sort_keys=false) }}\n"
mode: 0644
when: onlyoffice_local_json
notify: Restart-ds

11 changes: 11 additions & 0 deletions vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,14 @@ nginx_include_path: "/etc/nginx/includes"
nginx_docservice_file: "ds-docservice.conf"

is_nonfree_package: "{{ 'false' if package_name == 'onlyoffice-documentserver' else 'true' }}"

# see: https://github.com/node-config/node-config/wiki/Configuration-Files#file-load-order
onlyoffice_local_json_config: /etc/onlyoffice/documentserver/local-production-linux.json

# settings for onlyoffice_local_json_config
# will be transformed to json
# attention, intended for experienced users only!
# see: https://github.com/node-config/node-config/wiki/Configuration-Files#arrays-are-merged-by-replacement
onlyoffice_local_json: {}
# All values that can be overridden can be found here:
# https://helpcenter.onlyoffice.com/installation/docs-developer-configuring.aspx

0 comments on commit fd66de9

Please sign in to comment.