Hi Clement,

thank you for the hint.

I try it this way but unfortunately it didn't work for me.

For only sync the uid mar I coded it this way:

<propertiesBasedSyncOptions>
                                <mainIdentifier>"uid=" + 
srcBean.getDatasetFirstValueById("uid") + 
",ou=people,dc=ppi,dc=org"</mainIdentifier>
                                <defaultDelimiter>;</defaultDelimiter>
                                <defaultPolicy>FORCE</defaultPolicy>
                                <conditions>
                                        <create>false</create>
                                        <update><![CDATA[rjs:
                                                var update = false;
                                                if ( 
srcBean.getDatasetFirstValueById("uid") == "mar" ) {
                                                        update = true;
                                                }
                                                update;
                                        ]]></update>
                                        <delete>false</delete>
                                        <changeId>false</changeId>
                                </conditions>
                                <dataset>
                                        <name>gecos</name>
                                        <policy>FORCE</policy>
                                        <forceValues>
 <string>srcBean.getDatasetFirstValueById("gecos")</string>
                                        </forceValues>
                                </dataset>
                        </propertiesBasedSyncOptions>

Then I did a dry run and at the end I get this:

.......
Nov 02 12:02:19 - INFO  - Starting sync for NIS2LDAP-User-SyncTask
Nov 02 12:02:23 - INFO  - All entries: 948, to modify entries: 0, 
successfully modified entries: 0, errors: 0
[root@tasha nis2ad]#

The user mar exists in NIS:
[root@janeway ~]# getent passwd | grep ^mar
mar:sijMc1cgNHgCo:7241:202:Martin Roeh:/home/mar:/bin/bash
[root@janeway ~]# 

Can you show me my mistake ?

Regards

Martin



Von:    "Clément OUDOT" <[email protected]>
An:     [email protected]
Datum:  29.10.2018 19:12
Betreff:        Re: [lsc-users] Antwort: Re: Antwort: Re: Antwort: Re: NIS 
plugin and filtering
Gesendet von:   "lsc-users" <[email protected]>





Le 29/10/2018 à 16:07, Martin Röh a écrit :
Yes, that is what I will try, but I don't know how can I do it with 
conditions. I think the conditions are global for the complete sync 
process ? Perhaps you have an example for me how I can do it ? 


Hello Martin,

conditions are evaluated for each entry. It is a javascript expression 
that is evaluated (like in a dataset). It the expression returns true, the 
condition is validated and the entry can be written 
(create/update/delete). If the condition is false, the entry is not 
updated.

Example:

        <conditions>
          <create>false</create>
          <update><![CDATA[rjs:
            var update = true;
            if ( 
srcBean.getDatasetFirstValueById("userPassword").startsWith("{") ) {
              update = false;
            }
            update;
          ]]></update>
          <delete>false</delete>
          <changeId>false</changeId>
        </conditions>

Here the task will only update the entry if the value in userPassword 
field is in cleartext.
-- 
Clément Oudot | Identity Solutions Manager

[email protected]

Worteks | https://www.worteks.com
_______________________________________________________________
Ldap Synchronization Connector (LSC) - http://lsc-project.org

lsc-users mailing list
[email protected]
https://lists.lsc-project.org/cgi-bin/mailman/listinfo/lsc-users

_______________________________________________________________
Ldap Synchronization Connector (LSC) - http://lsc-project.org

lsc-users mailing list
[email protected]
https://lists.lsc-project.org/cgi-bin/mailman/listinfo/lsc-users

Reply via email to