Skip to content

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:

  1. libmaxminddb (this role)
  2. mod_maxminddb
  3. 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).
  • 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 install is executed in ~/libmaxminddb-<version>/ on the target.
  • /etc/ld.so.conf.d/local.conf is set to /usr/local/lib and ldconfig is 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'

License

The Unlicense

Author Information

Linuxfabrik GmbH, Zurich