New article Installing ONLYOFFICE Docs Community Edition using Ansible

This commit is contained in:
Svetlana Maleeva 2022-11-07 17:44:47 +03:00
parent 180eb99bf1
commit 9c82e1240c
7 changed files with 314 additions and 0 deletions

View File

@ -3100,4 +3100,7 @@
<data name="OnlineEditorSettingsTag" xml:space="preserve">
<value>online editor settings</value>
</data>
<data name="InstallingOODocsAnsible" xml:space="preserve">
<value>Installing ONLYOFFICE Docs Community Edition using Ansible</value>
</data>
</root>

View File

@ -0,0 +1,5 @@
<%@ Control Language="C#" %>
<a class="crm-task-title sm_linux sm_server sm_document" id="link_60046" title=""
href="<%=VirtualPathUtility.ToAbsolute("~/installation/docs-community-install-ansible.aspx")%>">
<asp:Literal runat="server" Text="<%$ Resources:Resource, InstallingOODocsAnsible %>" />
</a>

View File

@ -80,6 +80,7 @@
<li><cc:LocalizeContent runat="Server" ControlName="~/Controls/Help/ArticlesCompleteList/ServerLinux/60024_documents_installation_centos.ascx" /></li>
<li><cc:LocalizeContent runat="Server" ControlName="~/Controls/Help/ArticlesCompleteList/ServerLinux/60043_docs_install_centos_arm.ascx" /></li>
<li><cc:LocalizeContent runat="Server" ControlName="~/Controls/Help/ArticlesCompleteList/ServerLinux/60036_documents_installation_snap.ascx" /></li>
<li><cc:LocalizeContent runat="Server" ControlName="~/Controls/Help/ArticlesCompleteList/ServerLinux/60046_docs_ansible.ascx" /></li>
</ul>
</li>
<li>Windows version

View File

@ -80,6 +80,7 @@
<li><cc:LocalizeContent runat="Server" ControlName="~/Controls/Help/ArticlesCompleteList/ServerLinux/60024_documents_installation_centos.ascx" /></li>
<li><cc:LocalizeContent runat="Server" ControlName="~/Controls/Help/ArticlesCompleteList/ServerLinux/60043_docs_install_centos_arm.ascx" /></li>
<li><cc:LocalizeContent runat="Server" ControlName="~/Controls/Help/ArticlesCompleteList/ServerLinux/60036_documents_installation_snap.ascx" /></li>
<li><cc:LocalizeContent runat="Server" ControlName="~/Controls/Help/ArticlesCompleteList/ServerLinux/60046_docs_ansible.ascx" /></li>
</ul>
</li>
<li>Windows version

View File

@ -482,6 +482,7 @@
<li><cc:LocalizeContent runat="Server" ControlName="~/Controls/Help/ArticlesCompleteList/ServerLinux/60024_documents_installation_centos.ascx" /></li>
<li><cc:LocalizeContent runat="Server" ControlName="~/Controls/Help/ArticlesCompleteList/ServerLinux/60043_docs_install_centos_arm.ascx" /></li>
<li><cc:LocalizeContent runat="Server" ControlName="~/Controls/Help/ArticlesCompleteList/ServerLinux/60036_documents_installation_snap.ascx" /></li>
<li><cc:LocalizeContent runat="Server" ControlName="~/Controls/Help/ArticlesCompleteList/ServerLinux/60046_docs_ansible.ascx" /></li>
</ul>
</li>
<li>Windows version

View File

@ -0,0 +1,282 @@
<%@ Control Language="C#" Inherits="BaseContentUserControls"%>
<%@ Register Namespace="TeamLab.Controls" Assembly="__Code" TagPrefix="cc" %>
<%@ Register TagPrefix="cc" TagName="LinuxVersionTag" Src="~/Controls/Help/Tags/linux-version/linux-version.ascx" %>
<script runat="server">
protected override void Init()
{
PageTitle = PageCaption = "Installing ONLYOFFICE Docs Community Edition using Ansible";
MetaKeyWords = "";
MetaDescription = "";
var guides = new GuidesModel();
(Page as BasePage).Guides = guides;
}
</script>
<div class="MainHelpCenter">
<h1 class="subHeaderFeaturesCaption Guides_Video_Captions">Installing ONLYOFFICE Docs Community Edition using Ansible</h1>
<cc:LocalizeContent runat="Server" ControlName="~/Controls/Help/VariousControls/Versions/DocumentServer/DocumentServer_Current.ascx" />
<div class="keyword_block">
<ul>
<li><cc:LocalizeContent runat="Server" ControlName="~/Controls/Help/Tags/local-server/local-server.ascx" /></li>
<li><cc:LocalizeContent runat="Server" ControlName="~/Controls/Help/Tags/server-version/server-version.ascx" /></li>
<li><cc:LocalizeContent runat="Server" ControlName="~/Controls/Help/Tags/install-ONLYOFFICE/install-ONLYOFFICE.ascx" /></li>
<li><cc:LocalizeContent runat="Server" ControlName="~/Controls/Help/Tags/document-server/document-server.ascx" /></li>
<li><cc:LinuxVersionTag ID="LinuxVersionTag1" runat="server" /></li>
</ul>
</div>
<div class="video_ground video_trips">
<h2 id="introduction">Introduction</h2>
<div class="block_of_step">
<div class="video_text">
<p><b><%= ((BasePage)Page).EditionVersion %></b> allows you to install <b>ONLYOFFICE Docs</b> on your local server and integrate the online editors with <span class="developer_display">your web application</span><span class="community_enterprise_display">the <a href="<%=VirtualPathUtility.ToAbsolute("~/installation/groups-index.aspx")%>">ONLYOFFICE collaboration platform</a> or <a href="<%=VirtualPathUtility.ToAbsolute("~/integration.aspx")%>">other popular systems</a></span>.</p>
<p><b>ONLYOFFICE Docs</b> is an online office suite that comprises viewers and editors for texts, spreadsheets and presentations, fully compatible with Office Open XML formats (.docx, .xlsx, .pptx) and enables collaborative editing in real time.</p>
<p><b>Functionality</b></p>
<ul>
<li>Document Editor</li>
<li>Spreadsheet Editor</li>
<li>Presentation Editor</li>
<li>Mobile web viewers</li>
<li class="developer_enterprise_display">Mobile web editors</li>
<li>Collaborative editing</li>
<li>Hieroglyph support</li>
<li>Support for all the popular formats: DOC, DOCX, TXT, ODT, RTF, ODP, EPUB, ODS, XLS, XLSX, CSV, PPTX, HTML</li>
</ul>
<%--<div class="developer_enterprise_display">
<p><b>Pro features</b></p>
<ul>
<li>Document comparison</li>
<li>Content Controls insertion</li>
<li>Sheet Views</li>
</ul>
</div>--%>
<p>See the <a target="_blank" href="https://github.com/ONLYOFFICE/DocumentServer#onlyoffice-document-server-editions">detailed list of features</a> available for <b>ONLYOFFICE Docs</b> <b><%= ((BasePage)Page).EditionVersion %></b>.</p>
<div class="community_enterprise_display">
<p>By integrating it with <b>ONLYOFFICE Groups</b>, you will be able to:</p>
<ul>
<li>share files;</li>
<li>manage access rights for documents;</li>
<li>embed documents on a website;</li>
<li>view and edit files stored on Drive, Box, Dropbox, OneDrive, OwnCloud connected to ONLYOFFICE.</li>
</ul>
</div>
<p>Ansible allows you to install and configure software on several machines at once. This guide describes how to install ONLYOFFICE Docs Community Edition using Ansible.</p>
</div>
</div>
</div>
<h2 id="SystemRequirements">Requirements</h2>
<div class="block_of_step">
<div class="screen_text">
<%--<ul>
<li><cc:LocalizeContent runat="Server" ControlName="~/Controls/Help/Server/Common/SystemRequirements/SysReqs_CPU/SysReqs_CPU.ascx" /></li>
<li><cc:LocalizeContent runat="Server" ControlName="~/Controls/Help/Server/Common/SystemRequirements/SysReqs_RAM1/SysReqs_RAM1.ascx" /></li>
<li><cc:LocalizeContent runat="Server" ControlName="~/Controls/Help/Server/Common/SystemRequirements/SysReqs_HDD3/SysReqs_HDD3.ascx" /></li>
<li><cc:LocalizeContent runat="Server" ControlName="~/Controls/Help/Server/Common/SystemRequirements/SysReqs_Add_Hard/SysReqs_Add_Hard.ascx" /></li>
<li><cc:LocalizeContent runat="Server" ControlName="~/Controls/Help/Server/Common/SystemRequirements/SysReqs_OS2/SysReqs_OS2.ascx" /></li>
</ul>--%>
<ul>
<li><b>OS</b>: The <a target="_blank" href="https://galaxy.ansible.com/onlyoffice/documentserver">ONLYOFFICE.documentserver</a> Ansible role is used to install and configure ONLYOFFICE Docs on RHEL/CentOS or Debian/Ubuntu servers. This instruction is written for Ubuntu 18.04, 20.04</li>
<li><b>At least two hosts</b>:
<ul>
<li>Ansible control node with Ansible installed and configured.</li>
<li>One or more managed hosts (the machines where you want to install ONLYOFFICE Docs).</li>
</ul>
<p>To easily start working with Ansible, perform three easy steps on the Ansible control node:</p>
<ol>
<li>Install Ansible. You can refer to the <a target="_blank" href="https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html">official Ansible documentation</a></li>
<li>Create an SSH key pair:
<pre><code>ssh-keygen</code></pre>
</li>
<li>Add a public key to the managed hosts so that the control node can access them via SSH:
<pre><code>ssh-copy-id username@managed_host1
ssh-copy-id username@managed_host2
</code></pre>
</li>
</ol>
</li>
<li><b>Other requirements</b>:
<ul>
<li>ONLYOFFICE Docs requires PostgreSQL, RabbitMQ and Redis server. They will be installed automatically after launching the playbook.</li>
<li>This role requires root access, so either run it in a playbook with a global <code>become: yes</code>, or invoke the role in your playbook:
<pre><code>- hosts: documentserver
roles:
- role: ONLYOFFICE.documentserver
become: yes
</code></pre>
<p>The playbook example provided in Step1 contains <code>become: yes</code> for the ONLYOFFICE.documentserver role.</p>
</li>
</ul>
</li>
</ul>
</div>
</div>
<h2 id="Installing">Installing ONLYOFFICE Docs on Ansible hosts</h2>
<div class="block_of_step">
<div class="screen_text">
<p>The actions below are performed on the Ansible control node. You will need to create a playbook, create a new inventory file or edit the existing one, install all roles specified in the playbook and then launch the playbook.</p>
<h3>Step 1. Create a playbook</h3>
<p>Create a new directory, if necessary:</p>
<pre><code>mkdir ~/playbooks
</code></pre>
<p>Go to the directory:</p>
<div>
<pre><code>cd ~/playbooks
</code></pre>
</div>
<p>Create a new playbook and open it for editing:</p>
<pre><code>nano playbook.yml
</code></pre>
<p>Add the following contents:</p>
<pre><code>- hosts: documentserver
vars:
postgresql_global_config_options:
- option: listen_addresses
value: "*"
- option: unix_socket_directories
value: '{{ postgresql_unix_socket_directories | join(",") }}'
postgresql_hba_entries:
- type: local
database: all
user: postgres
auth_method: peer
- type: local
database: all
user: all
auth_method: peer
- type: host
database: all
user: all
address: 127.0.0.1/32
auth_method: md5
- type: host
database: all
user: all
address: ::1/128
auth_method: md5
- type: host
database: all
user: all
address: 0.0.0.0/0
auth_method: md5
postgresql_databases:
- name: "{{ db_server_name }}"
postgresql_users:
- name: "{{ db_server_user }}"
password: "{{ db_server_pass }}"
rabbitmq_users:
- name: "{{ rabbitmq_server_user }}"
password: "{{ rabbitmq_server_pass }}"
vhost: "{{ rabbitmq_server_vpath }}"
configure_priv: .*
read_priv: .*
write_priv: .*
tags: administrator
rabbitmq_users_remove: []
redis_bind_interface: 0.0.0.0
roles:
- role: geerlingguy.postgresql
- role: onlyoffice.rabbitmq
- role: geerlingguy.redis
- role: onlyoffice.documentserver
become: yes
</code></pre>
<p>Save the file.</p>
<div class="notehelp">The yml files are sensitive to formatting. If you change any values, ensure that you use spacing for indentation and check alignment. You can validate your modified file using any third-party <a target="_blank" href="https://codebeautify.org/yaml-validator">yaml validator</a>.
<p>The ONLYOFFICE roles must be specified in the same register which is used in the commands for installing these roles (see Step 3). I.e. if you specified <code>- role: ONLYOFFICE.documentserver</code> in the playbook, install the role using the <code>ansible-galaxy install ONLYOFFICE.documentserver</code> command, not <code>ansible-galaxy install onlyoffice.documentserver</code></p>
</div>
<h3>Step 2. Create an inventory file</h3>
<p>Create a new inventory file and open it for editing:</p>
<pre><code>nano inventory</code></pre>
<p>Add the following content:</p>
<pre><code>[documentserver]
managed_host1 ansible_user=root
managed_host2 ansible_user=root
managed_host3 ansible_user=root</code></pre>
<p>Replace <code>managed_host1</code>, <code>managed_host2</code>, <code>managed_host3</code>, etc. with actual IP addresses or domain names of managed nodes where you want to install ONLYOFFICE Docs.</p>
<p>Save the file.</p>
<p>Alternatively, you can add this list of hosts to your default <code>/etc/ansible/hosts</code> file.</p>
<div class="notehelp">In the example above, the inventory file is added to the same directory where the playbook was created. If your inventory file is located in a different directory, you will need to specify the full path to the inventory file using the <code>-i</code> parameter when launching the playbook (see Step4).</div>
<h3>Step 3. Install the Ansible Roles for ONLYOFFICE Docs</h3>
<p>Install all roles specified in the playbook using the following commands:</p>
<pre><code>ansible-galaxy install onlyoffice.documentserver</code></pre>
<pre><code>ansible-galaxy install geerlingguy.postgresql</code></pre>
<div class="notehelp">this command will install geerlingguy.postgresql v 3.4, in this case you can get the error with the TASK [geerlingguy.postgresql : Define postgresql_log_dir.] when launching the playbook. To avoid this error, you can remove the role using the following command: <code>ansible-galaxy remove geerlingguy.postgresql</code> and instal a previous version of this role using the following command: <code>ansible-galaxy install geerlingguy.postgresql,3.3.1</code></div>
<pre><code>ansible-galaxy install onlyoffice.rabbitmq</code></pre>
<pre><code>ansible-galaxy install geerlingguy.redis</code></pre>
<h3>Step 4. Run the playbook</h3>
<p>In the directory with the created playbook, run the following command:</p>
<pre><code>ansible-playbook playbook.yml -i inventory</code></pre>
<p>If your inventory file is located in a different directory, you need to specify the full path to the inventory file using the -i parameter. For example, if you add the [documentserver] list to the default hosts file, use the following command: <code>ansible-playbook playbook.yml -i /etc/ansible/hosts</code></p>
<div class="notehelp">if you get the error with the TASK [geerlingguy.postgresql : Ensure PostgreSQL Python libraries are installed.], it can be solved by updating repositories cache on managed hosts with apt-get update. For this purpose, you can create a separate update.yml playbook with the following contents:
<pre><code>- hosts: documentserver
become: true
become_user: root
tasks:
- name: Update apt repo
apt: update_cache=yes</code></pre>
<p>Execute update.yml and then run the playbook.yml again.</p>
</div>
<p>After executing the playbook.yml, ONLYOFFICE Docs with all dependencies will be installed on all managed hosts specified in your inventory file.</p>
</div>
<h2 id="RunningHTTPS">Variables used in the official onlyoffice.documentserver role</h2>
<div class="block_of_step">
<div class="screen_text">
<p>Available role variables are listed below, along with default values (see defaults/main.yml):</p>
<pre><code>db_server_host: localhost
</code></pre>
<p>The IP address or the name of the host where the PostgreSQL server is running.</p>
<pre><code>db_server_name: onlyoffice
</code></pre>
<p>The name of a PostgreSQL database to be created on the image startup.</p>
<pre><code>db_server_user: onlyoffice
</code></pre>
<p>The new user name with superuser permissions for the PostgreSQL account.</p>
<pre><code>db_server_pass: onlyoffice
</code></pre>
<p>The password set for the PostgreSQL account.</p>
<pre><code>package_name: onlyoffice-documentserver
</code></pre>
<p>The package name of the ONLYOFFICE Document Server.</p>
<pre><code>redis_server_host: localhost
</code></pre>
<p>The IP address or the name of the host where the Redis server is running.</p>
<pre><code>redis_server_port: 6379
</code></pre>
<p>The Redis server port number.</p>
<pre><code>rabbitmq_server_host: localhost
</code></pre>
<p>The IP address or the name of the host where the RabbitMQ server is running.</p>
<pre><code>rabbitmq_server_user: guest
</code></pre>
<p>The new user name for the RabbitMQ account.</p>
<pre><code>rabbitmq_server_pass: guest
</code></pre>
<p>The password set for the RabbitMQ account.</p>
<pre><code>rabbitmq_server_vpath: /
</code></pre>
<p>The virtual path for the RabbitMQ server.</p>
<pre><code>proto: http
</code></pre>
<p>The option to add ssl configuration or not.</p>
<pre><code>key_file: "~/certs/tls.key"
</code></pre>
<p>The path to the key file.</p>
<pre><code>cert_file: "~/certs/tls.crt"
</code></pre>
<p>The path to the certificate file.</p>
<pre><code>cluster_mode: false
</code></pre>
<p>The option to enable or disable cluster mode.</p>
<pre><code>start_example: false
</code></pre>
<p>The option for starting example service after installing.</p>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,21 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Masters/InstallationGuides/InstallationDocsArticles.master" %>
<%@ Register Namespace="TeamLab.Controls" Assembly="__Code" TagPrefix="cc" %>
<asp:Content ID="Content4" ContentPlaceHolderID="pagebodyidpage" runat="Server">
<% ((BasePage)Page).EditionVersion = "Community Edition"; %>
<body class="linux_version document_server docs_community_edition">
</asp:Content>
<asp:Content ID="content3" ContentPlaceHolderID="breadstop" runat="server">
<cc:LocalizeContent runat="Server" ControlName="~/Controls/Help/VariousControls/TopControls/DocumentLinuxTop/DocumentLinuxTop.ascx" />
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="content" runat="Server">
<cc:localizecontent runat="Server" controlname="~/Controls/Help/Server/Document/Ansible/Ansible.ascx" />
</asp:Content>
<asp:Content ID="content2" ContentPlaceHolderID="leftmenupage" runat="server">
<div class="installationdocspage documents">
<div id="SeeAlsoBlockLinks">
<div class="caption guides">
<cc:LocalizeContent runat="Server" ControlName="~/Controls/Help/ArticlesCompleteList/ServerLinux/60007_connect_document_to_community.ascx" />
<cc:LocalizeContent runat="Server" ControlName="~/Controls/Help/ArticlesCompleteList/ServerLinux/60002_community_installation.ascx" />
</div>
</div>
</asp:Content>