diff --git a/onlyoffice_docserver/defaults/main.yml b/onlyoffice_docserver/defaults/main.yml index cae6dc41..bf75c98f 100644 --- a/onlyoffice_docserver/defaults/main.yml +++ b/onlyoffice_docserver/defaults/main.yml @@ -23,3 +23,14 @@ onlyoffice_docserver_deb_packages_dependencies: onlyoffice_docserver_packages: - onlyoffice-documentserver +onlyoffice_docserver_db_host: localhost +onlyoffice_docserver_db_user: onlyoffice +onlyoffice_docserver_db_name: onlyoffice +#onlyoffice_docserver_db_pwd: 'put it into a vault file' + +onlyoffice_docserver_redis_host: localhost + +onlyoffice_docserver_rabbitmq_url: 'amqp://guest:guest@localhost' + +onlyoffice_docserver_use_a_secret_key: 'true' +#onlyoffice_docserver_secret_key: 'put it into a vault file' \ No newline at end of file diff --git a/onlyoffice_docserver/tasks/main.yml b/onlyoffice_docserver/tasks/main.yml index e1aa9eeb..9b09523e 100644 --- a/onlyoffice_docserver/tasks/main.yml +++ b/onlyoffice_docserver/tasks/main.yml @@ -14,6 +14,21 @@ - name: Install the OnlyOffice document server deb dependencies apt: name={{ onlyoffice_docserver_deb_packages_dependencies }} state=present cache_valid_time=1800 + - name: Create some OnlyOffice directories where we will install our config files + file: dest={{ item }} state=directory + with_items: + - /etc/onlyoffice/documentserver + - /etc/onlyoffice/documentserver/nginx + + - name: Install the OnlyOffice local configuration from a template + template: src=local.json dest=/etc/onlyoffice/documentserver/local.json owner=root group=root mode=0444 + + - name: Install the OnlyOffice document server configuration that enables SSL + template: src=onlyoffice-documentserver-ssl.conf dest=/etc/onlyoffice/documentserver/nginx/onlyoffice-documentserver.conf + when: onlyoffice_docserver_letsencrypt_managed + notify: Reload nginx + tags: [ 'onlyoffice', 'letsencrypt', 'nginx' ] + - name: The OnlyOffice document server packages must be done manually, because it is interactive debug: msg: "Manually install the onlyoffice-documentserver package with 'apt-get install -y onlyoffice-documentserver'" @@ -23,12 +38,3 @@ when: ansible_distribution_file_variety == "Debian" tags: onlyoffice - -- block: - - name: Install the OnlyOffice document server configuration that enables SSL - template: src=onlyoffice-documentserver-ssl.conf dest=/etc/onlyoffice/documentserver/nginx/onlyoffice-documentserver.conf - when: onlyoffice_docserver_use_nginx_role - notify: Reload nginx - - when: ansible_distribution_file_variety == "Debian" - tags: [ 'onlyoffice', 'letsencrypt' ] diff --git a/onlyoffice_docserver/vars/main.yml b/onlyoffice_docserver/vars/main.yml index de3a4f75..6b1bd977 100644 --- a/onlyoffice_docserver/vars/main.yml +++ b/onlyoffice_docserver/vars/main.yml @@ -9,4 +9,5 @@ psql_version: 11 pg_backup_retain_copies: 2 psql_db_data: - - { name: 'onlyoffice', encoding: 'UTF8', user: 'onlyoffice', roles: 'NOCREATEDB,NOSUPERUSER', pwd: '{{ onlyoffice_docserver_db_pwd }}', managedb: True, allowed_hosts: [ '127.0.0.1' ] } + - { name: '{{ onlyoffice_docserver_db_name }}', encoding: 'UTF8', user: '{{ onlyoffice_docserver_db_user }}', roles: 'NOCREATEDB,NOSUPERUSER', pwd: '{{ onlyoffice_docserver_db_pwd }}', managedb: True, allowed_hosts: [ '127.0.0.1' ] } +