10 years ago, a user asked running a custom script on user creation, to
take care of disk provisioning.
https://freeipa-users.redhat.narkive.com/eSX61h7t/add-user-custom-script
Having the same need I found this post, however nothing about the posted
plugin seems to currently work.
I've determined so far the plugin location moved from ipalib to ipa
server. I've changed the class. The logging didn't work, and the passing
of 'dn' gave a type error. The minimal version below at least doesn't
generate any errors, but also does not run the script (which simple echos
output to a /tmp/cxc.log file.
I would appreciate any assistance either pointing to an already updated
version of this type of plugin, assistance doing so, or someone
knowledgable updating it for IPA 4.9.2
/usr/lib/python3.6/site-packages/ipaserver/plugins/cript_post_add_callback.py
```
from ipapython import ipautil
from ipaserver.plugins.user import user_add
def script_post_add_callback(inst, ldap, dn, attrs_list, *keys, **options):
# inst.log.error('User added')
# if 'ipa_user_script' in inst.api.env:
# try:
ipautil.run(['/usr/local/sbin/cxc.sh',"add", "dn"])
# except:
# pass
return dn
```
/usr/local/sbin/cxc.sh
```
#!/bin/bash
echo "Hello, world: $1 $2" >>/tmp/cxc.log
```
---
========================================================================
Chris Candreva -- chris(a)westnet.com --
http://www.westnet.com/~chris