diff --git a/smardigo/pmci/layout/service-replay-setup.json b/smardigo/pmci/layout/service-replay-setup.json index 8fb995b..7b28b8e 100644 --- a/smardigo/pmci/layout/service-replay-setup.json +++ b/smardigo/pmci/layout/service-replay-setup.json @@ -2,7 +2,7 @@ "name" : "service-replay-setup", "configKey" : "service-replay-setup", "tabExpression" : "Service {{ data.service.name?:'neu' }}", - "readonlyExpression" : "data.vorgang_status > 90", + "readonlyExpression" : "data.vorgang_status > 0", "components" : [ { "type" : "columns", "key" : "dossier", diff --git a/smardigo/pmci/process-variable-declaration/service-create.json b/smardigo/pmci/process-variable-declaration/service-create.json index 07c2c6b..6ff89f4 100644 --- a/smardigo/pmci/process-variable-declaration/service-create.json +++ b/smardigo/pmci/process-variable-declaration/service-create.json @@ -41,6 +41,13 @@ "label" : "TenantId", "tags" : [ ] }, + "id" : { + "type" : "string", + "classification" : "PRIVATE", + "searchable" : true, + "label" : "Id", + "tags" : [ ] + }, "jobs" : { "type" : "object", "classification" : "PRIVATE", @@ -97,6 +104,11 @@ "type" : "object", "classification" : "PRIVATE", "fields" : { + "connect_features" : { + "type" : "string", + "classification" : "PRIVATE", + "tags" : [ ] + }, "cluster" : { "type" : "object", "classification" : "PRIVATE", @@ -108,6 +120,27 @@ "searchable" : true, "label" : "Cluster Name", "tags" : [ ] + }, + "service" : { + "type" : "string", + "classification" : "PRIVATE", + "searchable" : true, + "label" : "Cluster Service", + "tags" : [ ] + }, + "size" : { + "type" : "integer", + "classification" : "PRIVATE", + "searchable" : true, + "label" : "Cluster Größe", + "tags" : [ ] + }, + "stage" : { + "type" : "string", + "classification" : "PRIVATE", + "searchable" : true, + "label" : "Cluster Stage", + "tags" : [ ] } }, "tags" : [ ] @@ -126,12 +159,31 @@ "label" : "Cluster Name", "tags" : [ ] }, + "id" : { + "type" : "string", + "classification" : "PRIVATE", + "searchable" : true, + "label" : "Id", + "tags" : [ ] + }, "tenant_key" : { "type" : "string", "classification" : "PRIVATE", "searchable" : true, "label" : "Tenant Schlüssel", "tags" : [ ] + }, + "link" : { + "type" : "string", + "classification" : "PRIVATE", + "searchable" : true, + "label" : "Link", + "tags" : [ ] + }, + "tenant_id" : { + "type" : "string", + "classification" : "PRIVATE", + "tags" : [ ] } }, "tags" : [ ] @@ -154,6 +206,13 @@ "classification" : "PRIVATE", "label" : "Tenant", "fields" : { + "id" : { + "type" : "string", + "classification" : "PRIVATE", + "searchable" : true, + "label" : "Id", + "tags" : [ ] + }, "key" : { "type" : "string", "classification" : "PRIVATE", @@ -164,6 +223,18 @@ }, "tags" : [ ] }, + "tenant_id" : { + "type" : "string", + "classification" : "PRIVATE", + "tags" : [ ] + }, + "tenant_key" : { + "type" : "string", + "classification" : "PRIVATE", + "searchable" : true, + "label" : "Tenant Schlüssel", + "tags" : [ ] + }, "vorgang_status" : { "type" : "long", "classification" : "PRIVATE", diff --git a/smardigo/pmci/process-variable-declaration/tenant-create.json b/smardigo/pmci/process-variable-declaration/tenant-create.json index ca85500..a128cbb 100644 --- a/smardigo/pmci/process-variable-declaration/tenant-create.json +++ b/smardigo/pmci/process-variable-declaration/tenant-create.json @@ -17,6 +17,13 @@ "label" : "Ersteller", "tags" : [ ] }, + "id" : { + "type" : "string", + "classification" : "PRIVATE", + "searchable" : true, + "label" : "Id", + "tags" : [ ] + }, "keycloak_admin" : { "type" : "object", "classification" : "PRIVATE", @@ -54,12 +61,54 @@ "label" : "Mandantenschlüssel", "tags" : [ ] }, + "id" : { + "type" : "string", + "classification" : "PRIVATE", + "searchable" : true, + "label" : "Id", + "tags" : [ ] + }, "name" : { "type" : "string", "classification" : "PRIVATE", "searchable" : true, "label" : "Mandantenname", "tags" : [ ] + }, + "stage" : { + "type" : "string", + "classification" : "PRIVATE", + "searchable" : true, + "label" : "Cluster Stage", + "tags" : [ ] + }, + "user_ids" : { + "type" : "string", + "classification" : "PRIVATE", + "tags" : [ ] + }, + "admin" : { + "type" : "object", + "classification" : "PRIVATE", + "label" : "Admin", + "fields" : { + "email" : { + "type" : "string", + "classification" : "PRIVATE", + "tags" : [ ] + }, + "first_name" : { + "type" : "string", + "classification" : "PRIVATE", + "tags" : [ ] + }, + "last_name" : { + "type" : "string", + "classification" : "PRIVATE", + "tags" : [ ] + } + }, + "tags" : [ ] } }, "tags" : [ ] diff --git a/smardigo/pmci/process/service-change.bpmn b/smardigo/pmci/process/service-change.bpmn index 6021349..8b8cacc 100644 --- a/smardigo/pmci/process/service-change.bpmn +++ b/smardigo/pmci/process/service-change.bpmn @@ -945,7 +945,7 @@ return !is_wordpress_active_old && is_wordpress_active_new; - datasources.query('data-entity-tenants').processScope(contextScopeId, contextProcessDefinitionKey).parameters([id:tenant.id]).list()[0].admin.email + datasources.query('data-entity-tenants').processScope(contextScopeId, contextProcessId).parameters([id:tenant.id]).list()[0].admin.email diff --git a/smardigo/pmci/process/service-delete.bpmn b/smardigo/pmci/process/service-delete.bpmn index 5e70941..eb1dc25 100644 --- a/smardigo/pmci/process/service-delete.bpmn +++ b/smardigo/pmci/process/service-delete.bpmn @@ -186,7 +186,7 @@ - datasources.query('data-entity-tenants').processScope(contextScopeId, contextProcessDefinitionKey).parameters(['id':tenant.id]).list()[0].admin.email + datasources.query('data-entity-tenants').processScope(contextScopeId, contextProcessId).parameters(['id':tenant.id]).list()[0].admin.email diff --git a/smardigo/pmci/process/service-setup.bpmn b/smardigo/pmci/process/service-setup.bpmn index bf83c8e..b6c80da 100644 --- a/smardigo/pmci/process/service-setup.bpmn +++ b/smardigo/pmci/process/service-setup.bpmn @@ -185,7 +185,7 @@ - datasources.query('data-entity-tenants').processScope(contextScopeId, contextProcessDefinitionKey).parameters([id:tenant.id]).list()[0].admin.email + datasources.query('data-entity-tenants').processScope(contextScopeId, contextProcessId).parameters([id:tenant.id]).list()[0].admin.email diff --git a/smardigo/pmci/process/smardigo-management-action.bpmn b/smardigo/pmci/process/smardigo-management-action.bpmn index b5d2403..96071e9 100644 --- a/smardigo/pmci/process/smardigo-management-action.bpmn +++ b/smardigo/pmci/process/smardigo-management-action.bpmn @@ -7,28 +7,61 @@ Flow_1ow8whd - - Flow_1ow8whd - Flow_0qfq760 - - - + - + ${simulation} - - - + + + + + ${job_template_id != -1} + + + ${job_template_id == -1} + + + + + + - Flow_0qfq760 + Flow_1ow8whd Flow_0tmasvl Flow_1rngywr + + Flow_19zzqmc + Flow_1igjy4m + Flow_0x3dixj + + + + + pmci-empty-playbook + + + Flow_0tmasvl + Flow_19zzqmc + + + + + ${smardigoManagementAction} + + + Flow_1rngywr + Flow_1igjy4m + + + Flow_0x3dixj + Flow_1u10qvz + @@ -37,48 +70,9 @@ - Flow_1rngywr + Flow_1u10qvz Flow_1xdj53u - - - ${job_template_id != -1} - - - Flow_0gcsmj7 - Flow_0tmasvl - Flow_0npv638 - - - Flow_1ju13h8 - - - Flow_0npv638 - Flow_1ju13h8 - - - Flow_1nuku1o - Flow_0gcsmj7 - - - - Flow_1kxc9t0 - Flow_1nuku1o - def process = processes.byId(contextScopeId, contextProcessId) - -if(awxResponse != null && awxResponse.job != null) { - def jobs = process.getVariable('jobs') - jobs = !!jobs ? jobs : [] - jobs.add(0, awxResponse.job) - - process.setVariable('jobs', jobs) - process.setVariable('current_job_id', awxResponse.job) - process.createComment('current_job_id := ' + awxResponse.job) -} else { - process.createComment('current_job_error: response-code: ' + awxResponseCode + ' - response-body: ' + awxResponse) -} - - @@ -91,27 +85,11 @@ if(awxResponse != null && awxResponse.job != null) { Flow_065a4cq Flow_1nqz9ya - - - - - - ${extra_vars} - - - - - Flow_1nqz9ya - Flow_1kxc9t0 - Flow_1cnt5hf Flow_065a4cq Flow_0mtnk56 - - ${job_template_id == -1} - Flow_0mtnk56 @@ -119,7 +97,7 @@ if(awxResponse != null && awxResponse.job != null) { Flow_1xdj53u Flow_1cnt5hf - def templates = datasources.query('awx-job-templates').processScope(contextScopeId, contextProcessId).parameters([name:smardigoManagementAction]).list(); + def templates = datasources.query('awx-job-templates').processScope(contextScopeId, contextProcessId).parameters([name:currentSmardigoManagementAction]).list(); templates.size()==0 ? -1 : templates[0]['id']; @@ -131,7 +109,49 @@ templates.size()==0 ? -1 : templates[0]['id']; Flow_0ny162r - + + + + + + ${extra_vars} + + + + + Flow_1nqz9ya + Flow_1kxc9t0 + + + Flow_1kxc9t0 + Flow_1nuku1o + def process = processes.byId(contextScopeId, contextProcessId) + +if(awxResponse != null && awxResponse.job != null) { + def jobs = process.getVariable('jobs') + jobs = !!jobs ? jobs : [] + jobs.add(0, awxResponse.job) + + process.setVariable('jobs', jobs) + process.setVariable('current_job_id', awxResponse.job) + process.createComment('current_job_id := ' + awxResponse.job) +} else { + process.createComment('current_job_error: response-code: ' + awxResponseCode + ' - response-body: ' + awxResponse) +} + + + + Flow_1nuku1o + Flow_0gcsmj7 + + + + Flow_1ju13h8 + + + Flow_0gcsmj7 + Flow_1ju13h8 + Anmerkung * teams-Benachrichtigung nur, wenn teams_channel_url exisitiert @@ -143,144 +163,160 @@ templates.size()==0 ? -1 : templates[0]['id']; - + - - - - - - - + - - + + - - + + + - - + + + - - - - - + + - - - + + - - - - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + - + - - - - - + - - + + - - + + - - - - + + + - + - - + + - - + + - - + + - - + + - + - - - - - - + + - - + + - - + + - + - - + + - + - - + + + + + + + + + + + + + + + + + + + diff --git a/smardigo/pmci/script/ansible-start.groovy b/smardigo/pmci/script/ansible-start.groovy index 38915fa..250153c 100644 --- a/smardigo/pmci/script/ansible-start.groovy +++ b/smardigo/pmci/script/ansible-start.groovy @@ -44,7 +44,7 @@ switch(smardigoManagementAction) { } def filename = 'xvars-' + smardigoManagementAction + '-' + execution.getProcessInstanceId() + '.yml' -def ansibleCommand= 'ansible-playbook ' + smardigoManagementAction + '.yml --vault-password-file ~/vault-pass-' + envStage + ' -e "@' + filename + '"' +def ansibleCommand= 'ansible-playbook ' + currentSmardigoManagementAction + '.yml --vault-password-file ~/vault-pass-' + envStage + ' -e "@' + filename + '"' def ansibleVariables= 'cat <<EOT > ' + filename + '\n' ansibleVariables+= '---\n' diff --git a/smardigo/pmci/script/initialize-connect-features.groovy b/smardigo/pmci/script/initialize-connect-features.groovy index cf66253..0a05e22 100644 --- a/smardigo/pmci/script/initialize-connect-features.groovy +++ b/smardigo/pmci/script/initialize-connect-features.groovy @@ -2,7 +2,7 @@ def parameters = [:] parameters["default"] = "'1'" -def defaultFeatures = datasources.query("connect-features").processScope(contextScopeId, contextScopeTag).parameters(parameters).list(); +def defaultFeatures = datasources.query("connect-features").scope(contextScopeId, contextScopeTag).parameters(parameters).list(); def features = [] defaultFeatures.each { val -> features+= val.key }