https://github.com/devgateway/ansible-role-openldap-schema
OpenLDAP schema role for Ansible
https://github.com/devgateway/ansible-role-openldap-schema
ansible ansible-role ldap ldap-schema openldap
Last synced: 20 days ago
JSON representation
OpenLDAP schema role for Ansible
- Host: GitHub
- URL: https://github.com/devgateway/ansible-role-openldap-schema
- Owner: devgateway
- Created: 2018-04-17T18:38:44.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-12-15T04:23:54.000Z (over 7 years ago)
- Last Synced: 2025-07-23T13:00:10.880Z (10 months ago)
- Topics: ansible, ansible-role, ldap, ldap-schema, openldap
- Size: 3.91 KB
- Stars: 0
- Watchers: 6
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Openldap-schema role for Ansible
Idempotently load a schema to OpenLDAP server.
This role will ensure an LDIF-formatted schema exists on OpenLDAP server: either from a string
variable, or from a file on the remote host. It will detect schema CN from LDIF contents. LDIF line
wrapping is fully supported.
## Role Variables
Either `ols_schema` or `ols_ldif` variable is required.
### `ols_schema`
If `ols_schema` is *set*, then it should contain the schema LDIF. This string will be fed to
`ldapadd(1)` standard input.
LDIF line wrapping using a leading space is cumbersome to store in a YAML playbook, so you might
want to read it dynamically using a lookup.
### `ols_ldif`
If `ols_schema` is *not set*, then `ols_ldif` specifies the file name on the remote host. This file
will be loaded to LDAP using `ldapadd(1)` command.
## Example Playbook
---
- hosts: ldap-servers
tasks:
- name: Start OpenLDAP
service:
name: slapd
state: started
- name: Load schema from remote file
include_role:
name: devgateway.openldap-schema
vars:
ols_ldif: /etc/openldap/schema/ppolicy.ldif
- name: Load schema from a lookup
include_role:
name: devgateway.openldap-schema
vars:
ols_schema: "{{ lookup('file', '~/schema/project.ldif' ) }}"
# License
GPLv3 or later
# Author Information
Copyright 2018, Development Gateway