Merge "Correct naming of keystone v3 params in lab and cleanup job"
diff --git a/aptly/server/docker.yml b/aptly/server/docker.yml
index ee8f4a2..3fa0a8e1 100644
--- a/aptly/server/docker.yml
+++ b/aptly/server/docker.yml
@@ -20,7 +20,6 @@
       root_dir: /srv/volumes/aptly
       no_config: true
       gpg:
-        keyring: .gnupg/trustdb.gpg
         keypair_id: ${_param:aptly_gpg_keypair_id}
         public_key: ${_param:aptly_gpg_public_key}
         private_key: ${_param:aptly_gpg_private_key}
diff --git a/designate/server/cluster.yml b/designate/server/cluster.yml
index 573ac66..33eb632 100644
--- a/designate/server/cluster.yml
+++ b/designate/server/cluster.yml
@@ -43,17 +43,14 @@
         user: openstack
         password: ${_param:rabbitmq_openstack_password}
         virtual_host: '/openstack'
-      pool:
-        pool_id: ${_param:designate_pool_id}
-        nameservers:
-          - uuid: ${_param:designate_node1_uuid}
-            host: ${_param:cluster_node01_address}
-            port: 53
-          - uuid: ${_param:designate_node2_uuid}
-            host: ${_param:cluster_node02_address}
-            port: 53
-        targets:
-          uuid: ${_param:designate_target_uuid}
-          options: 'port: 53, host: 127.0.0.1'
-          masters: 127.0.0.1:5354
-          type:  ${_param:designate_target_type}
+      pools:
+        default:
+          description: 'default pool'
+          ns_records: ${_param:designate_pool_ns_records}
+          nameservers: ${_param:designate_pool_nameservers}
+          targets:
+            default:
+              type: ${_param:designate_pool_target_type}
+              description: 'default target'
+              masters: ${_param:designate_pool_target_masters}
+              options: ${_param:designate_pool_target_options}
diff --git a/galera/server/database/designate.yml b/galera/server/database/designate.yml
new file mode 100644
index 0000000..107e3ae
--- /dev/null
+++ b/galera/server/database/designate.yml
@@ -0,0 +1,26 @@
+parameters:
+  mysql:
+    server:
+      database:
+        designate:
+          encoding: utf8
+          users:
+          - name: designate
+            password: ${_param:mysql_designate_password}
+            host: '%'
+            rights: all
+          - name: designate
+            password: ${_param:mysql_designate_password}
+            host: ${_param:cluster_vip_address}
+            rights: all
+        designate_pool_manager:
+          encoding: utf8
+          users:
+          - name: designate
+            password: ${_param:mysql_designate_password}
+            host: '%'
+            rights: all
+          - name: designate
+            password: ${_param:mysql_designate_password}
+            host: ${_param:cluster_vip_address}
+            rights: all
diff --git a/jenkins/client/job/debian/packages/salt.yml b/jenkins/client/job/debian/packages/salt.yml
index ecd7432..0eec086 100644
--- a/jenkins/client/job/debian/packages/salt.yml
+++ b/jenkins/client/job/debian/packages/salt.yml
@@ -189,6 +189,8 @@
               dist: trusty
             - name: varnish
               dist: trusty
+            - name: xtrabackup
+              dist: trusty
             - name: zookeeper
               dist: trusty
             - name: aodh
@@ -375,6 +377,8 @@
               dist: xenial
             - name: varnish
               dist: xenial
+            - name: xtrabackup
+              dist: xenial
             - name: zookeeper
               dist: xenial
           template:
diff --git a/jenkins/client/job/deploy/lab/cicd.yml b/jenkins/client/job/deploy/lab/cicd.yml
index 7f53d29..d2bd1f7 100644
--- a/jenkins/client/job/deploy/lab/cicd.yml
+++ b/jenkins/client/job/deploy/lab/cicd.yml
@@ -62,7 +62,7 @@
               # openstack api
               OPENSTACK_API_URL:
                 type: string
-                default: "https://vpc.tcpisek.cz:5000/v2.0"
+                default: "https://vpc.tcpisek.cz:5000"
               OPENSTACK_API_CREDENTIALS:
                 type: string
                 default: "openstack-qa-credentials"
diff --git a/jenkins/client/job/deploy/lab/mk/cleanup.yml b/jenkins/client/job/deploy/lab/mk/cleanup.yml
index 52e3d16..d5dca47 100644
--- a/jenkins/client/job/deploy/lab/mk/cleanup.yml
+++ b/jenkins/client/job/deploy/lab/mk/cleanup.yml
@@ -2,10 +2,10 @@
   jenkins:
     client:
       job:
-        deploy-heat-cleanup:
+        deploy-stack-cleanup:
           type: workflow-scm
           concurrent: true
-          display_name: "Deploy - heat cleanup"
+          display_name: "Deploy - stack cleanup"
           discard:
             build:
               keep_num: 20
@@ -15,10 +15,21 @@
             credentials: "gerrit"
             script: cleanup-pipeline.groovy
           param:
-            # openstack api
+            # general parameters
+            STACK_NAME:
+              type: string
+              description: This stack will be deleted.
+            STACK_TYPE:
+              type: choice
+              choices:
+                - heat
+                - aws
+              default: 'heat'
+
+            # heat parameters
             OPENSTACK_API_URL:
               type: string
-              default: "https://vpc.tcpisek.cz:5000/v2.0"
+              default: "https://vpc.tcpisek.cz:5000"
             OPENSTACK_API_CREDENTIALS:
               type: string
               default: "openstack-qa-credentials"
@@ -43,10 +54,15 @@
             OPENSTACK_API_USER_DOMAIN:
               type: string
               default: "default"
-            # heat
-            HEAT_STACK_NAME:
+
+            # aws parameters
+            AWS_API_CREDENTIALS:
               type: string
-              description: This stack will be deleted.
+              default: "aws-credentials"
+            AWS_DEFAULT_REGION:
+              type: string
+              default: "us-west-2"
+
         delete-failed-stacks:
           type: workflow-scm
           concurrent: true
@@ -66,7 +82,7 @@
             # openstack api
             OPENSTACK_API_URL:
               type: string
-              default: "https://vpc.tcpisek.cz:5000/v2.0"
+              default: "https://vpc.tcpisek.cz:5000"
             OPENSTACK_API_CREDENTIALS:
               type: string
               default: "openstack-qa-credentials"
diff --git a/jenkins/client/job/deploy/lab/mk/cloud.yml b/jenkins/client/job/deploy/lab/mk/cloud.yml
index 6bffea0..32542ca 100644
--- a/jenkins/client/job/deploy/lab/mk/cloud.yml
+++ b/jenkins/client/job/deploy/lab/mk/cloud.yml
@@ -3,12 +3,12 @@
     jenkins_cloud_deploy_pipelines:
       - stack_name: k8s_calico
         stack_type: heat
-        stack_install: core,k8s
+        stack_install: core,k8s,calico
         job_timer: ""
       - stack_name: k8s_calico
         stack_type: aws
-        stack_install: core,k8s
-        job_timer: ""
+        stack_install: core,k8s,calico
+        job_timer: "H H * * *"
   jenkins:
     client:
       job_template:
@@ -21,7 +21,7 @@
               build:
                 keep_num: 20
             concurrent: true
-            display_name: "Deploy {{stack_type}} {{stack_name}} stack"
+            display_name: "Deploy - {{stack_name}} {{stack_type}}"
             scm:
               type: git
               url: "${_param:jenkins_gerrit_url}/mk/mk-pipelines"
@@ -31,7 +31,12 @@
               timer:
                 spec: "{{job_timer}}"
             param:
-              # deployments and test settings
+              # general parameters
+              ASK_ON_ERROR:
+                type: boolean
+                default: 'false'
+
+              # deployments
               STACK_NAME:
                 type: string
                 description: Heat stack name. Will be generated if missing.
@@ -66,7 +71,7 @@
                 default: "master"
               STACK_CLEANUP_JOB:
                 type: string
-                default: ''
+                default: 'deploy-stack-cleanup'
 
               # salt master
               SALT_MASTER_CREDENTIALS:
@@ -91,7 +96,7 @@
               # openstack api
               OPENSTACK_API_URL:
                 type: string
-                default: "https://vpc.tcpisek.cz:5000/v2.0"
+                default: "https://vpc.tcpisek.cz:5000"
               OPENSTACK_API_CREDENTIALS:
                 type: string
                 default: "openstack-qa-credentials"
@@ -130,12 +135,8 @@
                 type: string
                 default: "docker-dev-virtual.docker.mirantis.net/mirantis/kubernetes/k8s-conformance:v1.5.1-3_1482332392819"
 
-              # Tempest settings
-              TEMPEST_IMAGE_LINK:
+              # Openstack settings
+              TEMPEST_IMAGE:
                 type: string
                 default: "sandbox-docker-prod-local.docker.mirantis.net/mirantis/rally_tempest:0.1"
 
-              ASK_ON_ERROR:
-                type: boolean
-                default: 'false'
-
diff --git a/jenkins/client/job/deploy/lab/mk/init.yml b/jenkins/client/job/deploy/lab/mk/init.yml
index cc70f55..75c63a9 100644
--- a/jenkins/client/job/deploy/lab/mk/init.yml
+++ b/jenkins/client/job/deploy/lab/mk/init.yml
@@ -81,7 +81,7 @@
               # openstack api
               OPENSTACK_API_URL:
                 type: string
-                default: "https://vpc.tcpisek.cz:5000/v2.0"
+                default: "https://vpc.tcpisek.cz:5000"
               OPENSTACK_API_CREDENTIALS:
                 type: string
                 default: "openstack-qa-credentials"
diff --git a/jenkins/client/job/docker/devops-portal.yml b/jenkins/client/job/docker/devops-portal.yml
index 7af37eb..399586f 100644
--- a/jenkins/client/job/docker/devops-portal.yml
+++ b/jenkins/client/job/docker/devops-portal.yml
@@ -40,7 +40,7 @@
           param:
             IMAGE_NAME:
               type: string
-              default: "devops_portal"
+              default: "devops-portal"
             IMAGE_TAGS:
               type: string
               default: ""
diff --git a/jenkins/client/job/docker/rundeck.yml b/jenkins/client/job/docker/rundeck.yml
new file mode 100644
index 0000000..63d206f
--- /dev/null
+++ b/jenkins/client/job/docker/rundeck.yml
@@ -0,0 +1,58 @@
+parameters:
+  jenkins:
+    client:
+      job:
+        docker-build-images-rundeck:
+          name: docker-build-images-rundeck
+          discard:
+            build:
+              keep_num: 25
+            artifact:
+              keep_num: 25
+          type: workflow-scm
+          concurrent: false
+          scm:
+            type: git
+            url: "${_param:jenkins_gerrit_url}/mk/mk-pipelines"
+            credentials: "gerrit"
+            script: docker-build-to-jfrog.groovy
+          trigger:
+            gerrit:
+              project:
+                "oss/docker-rundeck":
+                  branches:
+                    - master
+              skip_vote:
+                - successful
+                - failed
+                - unstable
+                - not_built
+              event:
+                patchset:
+                  - created:
+                      excludeDrafts: false
+                      excludeNoCodeChange: false
+                change:
+                  - merged
+                comment:
+                  - addedContains:
+                      commentAddedCommentContains: 'rebuild'
+          param:
+            IMAGE_NAME:
+              type: string
+              default: "rundeck"
+            IMAGE_TAGS:
+              type: string
+              default: ""
+            CREDENTIALS_ID:
+              type: string
+              default: "gerrit"
+            DOCKERFILE_PATH:
+              type: string
+              default: "."
+            DOCKER_REGISTRY:
+              type: string
+              default: "docker-dev-virtual.docker.mirantis.net"
+            PROJECT_NAMESPACE:
+              type: string
+              default: "oss"
diff --git a/jenkins/client/job/image/centos.yml b/jenkins/client/job/image/centos.yml
index 995bfd4..6f3484b 100644
--- a/jenkins/client/job/image/centos.yml
+++ b/jenkins/client/job/image/centos.yml
@@ -56,7 +56,7 @@
               default: "qcow2"
             GLANCE_URL:
               type: string
-              default: "https://vpc.tcpisek.cz:5000/v2.0"
+              default: "https://vpc.tcpisek.cz:5000"
             GLANCE_CREDENTIALS_ID:
               type: string
               default: "openstack-qa-credentials"
diff --git a/jenkins/client/job/image/debian.yml b/jenkins/client/job/image/debian.yml
index 924b34c..3efc6b5 100644
--- a/jenkins/client/job/image/debian.yml
+++ b/jenkins/client/job/image/debian.yml
@@ -56,7 +56,7 @@
               default: "qcow2"
             GLANCE_URL:
               type: string
-              default: "https://vpc.tcpisek.cz:5000/v2.0"
+              default: "https://vpc.tcpisek.cz:5000"
             GLANCE_CREDENTIALS_ID:
               type: string
               default: "openstack-qa-credentials"
diff --git a/jenkins/client/job/image/ubuntu.yml b/jenkins/client/job/image/ubuntu.yml
index a9f25e5..63195fe 100644
--- a/jenkins/client/job/image/ubuntu.yml
+++ b/jenkins/client/job/image/ubuntu.yml
@@ -63,7 +63,7 @@
               default: "qcow2"
             GLANCE_URL:
               type: string
-              default: "https://vpc.tcpisek.cz:5000/v2.0"
+              default: "https://vpc.tcpisek.cz:5000"
             GLANCE_CREDENTIALS_ID:
               type: string
               default: "openstack-qa-credentials"
@@ -129,7 +129,7 @@
               default: "qcow2"
             GLANCE_URL:
               type: string
-              default: "https://vpc.tcpisek.cz:5000/v2.0"
+              default: "https://vpc.tcpisek.cz:5000"
             GLANCE_CREDENTIALS_ID:
               type: string
               default: "openstack-qa-credentials"
diff --git a/jenkins/client/job/salt-formulas/git-mirrors/2way.yml b/jenkins/client/job/salt-formulas/git-mirrors/2way.yml
index 1716a44..3869b4a 100644
--- a/jenkins/client/job/salt-formulas/git-mirrors/2way.yml
+++ b/jenkins/client/job/salt-formulas/git-mirrors/2way.yml
@@ -106,6 +106,7 @@
             - name: taiga
             - name: telegraf
             - name: varnish
+            - name: xtrabackup
             - name: zookeeper
           template:
             discard:
diff --git a/jenkins/client/job/salt-formulas/tests.yml b/jenkins/client/job/salt-formulas/tests.yml
index 0f3b405..1e51afb 100644
--- a/jenkins/client/job/salt-formulas/tests.yml
+++ b/jenkins/client/job/salt-formulas/tests.yml
@@ -107,6 +107,7 @@
             - name: telegraf
             - name: tftpd-hpa
             - name: varnish
+            - name: xtrabackup
             - name: zookeeper
           template:
             discard:
diff --git a/jenkins/client/job/salt-models/generate-auto.yml b/jenkins/client/job/salt-models/generate-auto.yml
index 4f62784..79e4ba3 100644
--- a/jenkins/client/job/salt-models/generate-auto.yml
+++ b/jenkins/client/job/salt-models/generate-auto.yml
@@ -19,7 +19,7 @@
             param:
               COOKIECUTTER_TEMPLATE_URL:
                 type: string
-                default: "git@github.com:Mirantis/mk2x-cookiecutter-reclass-model.git"
+                default: "https://gerrit.mcp.mirantis.net/p/mk/cookiecutter-templates.git"
               COOKIECUTTER_TEMPLATE_CREDENTIALS:
                 type: string
                 default: github-credentials
diff --git a/jenkins/client/job/salt-models/generate.yml b/jenkins/client/job/salt-models/generate.yml
index f88c54d..8202479 100644
--- a/jenkins/client/job/salt-models/generate.yml
+++ b/jenkins/client/job/salt-models/generate.yml
@@ -19,7 +19,7 @@
             param:
               COOKIECUTTER_TEMPLATE_URL:
                 type: string
-                default: "git@github.com:Mirantis/mk2x-cookiecutter-reclass-model.git"
+                default: "https://gerrit.mcp.mirantis.net/p/mk/cookiecutter-templates.git"
               COOKIECUTTER_TEMPLATE_CREDENTIALS:
                 type: string
                 default: github-credentials
diff --git a/jenkins/client/job/salt-models/git-mirrors.yml b/jenkins/client/job/salt-models/git-mirrors.yml
index 7ee7b94..514663b 100644
--- a/jenkins/client/job/salt-models/git-mirrors.yml
+++ b/jenkins/client/job/salt-models/git-mirrors.yml
@@ -6,12 +6,37 @@
       job_template:
         git_mirror_2way_salt_model:
           name: git-mirror-2way-salt-model-{{name}}
-          param:
-            name:
-              - reclass-system
-              - slovaktelekom
-              - stacklight
-              - statens
+          jobs:
+            - name: reclass-system
+              upstream_name: reclass-system
+              branches: "master"
+            - name: slovaktelekom
+              upstream_name: slovaktelekom
+              branches: "master"
+            - name: stacklight
+              upstream_name: stacklight
+              branches: "master"
+            - name: statens
+              upstream_name: statensit
+              branches: "master"
+            - name: aeg
+              upstream_name: aeg
+              branches: "master"
+            - name: att-cicd
+              upstream_name: att-cicd
+              branches: "master"
+            - name: mall
+              upstream_name: mall
+              branches: "master"
+            - name: quickplay
+              upstream_name: quickplay
+              branches: "master"
+            - name: ril-jamnagar
+              upstream_name: ril-jamnagar-lab
+              branches: "master,jlab,next"
+            - name: vf-cloudstore
+              upstream_name: vf-cloudstore
+              branches: "master"
           template:
             type: workflow-scm
             concurrent: false
@@ -21,7 +46,7 @@
               credentials: "gerrit"
               script: git-mirror-2way-pipeline.groovy
               github:
-                url: "https://github.com/Mirantis/{{name}}-salt-model"
+                url: "https://github.com/Mirantis/{{upstream_name}}-salt-model"
             trigger:
               github:
               pollscm:
@@ -44,10 +69,10 @@
                 default: "${_param:jenkins_gerrit_url}/salt-models/{{name}}.git"
               TARGET_URL:
                 type: string
-                default: "git@github.com:Mirantis/{{name}}-salt-model.git"
+                default: "git@github.com:Mirantis/{{upstream_name}}-salt-model.git"
               CREDENTIALS_ID:
                 type: string
                 default: "gerrit"
               BRANCHES:
                 type: string
-                default: "master"
+                default: "{{branches}}"
diff --git a/jenkins/client/job/salt-models/tests.yml b/jenkins/client/job/salt-models/tests.yml
index 8837573..3b5f647 100644
--- a/jenkins/client/job/salt-models/tests.yml
+++ b/jenkins/client/job/salt-models/tests.yml
@@ -1,23 +1,40 @@
 parameters:
   _param:
+  jenkins_pollscm_spec: "0 1 * * *"
   jenkins:
     client:
       job_template:
         test_salt_model:
           name: test-salt-model-{{name}}
           jobs:
+            - name: aeg
+              extra_formulas: ""
+            - name: att-cicd
+              extra_formulas: ""
+            - name: mall
+              extra_formulas: ""
             - name: mcp-baremetal-lab
               extra_formulas: ""
             - name: mcp-virtual-lab
-              extra_formulas: "prometheus"
+              extra_formulas: "prometheus telegraf"
             - name: mk-ci
               extra_formulas: ""
             - name: qa
               extra_formulas: ""
+            - name: quickplay
+              extra_formulas: ""
+            - name: ril-jamnagar
+              extra_formulas: ""
+            - name: slovaktelekom
+              extra_formulas: ""
             - name: stacklight
               extra_formulas: ""
+            - name: statens
+              extra_formulas: ""
             - name: training
               extra_formulas: ""
+            - name: vf-cloudstore
+              extra_formulas: ""
           template:
             type: workflow-scm
             scm:
@@ -57,7 +74,7 @@
                 default: "gerrit"
               PARALLEL_NODE_GROUP_SIZE:
                 type: string
-                default: "3"
+                default: "1"
               # Salt master setup extra formulas
               EXTRA_FORMULAS:
                 type: string
@@ -99,7 +116,7 @@
         test_salt_model_cookiecutter:
           name: test-salt-model-cookiecutter-{{cookiecutter_template}}
           jobs:
-            - cookiecutter_template: cookiecutter-template
+            - cookiecutter_template: cookiecutter-templates
           template:
             type: workflow-scm
             concurrent: true
@@ -109,12 +126,19 @@
               credentials: "jenkins-mk"
               script: test-cookiecutter-reclass.groovy
             trigger:
+              pollscm:
+                spec: ${_param:jenkins_pollscm_spec}
               gerrit:
                 project:
                   mk/{{cookiecutter_template}}:
                     branches:
                       - master
                 event:
+                  patchset:
+                    - created:
+                        excludeDrafts: false
+                        excludeTrivialRebase: false
+                        excludeNoCodeChange: false
                   comment:
                     - addedContains:
                         commentAddedCommentContains: '(recheck|reverify)'
@@ -134,3 +158,6 @@
               RECLASS_MODEL_BRANCH:
                 type: string
                 default: master
+              PARALLEL_NODE_GROUP_SIZE:
+                type: string
+                default: "1"
diff --git a/jenkins/client/job/test_devops_portal.yml b/jenkins/client/job/test_devops_portal.yml
index 5cf4c79..abe2a36 100644
--- a/jenkins/client/job/test_devops_portal.yml
+++ b/jenkins/client/job/test_devops_portal.yml
@@ -46,6 +46,7 @@
               default: |
                 npm run lint
                 npm run test:unit
+                npm run test:functional
             DEFAULT_GIT_URL:
                 type: string
                 default: "${_param:jenkins_gerrit_url}/oss/devops-portal"
diff --git a/openssh/client/lab.yml b/openssh/client/lab.yml
index 26ac7f4..7a65847 100644
--- a/openssh/client/lab.yml
+++ b/openssh/client/lab.yml
@@ -38,13 +38,6 @@
           enabled: true
           user: ${linux:system:user:root}
           private_key: ${private_keys:lab}
-          known_hosts:
-          - ${known_hosts:git.tcpcloud.eu}
-  known_hosts:
-    git.tcpcloud.eu:
-      name: git.tcpcloud.eu
-      type: ecdsa
-      fingerprint: fc:77:72:6c:65:c0:e1:26:0d:68:b8:a8:4a:56:38:22
   private_keys:
     lab:
       type: rsa
diff --git a/rundeck/server/docker.yml b/rundeck/server/docker.yml
index 3406b6a..1c89f4f 100644
--- a/rundeck/server/docker.yml
+++ b/rundeck/server/docker.yml
@@ -2,6 +2,12 @@
   - service.rundeck.common
   - service.rundeck.server.single
 parameters:
+  _param:
+    rundeck_postgresql_username: rundeck
+    rundeck_postgresql_password: password
+    rundeck_postgresql_database: rundeck
+    rundeck_postgresql_host: ${_param:control_vip_address}
+    rundeck_postgresql_port: 5432
   rundeck:
     server:
       user:
@@ -9,6 +15,13 @@
         gid: 550
       home_dir: /srv/volumes/rundeck
       root_dir: /srv/volumes/rundeck
+      datasource:
+        engine: postgresql
+        host: ${_param:rundeck_postgresql_host}
+        port: ${_param:rundeck_postgresql_port}
+        username: ${_param:rundeck_postgresql_username}
+        password: ${_param:rundeck_postgresql_password}
+        database: ${_param:rundeck_postgresql_database}
       api:
         host: ${_param:haproxy_rundeck_bind_host}
         port: ${_param:haproxy_rundeck_bind_port}
diff --git a/xtrabackup/client/single.yml b/xtrabackup/client/single.yml
new file mode 100644
index 0000000..cbe1123
--- /dev/null
+++ b/xtrabackup/client/single.yml
@@ -0,0 +1,3 @@
+classes:
+- service.xtrabackup.client.single
+- system.openssh.client.root
\ No newline at end of file
diff --git a/xtrabackup/server/single.yml b/xtrabackup/server/single.yml
new file mode 100644
index 0000000..d1d54fd
--- /dev/null
+++ b/xtrabackup/server/single.yml
@@ -0,0 +1,2 @@
+classes:
+- service.xtrabackup.server.single