/*****************************************
  service:
    tenant_key: sken
    cluster:
      stage: dev
      key: test01
    connect_features:
      - connect_wordpress
      - connect_search_elastic
      - ...
    connect_version: latest
  connect_admin_password: xxx
  wordpress_admin_password: xxx
*****************************************/

def data = [:]

def connect_admin = [:]
connect_admin["username"] = service.cluster.key + "-connect-admin"
connect_admin["password"] = connect_admin_password
def connect = [:]
connect["admin"] = connect_admin
connect["version"] = service.connect_version
data["connect"] = connect

execution.setVariable('connect_admin', connect_admin)

if (service.connect_features.contains("connect_wordpress")) {
  def wordpress_admin = [:]
  wordpress_admin["username"] = service.cluster.key + "-wordpress-admin"
  wordpress_admin["password"] = wordpress_admin_password
  def wordpress = [:]
  wordpress["admin"] = wordpress_admin
  data["wordpress"] = wordpress

  execution.setVariable('wordpress_admin', wordpress_admin)
}

data