{"id":29702576,"url":"https://github.com/devgateway/lia","last_synced_at":"2025-10-06T01:12:18.454Z","repository":{"id":78414287,"uuid":"90421933","full_name":"devgateway/lia","owner":"devgateway","description":"LDAP Inventory for Ansible","archived":false,"fork":false,"pushed_at":"2021-06-02T15:52:23.000Z","size":48,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-07-23T13:00:09.487Z","etag":null,"topics":["ansible","ansible-inventory","ldap","python","python3"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devgateway.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-05-05T22:39:06.000Z","updated_at":"2022-12-30T15:22:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"efc702a3-66e7-4977-8769-e5660706557a","html_url":"https://github.com/devgateway/lia","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/devgateway/lia","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devgateway%2Flia","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devgateway%2Flia/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devgateway%2Flia/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devgateway%2Flia/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devgateway","download_url":"https://codeload.github.com/devgateway/lia/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devgateway%2Flia/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278544170,"owners_count":26004269,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-05T02:00:06.059Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","ansible-inventory","ldap","python","python3"],"created_at":"2025-07-23T12:39:41.161Z","updated_at":"2025-10-06T01:12:18.442Z","avatar_url":"https://github.com/devgateway.png","language":"Python","readme":"# lia - LDAP Inventory for Ansible\n\n## Synopsis\n\n    lia [-h] (--list|--host HOST)\n\n## Description\n\nLia is a helper script to query hosts, groups, and variables from your LDAP server, and provide it\nto [Ansible](https://www.ansible.com/). Lia is highly configurable to support caching and adjust to\nany LDAP schema.\n\nThe program will cache the inventory in JSON format, and serve it until the cache expires.\n\n## Options\n\n### -h, --help\n\nShow usage information, and exit.\n\n### --list\n\nPrint all groups and variables.\n\n### --host *HOST*\n\nPrint variables for the host *HOST*.\n\n## Exit Status\n\nReturns zero if the inventory was retrieved.\n\n## Environment\n\n### `LOG_LEVEL`\n\nSets verbosity of logging sent to standard error. Recognized levels are:\n\n* `CRITICAL`\n* `ERROR`\n* `WARNING` (default)\n* `INFO`\n* `DEBUG`\n\n## Files\n\n### Configuration File\n\n* `$XDG_CONFIG_HOME/lia.json`\n\n* `~/.config/lia.json`\n\n### Cached Inventory\n\n* `$XDG_CACHE_HOME/lia.json`\n\n* `~/.cache/lia.json`\n\n## Conforming to\n\n* [Developing Dynamic Inventory\nSources](http://docs.ansible.com/ansible/latest/dev_guide/developing_inventory.html)\n\n* [XDG Base Directory\nSpecification](https://specifications.freedesktop.org/basedir-spec/basedir-spec-0.6.html)\n\n# Configuration File\n\nThe JSON structure in this file defines how lia connects to LDAP server, and what information it\nsearches for.\n\n## Dictionary Members\n\n### `uri`\n\nOne or more space-delimited URIs of the LDAP server.\n\n### `page`\n\nOptional. Page size to request for search operations.\n\nDefault: 100.\n\n### `cache_time`\n\nOptional. Maximum age (in seconds) of the inventory cache at `$XDG_CACHE_HOME/lia.json` or\n`~/.cache/lia.json`.\n\nDefault: 10800.\n\n### `hosts`\n\nA dictionary defining how to search for hosts and which attributes to request.\n\n### `groups`\n\nA list of dictionaries, each defining how to search for groups, which attributes to request, and\nhow to interpret host membership.\n\n## Members of `hosts` Dictionary\n\n### `base`\n\nThe node in LDAP, from which the search starts.\n\n### `scope`\n\nOptional. LDAP search scope, may only be *sub* for subtree search or any other value for base\nsearch. This is a limitation imposed by the ldap3 library abstraction objects.\n\nDefault: sub.\n\n### `objectclass`\n\nA list of object class names to search for.\n\n### `attr`\n\nA dictionary describing attributes to request. The following members are\nrequired.\n\n#### `name`\n\nThe attribute containing host name (e.g. \"cn\").\n\nIf multiple values are returned for a single object (in other words, a host has multiple names),\nlia will pick the one in common with the RDN components.\n\nIf none of the values are in the RDN, use the first alphabetically.\n\nFor example:\n\nLDAP object:\n\n    dn: cn=charlie,dc=example,dc=net\n    cn: charlie\n    cn: alpha\n\nHost name: *charlie*\n\nLDAP object:\n\n    dn: vCPU=2+cn=bravo,dc=example,dc=net\n    cn: bravo\n    cn: alpha\n\nHost name: *bravo*\n\nLDAP object:\n\n    dn: uuid=e035608b-cf04-4d2a-9451-0a7813c5225d,dc=example,dc=net\n    cn: bravo\n    cn: alpha\n\nHost name: *alpha*\n\n#### `var`\n\nThe attribute that holds JSON-formatted variables.\n\n## Members of each element in `groups` list\n\n### base, scope, objectclass\n\nGroup search criteria. See **Members of `hosts` Dictionary** above.\n\n### `attr`\n\nA dictionary describing attributes to request. The following members are\nrequired:\n\n#### `name`, `var`\n\nIdentical to the eponymous `hosts` members, see above.\n\n#### `host`\n\nThe attribute listing member hosts.\n\n#### `host_is_dn`\n\nIf *true*, then the attribute defined in *host* lists distinguished names of the member hosts.\nOtherwise, it lists host names.\n\n## Example Configuration\n\n    {\n      \"uri\": \"ldaps://ldap.example.org\",\n      \"page\": 200,\n      \"cache_time\": 86400,\n      \"hosts\": {\n        \"base\": \"ou=hosts,dc=example,dc=org\",\n        \"scope\": \"sub\",\n        \"objectclass\": [\"ansibleHost\", \"device\"],\n        \"attr\": {\n          \"name\": \"cn\",\n          \"var\": \"ansibleVars\"\n        }\n      },\n      \"groups\": [\n        {\n          \"base\": \"ou=ansible,ou=groups,dc=example,dc=org\",\n          \"scope\": \"sub\",\n          \"objectclass\": [\"groupOfNames\", \"ansibleGroup\"],\n          \"attr\": {\n            \"name\": \"cn\",\n            \"host\": \"member\",\n            \"host_is_dn\": true,\n            \"var\": \"ansibleVars\"\n          }\n        },\n        {\n          \"base\": \"ou=hosts,dc=example,dc=org\",\n          \"scope\": \"sub\",\n          \"objectclass\": [\"organizationalUnit\", \"ansibleGroup\"],\n          \"attr\": {\n            \"name\": \"ou\",\n            \"var\": \"ansibleVars\"\n          }\n        }\n      ]\n    }\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevgateway%2Flia","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevgateway%2Flia","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevgateway%2Flia/lists"}