/LDIF_bulk_generator

Generate large amount of user in LDIF format for FreeIPA consumption

Primary LanguagePythonGNU Affero General Public License v3.0AGPL-3.0

LDIF bulk user and group generator for FreeIPA insertion

Generate large amount of users and/or groups in LDIF format for FreeIPA consumption

Requirements

python3.6+

Usage

  1. Install requirements from requirements.txt (preferably in a venv)
python3 -m pip install -r requirements.txt
  1. Generate a LDIF file using
python3 generate.py -b "dc=ipa,dc=test" -nu 120 -ng 5 -o test.ldif

where:

  • -b: base DN
  • -nu : number of users to generate (can be 0)
  • -ng : number of groups to generate (can be 0)
  • -o : the output file
  1. Transfer the LDIF file to target freeipa server
  2. kinit admin
  3. ipa config-mod --enable-migration=TRUE
  4. ldapadd -x -H ldap://localhost:389  -D "cn=Directory Manager" -w <PASSWORD> -c -f <FILENAME>.ldif
    
  5. ipa migrate-ds ldap://localhost:389 --with-compat --user-container="cn=users,cn=accounts,dc=ipa,dc=test"