This guide provides a full Ansible playbook to deploy Group Office on Debian 10+, Ubuntu LTS, and RHEL 9+ compatible hosts.
Note: Group Office does not provide an official Docker image. This playbook installs from source using PHP.
- name: Deploy Group Office
hosts: groupoffice
become: true
vars:
app_root: /var/www/groupoffice
db_name: groupoffice
db_user: groupoffice
db_password: generate-secure-password
tasks:
- name: Install LAMP stack on Debian/Ubuntu
apt:
name:
- apache2
- mariadb-server
- php
- php-mysql
- php-gd
- php-imap
- php-ldap
- php-mbstring
- libapache2-mod-php
state: present
update_cache: true
when: ansible_os_family == "Debian"
- name: Install LAMP stack on RHEL family
dnf:
name:
- httpd
- mariadb-server
- php
- php-mysqlnd
- php-gd
- php-imap
- php-ldap
- php-mbstring
state: present
when: ansible_os_family == "RedHat"
- name: Enable and start services
service:
name: "{{ item }}"
state: started
enabled: true
loop:
- apache2
- mariadb
- name: Clone Group Office repository
git:
repo: https://github.com/Intermesh/groupoffice
dest: "{{ app_root }}"
- name: Create database
mysql_db:
name: "{{ db_name }}"
state: present
- name: Create database user
mysql_user:
name: "{{ db_user }}"
password: "{{ db_password }}"
priv: "{{ db_name }}.*:ALL"
state: present
- name: Set ownership
file:
path: "{{ app_root }}"
owner: www-data
group: www-data
recurse: true
- name: Enable Apache rewrite module
apache2_module:
name: rewrite
state: present
notify: restart apache
handlers:
- name: restart apache
service:
name: apache2
state: restarted
Any questions?
Feel free to contact us. Find all contact information on our contact page.