Ansible Role linuxfabrik.lfops.libreoffice¶
This role installs LibreOffice on a server, intended for headless operation and mainly used for document conversion (e.g. by an Apache HTTPd-based web app calling soffice --headless --convert-to pdf).
By default it only installs libreoffice-core plus the writer / calc / impress / draw / math packages. With libreoffice__client_apache: true it additionally prepares the host for using LibreOffice from an Apache HTTPd context (Red Hat only).
Available since LFOps 2.0.0.
How the Role Behaves¶
Setting libreoffice__client_apache: true triggers a Red Hat-specific block. On Debian / Ubuntu the block is not skipped automatically; the SELinux compile steps will fail there, so do not enable this on Debian-family hosts.
When enabled, the role:
- Creates
/usr/share/httpd/.config/libreoffice/and/usr/share/httpd/.cache/, owned byapache:apache. - Runs a one-shot dummy conversion as user
apacheto populate~/.config/libreoffice/4/. - Runs
restorecon -Fvron the two directories. - Compiles two custom SELinux policy modules (
selinux-sofficebin,selinux-java) viacheckmodule/semodule_packageand installs them withsemodule --install. These granthttpd_tthe additional permissions LibreOffice needs (setattron directories underlib_t,readoncgroup_tfiles, etc.). - Via the companion playbook: also runs
linuxfabrik.lfops.selinuxto set the SELinux booleanshttpd_can_network_connectandhttpd_execmemtoon, and to register fcontexts mapping/usr/share/httpd/.cacheand/usr/share/httpd/.configtohttpd_sys_rw_content_t.
Tags¶
libreoffice
- Installs LibreOffice and, with
client_apache: true, the Apache HTTPd integration. - Triggers: none.
Optional Role Variables¶
libreoffice__client_apache
- If
true, prepare the host for running LibreOffice from an Apache HTTPd context (directory layout, dummy run, custom SELinux modules; on Red Hat additionally the SELinux booleans / fcontexts via the companion playbook). Red Hat only. - Type: Bool.
- Default:
false
Example:
# optional
libreoffice__client_apache: true