first commit

This commit is contained in:
phil 2023-09-27 16:35:10 +02:00
commit b40c37914c
6 changed files with 107 additions and 0 deletions

15
README.md Normal file
View file

@ -0,0 +1,15 @@
OnlyOffice
==========
Installation of OnlyOffice according to the [documentation](https://helpcenter.onlyoffice.com/installation/docs-community-install-ubuntu.aspx).
# Variables
| Name | Type | Default |
|------|------|---------|
| `onlyoffice_db_host` | string | localhost |
| `onlyoffice_db_use` | string | onlyoffice |
| `onlyoffice_db_password` | string | *not set* |
| `onlyoffice_db_name` | string | onlyoffice |
| `onlyoffice_jwt_secret` | string | *not set* |
| `onlyoffice_ds_port` | int | 80 |

7
defaults/main.yml Normal file
View file

@ -0,0 +1,7 @@
---
onlyoffice_db_host: localhost
onlyoffice_db_user: onlyoffice
onlyoffice_db_name: onlyoffice
onlyoffice_ds_port: 80
database_host: "{{ onlyoffice_db_host }}"

10
meta/main.yml Normal file
View file

@ -0,0 +1,10 @@
galaxy_info:
author: Sense.Lab admins
description: Role to install OnlyOffice Documentserver
company: Sense.Lab e.V.
license: GPLv3
min_ansible_version: "2.11"
platforms:
- name: Debian
versions:
- bookworm

16
tasks/database.yml Normal file
View file

@ -0,0 +1,16 @@
---
- name: "Database | Create database"
community.postgresql.postgresql_db:
name: "{{ onlyoffice_db_name }}"
encoding: UTF8
template: template0
become: true
become_user: postgres
- name: "Database | Create user role"
community.postgresql.postgresql_user:
name: "{{ onlyoffice_db_user }}"
password: "{{ onlyoffice_db_password }}"
db: "{{ onlyoffice_db_name }}"
become: true
become_user: postgres

50
tasks/install.yml Normal file
View file

@ -0,0 +1,50 @@
---
- name: "Install | Add Onlyoffice repository"
block:
- name: Add repository key
ansible.builtin.get_url:
url: https://download.onlyoffice.com/GPG-KEY-ONLYOFFICE
dest: /etc/apt/trusted.gpg.d/onlyoffice.asc
mode: "0644"
- name: Add repository
ansible.builtin.apt_repository:
repo: deb [signed-by=/usr/share/keyrings/onlyoffice.gpg] https://download.onlyoffice.com/repo/debian squeeze main
filename: onlyoffice
- name: "Install | Set debconf options"
ansible.builtin.debconf:
name: onlyoffice-documentserver
question: "onlyoffice/{{ item.question }}"
value: "{{ item.value }}"
vtype: "{{ item.vtype }}"
loop:
- question: db-host
value: "{{ onlyoffice_db_host }}"
vtype: string
- question: db-user
value: "{{ onlyoffice_db_user }}"
vtype: string
- question: db-pwd
value: "{{ onlyoffice_db_password }}"
vtype: password
- question: db-name
value: "{{ onlyoffice_db_name }}"
vtype: string
- question: jwt-enabled
value: true
vtype: boolean
- question: jwt-secret
value: "{{ onlyoffice_jwt_secret }}"
vtype: password
- question: ds-port
value: "{{ onlyoffice_ds_port }}"
vtype: select
- name: "Install | Install packages"
ansible.builtin.apt:
pkg:
- nginx-extras
- rabbitmq-server
- onlyoffice-documentserver
- ttf-mscorefonts-installer

9
tasks/main.yml Normal file
View file

@ -0,0 +1,9 @@
---
- name: Setup database
ansible.builtin.import_tasks: database.yml
tags: database
delegate_to: "{{ database_host }}"
- name: Install packages
ansible.builtin.import_tasks: install.yml
tags: install