GithubHelp home page GithubHelp logo

comsys-openldap-k8s-operator's Introduction

comsys-openldap-k8s-operator

A minimal charm wrapper around the OpenLDAP application for use by the Commercial Systems team with the Ranger K8s charm.

OpenLDAP is an open source implementation of the Lightweight Directory Access Protocol.

Deploy OpenLDAP

juju deploy comsys-openldap-k8s --channel=edge

Load test users

Initially the LDAP is empty on deployment, in order to load some users/groups for testing this can be done either with the ldapadd action described below or via a juju action as described here:

# To load some pre-configured test users
juju run comsys-openldap-k8s/0 load-test-users

# To load custom test users from a provided file.
juju run comsys-openldap-k8s/0 load-test-users --params path/to-file.yaml

# example file content
ldif: |
  dn: ou=People,dc=canonical,dc=dev,dc=com
  objectClass: organizationalUnit
  ou: People

  dn: ou=Groups,dc=canonical,dc=dev,dc=com
  objectClass: organizationalUnit
  ou: Groups
  ...

Note: this is provided for convenience on deployment. But user management should be handled after this using the ldap functions outlined below.

LDAP functions

LDAPSEARCH

Get the unit ip from juju status. Replace the values of the bind

sudo apt install ldap-utils
ldapsearch -x -H ldap://{unit-ip}:389 -b {ldap-base-dn} -D "cn={ldap-admin-username},{ldap-base-dn}" -w {ldap-admin-password} -s sub "(objectClass=top)"

## example
ldapsearch -x -H ldap://10.152.183.169:389 -b "dc=canonical,dc=dev,dc=com" -D "cn=admin,dc=canonical,dc=dev,dc=com" -w admin -s sub "(objectClass=top)" 

LDAPADD & LDAPMODIFY

Users, groups and memberships can be added with .ldif files. These are setup to work with the example bind dn, please update as needed. An example is provided in /templates/startup.ldif.

# Update the LDAP with your own users and groups
ldapadd -x -H ldap://{unit-ip}:389 -D "cn={ldap-admin-username},{ldap-base-dn}" -w {ldap-admin-password} -f {your file}.ldif 

comsys-openldap-k8s-operator's People

Contributors

ambercharitos avatar

Watchers

Francesco Banconi avatar Andrei Pirjoleanu avatar Ales Stimec avatar Genc Tato avatar  avatar onur musaoğlu avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.