Ansible Role linuxfabrik.lfops.libmaxminddb¶
This role downloads, compiles and installs libmaxminddb, the C library that reads MaxMind's binary GeoIP database files (.mmdb). It is the runtime dependency for any application that wants to look up an IP address against the GeoLite2 / GeoIP2 databases (web servers via mod_maxminddb, custom code via the C API, Python bindings via python-maxminddb, ...).
For Maxmind, depending on your needs, you normally run three playbooks in this particular order:
- libmaxminddb (this role)
- mod_maxminddb
- maxmind_geoip
Available since LFOps 2.0.0.
How the Role Behaves¶
-
Build dependencies are OS-specific:
- Red Hat-family:
gcc,httpd-devel,make,tar(installed from the base / EPEL repos). - Debian / Ubuntu:
apache2-dev,gcc,make,tar(installed from the standard apt repos).
- Red Hat-family:
-
The Tarball is fetched on the Ansible controller (
delegate_to: 'localhost',run_once: true), then copied to the target. The controller therefore needs Internet access to GitHub; the target does not. ./configure && make && make check && make installis executed in~/libmaxminddb-<version>/on the target./etc/ld.so.conf.d/local.confis set to/usr/local/libandldconfigis run so the freshly installed library is picked up by the dynamic linker.
Tags¶
libmaxminddb
- Installs the build toolchain, downloads, compiles and installs libmaxminddb.
- Triggers: none.
Optional Role Variables¶
libmaxminddb__version
- The version to install. Possible options: https://github.com/maxmind/libmaxminddb/releases.
- Type: String.
- Default:
'1.7.1'
Example:
# optional
libmaxminddb__version: '1.7.1'