Generate large amount of users and/or groups in LDIF format for FreeIPA consumption
python3.6+
- Install requirements from
requirements.txt
(preferably in a venv)
python3 -m pip install -r requirements.txt
- 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
- Transfer the LDIF file to target freeipa server
kinit admin
ipa config-mod --enable-migration=TRUE
-
ldapadd -x -H ldap://localhost:389 -D "cn=Directory Manager" -w <PASSWORD> -c -f <FILENAME>.ldif
-
ipa migrate-ds ldap://localhost:389 --with-compat --user-container="cn=users,cn=accounts,dc=ipa,dc=test"