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.
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.).
The SELinux booleans and fcontexts this Apache integration also needs are not set by this role. The linuxfabrik.lfops.selinux role, wired in by the playbook, applies them (see Dependent Roles).
Dependent Roles¶
Any LFOps playbook that installs this role runs these for you. Optional ones can be disabled via the playbook’s skip variables.
Optional (Red Hat only, when
libreoffice__client_apache: true): the SELinux booleanshttpd_can_network_connectandhttpd_execmemmust beon, and/usr/share/httpd/.cacheand/usr/share/httpd/.configmust map to thehttpd_sys_rw_content_tfcontext (role: linuxfabrik.lfops.selinux).
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 applied by theselinuxrole the playbook wires in). Red Hat only.Type: Bool.
Default:
false
Example:
# optional
libreoffice__client_apache: true