| | |
| | | </sequence> |
| | | </function> |
| | | |
| | | |
| | | <!-- Create a replication server using dsconfig --> |
| | | <function name="CreateBackendWithScript"> |
| | | <!-- |
| | | |
| | | --> |
| | | <function-prolog> |
| | | This function creates a backend server under a given synchronization provider using dsconfig |
| | | </function-prolog> |
| | | <function-map-args> |
| | | <function-arg-def name="location" |
| | | type="optional" |
| | | default="STAF_REMOTE_HOSTNAME"> |
| | | <function-arg-description> |
| | | Location of target host |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="hostname" /> |
| | | </function-arg-def> |
| | | <function-arg-def name="dsPath" |
| | | type="optional" |
| | | default="'%s/%s' % (DIRECTORY_INSTANCE_DIR,OPENDSNAME)"> |
| | | <function-arg-description> |
| | | Pathname to installation root |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="filepath" /> |
| | | </function-arg-def> |
| | | <function-arg-def name="dsInstanceHost" |
| | | type="optional" |
| | | default="STAF_REMOTE_HOSTNAME"> |
| | | <function-arg-description> |
| | | Directory server hostname or IP address |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="hostname" /> |
| | | </function-arg-def> |
| | | <function-arg-def name="dsInstancePort" type="required"> |
| | | <function-arg-description> |
| | | Directory server port number |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="Port number" /> |
| | | </function-arg-def> |
| | | <function-arg-def name="dsInstanceDn" type="required"> |
| | | <function-arg-description> |
| | | Bind DN |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="DN" /> |
| | | </function-arg-def> |
| | | <function-arg-def name="dsInstancePswd" type="required"> |
| | | <function-arg-description> |
| | | Bind password |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="string" /> |
| | | </function-arg-def> |
| | | <function-arg-def name="dsBackendID" |
| | | type="optional" |
| | | default="DIRECTORY_INSTANCE_BE"> |
| | | <function-arg-description> |
| | | Name backend |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="string" /> |
| | | </function-arg-def> |
| | | <function-arg-def name="dsBaseDN" |
| | | type="optional" |
| | | default="DIRECTORY_INSTANCE_SFX"> |
| | | <function-arg-description> |
| | | base dn |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="string" /> |
| | | </function-arg-def> |
| | | <function-arg-def name="dsLdapDB" |
| | | type="optional" |
| | | default="'tmp'"> |
| | | <function-arg-description> |
| | | back end db for based dn |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="string" /> |
| | | </function-arg-def> |
| | | <function-arg-def name="dsImportTempDir" |
| | | type="optional" |
| | | default="'/tmp'"> |
| | | <function-arg-description> |
| | | temporary import dir |
| | | </function-arg-description> |
| | | <function-arg-property name="type" value="string" /> |
| | | </function-arg-def> |
| | | <function-arg-def name="expectedRC" type="optional" default="0"> |
| | | <function-arg-description> |
| | | Expected return code value. Default value is 0. |
| | | Wildcard 'noCheck' to not check the RC |
| | | </function-arg-description> |
| | | </function-arg-def> |
| | | </function-map-args> |
| | | <sequence> |
| | | <!-- Local variables --> |
| | | <script> |
| | | mylocation=location |
| | | STAFCmdParams='' |
| | | STAFCmd='' |
| | | baseDNOption='--set base-dn:"%s"' % dsBaseDN |
| | | if dsPath: |
| | | dsBinPath='%s/%s' % (dsPath,fileFolder) |
| | | STAFCmd='%s/%s%s' % (dsBinPath,DSCONFIG,fileExt) |
| | | |
| | | STAFCmdParamsList=[] |
| | | STAFCmdParamsList.append('create-backend') |
| | | #STAFCmdParamsList.append('-n') |
| | | #STAFCmdParamsList.append('-h %s' % dsInstanceHost) |
| | | #STAFCmdParamsList.append('-D %s' % dsInstanceDn) |
| | | #STAFCmdParamsList.append('-w %s' % dsInstancePswd) |
| | | #STAFCmdParamsList.append('-p %s' % dsInstancePort) |
| | | STAFCmdParamsList.append('--backend-name %s' % dsBackendID) |
| | | STAFCmdParamsList.append('--type local-db') |
| | | STAFCmdParamsList.append(baseDNOption) |
| | | STAFCmdParamsList.append('--set enabled:true') |
| | | STAFCmdParamsList.append('--set writability-mode:enabled') |
| | | STAFCmdParamsList.append('--set import-temp-directory:%s' % dsImportTempDir) |
| | | STAFCmdParamsList.append('--set db-directory:%s' % dsLdapDB) |
| | | |
| | | </script> |
| | | |
| | | <call function="'_dsconfigCommonArgs'" /> |
| | | <script> |
| | | STAFCmdParams=' '.join(STAFCmdParamsList) |
| | | </script> |
| | | <call function="'runCommand'"> |
| | | { 'name' : 'Modify dsconfig object', |
| | | 'location' : location, |
| | | 'command' : STAFCmd, |
| | | 'arguments' : STAFCmdParams, |
| | | 'expectedRC': expectedRC |
| | | } |
| | | </call> |
| | | <return> |
| | | STAXResult |
| | | </return> |
| | | </sequence> |
| | | </function> |
| | | |
| | | <!-- Create a multimaster domain using dsconfig --> |
| | | <function name="createMultimasterDomain"> |
| | | <function-prolog> |