ansible-role-conductor-work.../templates/invitation-accepted.json.j2

70 lines
1.8 KiB
Django/Jinja

{
"ownerApp" : "Orchestrator",
"name" : "invitation-accepted",
"createBy" : "Mauro Mugnaini",
"description": "Handle workflow related to Portal event invitation-accepted",
"version" : 1,
"ownerEmail" : "mauro.mugnaini@nubisware.com",
"inputParameters" : ["user", "first-name", "last-name", "email", "password"],
"tasks" : [
{
"name": "INLINE_TASK",
"taskReferenceName": "init",
"type": "INLINE",
"inputParameters": {
"keycloak": "{{ keycloak }}/{{ keycloak_realm }}",
"keycloak_admin" : "{{ keycloak_admin }}/{{ keycloak_realm }}",
"evaluatorType" : "javascript",
"expression": "1"
}
},
{
"name" : "pyrest",
"taskReferenceName" : "authorize",
"type" : "SIMPLE",
"inputParameters" : {
"url" : "${init.input.keycloak}/protocol/openid-connect/token",
"method" : "POST",
"headers" : {
"Accept" : "application/json"
},
"body" : {
"client_id" : "orchestrator",
"client_secret" : "{{ keycloak_auth }}",
"grant_type" : "client_credentials"
}
}
},
{
"name" : "pyrest",
"taskReferenceName" : "create_user",
"type" : "SIMPLE",
"inputParameters" : {
"url" : "${init.input.keycloak_admin}/users",
"expect" : [201, 409],
"method" : "POST",
"body" : {
"username": "${workflow.input.user}",
"firstName": "${workflow.input.first-name}",
"lastName": "${workflow.input.last-name}",
"email": "${workflow.input.email}",
"credentials": [
{
"temporary": true,
"type": "password",
"value": "${workflow.input.password}"
}
],
"requiredActions": ["UPDATE_PASSWORD"],
"emailVerified": true,
"enabled": true
},
"headers" : {
"Authorization" : "Bearer ${authorize.output.body.access_token}",
"Content-Type" : "application/json"
}
}
}
]
}