You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
hetzner-ansible/smardigo/provisioning/script/ansible-start.groovy

24 lines
834 B
Groovy

def env = [
scope_id: contextScopeId,
process_instance_id: execution.getProcessInstanceId(),
smardigo_management_action: smardigoManagementAction,
cluster_name: tenant.key + '-' + cluster.name,
cluster_service: cluster.service,
cluster_size: cluster.size,
stage: cluster.stage,
current_realm_name: tenant.key,
current_realm_display_name: tenant.name
]
def ansibleCommand= 'ansible-playbook ' + smardigoManagementAction + '.yml --vault-password-file ~/vault-pass'
def ansibleEnvironment= ' -e \"'
env.each { key, val ->
ansibleEnvironment+= key + '=\'' + val + '\' '
}
ansibleEnvironment+= '\"'
ansibleCommand += ansibleEnvironment
processes.byId(contextScopeId, contextProcessId).createComment(comment + ' gestartet')
processes.byId(contextScopeId, contextProcessId).createComment(ansibleCommand)
ansibleCommand