Univention Bugzilla – Bug 42676
Add a script for school bulk import
Last modified: 2018-11-13 12:57:04 CET
For mid-sized and larger UCS@school environments, it would be great if we could provide an easy way to create all schools/OUs at once. Currently, "create_ou" allows only the creation of one school/OU at a time. We should add a small script (Python?) that reads a CSV file and then calls create_ou with the values provided by the CSV file. I suggest the following: Path / name: > /usr/share/ucs-school-import/scripts/import_schools Usage: > /usr/share/ucs-school-import/scripts/import_schools /path/to/file/schools.csv CSV format: I guess we should use the same format as for networks, computers, printers: No header, TABs as delimiter > <School-ID> <School-DisplayName> <Edu-ServerName> <NonEdu-ServerName> CSV Example: > gy123 Gymnasium Mitte sedugy123-01 sadmgy123-01 > gs138 Grundschule Ost sedugs138-01 > bs456 Berufsschule TG sedubs456-01 sadmbs456-01 > gy432 sedugy432-01 School-ID and Edu-ServerName should be mandatory values. -> If there is no school display name given, use the School-ID -> If there is no name for the Non-Edu-Server given, do _not_ create one Safety checks: - Does the school/OU already exist? If yes, skip this school and print an eye-catching error message - Does one of the given server names already exist? If yes, skip this school and print an eye-catching error message create_ou: After gathering and checking all relevant information, the script should then put together something like this: > /usr/share/ucs-school-import/scripts/create_ou --displayName="${School-DisplayName}" \ > "${School-ID}" \ > "${Edu-ServerName}" \ > "${NonEdu-ServerName}"
Created attachment 8667 [details] import_schools Here is the example for the script that Michael talked about.
*** This bug has been marked as a duplicate of bug 46765 ***