This guide installs GLPI with Apache, PHP, and MariaDB.
It supports Debian 10 to latest stable, Ubuntu LTS, and RHEL 9+ compatible systems.
- name: Install GLPI
hosts: glpi
become: true
vars:
glpi_webroot: /var/www/glpi
glpi_version: "10.0.16"
tasks:
- name: Install dependencies on Debian/Ubuntu
apt:
name:
- apache2
- mariadb-server
- php
- php-mysql
- php-mbstring
- php-xml
- php-curl
- php-zip
- php-gd
- php-intl
- php-bcmath
- php-imap
- unzip
- wget
- curl
- git
state: present
update_cache: true
when: ansible_os_family == "Debian"
- name: Install dependencies on RHEL family
dnf:
name:
- httpd
- mariadb-server
- php
- php-mysqlnd
- php-mbstring
- php-xml
- php-curl
- php-zip
- php-gd
- php-intl
- php-bcmath
- php-imap
- unzip
- wget
- curl
- git
state: present
when: ansible_os_family == "RedHat"
- name: Enable and start required services
service:
name: "{{ item }}"
state: started
enabled: true
loop:
- "{{ 'apache2' if ansible_os_family == 'Debian' else 'httpd' }}"
- mariadb
- name: Create GLPI web root
file:
path: "{{ glpi_webroot }}"
state: directory
mode: "0755"
- name: Download GLPI release
get_url:
url: "https://github.com/glpi-project/glpi/releases/download/{{ glpi_version }}/glpi-{{ glpi_version }}.tgz"
dest: /tmp/glpi.tgz
mode: "0644"
- name: Extract GLPI
unarchive:
src: /tmp/glpi.tgz
dest: /tmp
remote_src: true
- name: Deploy GLPI files
command: rsync -a --delete /tmp/glpi/ {{ glpi_webroot }}/
Any questions?
Feel free to contact us. Find all contact information on our contact page.