Ansible Role 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.
What libreoffice__client_apache: true Does¶
Setting this to 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.
The SELinux booleans / fcontexts are injected from libreoffice__selinux__booleans__dependent_var and libreoffice__selinux__fcontexts__dependent_var in defaults/main.yml. They are role-internal and not meant to be overridden from inventory.
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