Merge "Adjust upgrade openstack control according to latest changes"
diff --git a/jenkins/client/job/image/centos.yml b/jenkins/client/job/image/centos.yml
deleted file mode 100644
index 5358d92..0000000
--- a/jenkins/client/job/image/centos.yml
+++ /dev/null
@@ -1,85 +0,0 @@
-classes:
-  - system.jenkins.client.job.image
-parameters:
-  _param:
-    jenkins_packer_pipeline: "${_param:jenkins_gerrit_url}/mk/packer-templates"
-  jenkins:
-    client:
-      job:
-        build-image-centos-7:
-          type: workflow-scm
-          concurrent: false
-          discard:
-            build:
-              keep_num: 5
-            artifact:
-              keep_num: 5
-          scm:
-            type: git
-            url: "${_param:jenkins_packer_pipeline}"
-            credentials: "gerrit"
-          display_name: "[Images] Build Centos 7"
-          param:
-            BUILD_OS:
-              type: string
-              default: "centos-7"
-            BUILD_ONLY:
-              type: string
-              default: "qemu"
-            PACKER_DEBUG:
-              type: boolean
-              default: "false"
-            PACKER_URL:
-              type: string
-              default: "https://releases.hashicorp.com/packer/0.8.6/packer_0.8.6_linux_amd64.zip"
-            PACKER_ZIP:
-              type: string
-              default: "packer_0.8.6_linux_amd64.zip"
-            PACKER_ZIP_MD5:
-              type: string
-              default: "4cda1c44cf666fada495dd8e01522e1c"
-            PACKER_ARGS:
-              type: string
-              default: ""
-            UPLOAD_URL:
-              type: string
-              default: "${_param:jenkins_packer_upload_url}"
-            SKIP_UPLOAD:
-              type: boolean
-              default: "false"
-            CLEANUP_OLD:
-              type: boolean
-              default: "true"
-            CLEANUP_KEEP:
-              type: string
-              default: "3"
-            GLANCE_UPLOAD:
-              type: boolean
-              default: "true"
-            GLANCE_IMG_TYPES:
-              type: string
-              default: "qcow2"
-            GLANCE_URL:
-              type: string
-              default: "https://cloud-cz.bud.mirantis.net:5000"
-            GLANCE_CREDENTIALS_ID:
-              type: string
-              default: "openstack-devcloud-credentials"
-            GLANCE_PROJECT:
-              type: string
-              default: "mcp-mk"
-            GLANCE_ARGS:
-              type: string
-              default: ""
-            GLANCE_PUBLIC:
-              type: boolean
-              default: "true"
-            OPENSTACK_API_CLIENT:
-              type: string
-              default: ""
-            IMAGE_NAME:
-              type: string
-              default: centos-7-x64
-            EXTRA_VARIABLES:
-              type: text
-              default: ""
\ No newline at end of file
diff --git a/jenkins/client/job/image/debian.yml b/jenkins/client/job/image/debian.yml
deleted file mode 100644
index eef4740..0000000
--- a/jenkins/client/job/image/debian.yml
+++ /dev/null
@@ -1,85 +0,0 @@
-classes:
-  - system.jenkins.client.job.image
-parameters:
-  _param:
-    jenkins_packer_pipeline: "${_param:jenkins_gerrit_url}/mk/packer-templates"
-  jenkins:
-    client:
-      job:
-        build-image-debian-8:
-          type: workflow-scm
-          concurrent: false
-          discard:
-            build:
-              keep_num: 5
-            artifact:
-              keep_num: 5
-          scm:
-            type: git
-            url: "${_param:jenkins_packer_pipeline}"
-            credentials: "gerrit"
-          display_name: "[Images] Build Debian 8 image"
-          param:
-            BUILD_OS:
-              type: string
-              default: "debian-8"
-            BUILD_ONLY:
-              type: string
-              default: "qemu"
-            PACKER_DEBUG:
-              type: boolean
-              default: "false"
-            PACKER_URL:
-              type: string
-              default: "https://releases.hashicorp.com/packer/0.8.6/packer_0.8.6_linux_amd64.zip"
-            PACKER_ZIP:
-              type: string
-              default: "packer_0.8.6_linux_amd64.zip"
-            PACKER_ZIP_MD5:
-              type: string
-              default: "4cda1c44cf666fada495dd8e01522e1c"
-            PACKER_ARGS:
-              type: string
-              default: ""
-            UPLOAD_URL:
-              type: string
-              default: "${_param:jenkins_packer_upload_url}"
-            SKIP_UPLOAD:
-              type: boolean
-              default: "false"
-            CLEANUP_OLD:
-              type: boolean
-              default: "true"
-            CLEANUP_KEEP:
-              type: string
-              default: "3"
-            GLANCE_UPLOAD:
-              type: boolean
-              default: "true"
-            GLANCE_IMG_TYPES:
-              type: string
-              default: "qcow2"
-            GLANCE_URL:
-              type: string
-              default: "https://cloud-cz.bud.mirantis.net:5000"
-            GLANCE_CREDENTIALS_ID:
-              type: string
-              default: "openstack-devcloud-credentials"
-            GLANCE_PROJECT:
-              type: string
-              default: "mcp-mk"
-            GLANCE_ARGS:
-              type: string
-              default: ""
-            GLANCE_PUBLIC:
-              type: boolean
-              default: "true"
-            OPENSTACK_API_CLIENT:
-              type: string
-              default: ""
-            IMAGE_NAME:
-              type: string
-              default: debian-8-x64
-            EXTRA_VARIABLES:
-              type: text
-              default: ""
diff --git a/jenkins/client/job/image/ubuntu.yml b/jenkins/client/job/image/ubuntu.yml
deleted file mode 100644
index e4a8251..0000000
--- a/jenkins/client/job/image/ubuntu.yml
+++ /dev/null
@@ -1,166 +0,0 @@
-classes:
-  - system.jenkins.client.job.image
-parameters:
-  _param:
-    jenkins_packer_pipeline: "${_param:jenkins_gerrit_url}/mk/packer-templates"
-  jenkins:
-    client:
-      job:
-        build-image-ubuntu-14-04:
-          type: workflow-scm
-          concurrent: false
-          discard:
-            build:
-              keep_num: 5
-              keep_days: 5
-            artifact:
-              keep_num: 6
-              keep_days: 6
-          scm:
-            type: git
-            url: "${_param:jenkins_packer_pipeline}"
-            credentials: "gerrit"
-          display_name: "[Images] Build Ubuntu 14.04 image"
-          param:
-            BUILD_OS:
-              type: string
-              default: "ubuntu-14.04"
-            BUILD_ONLY:
-              type: string
-              default: "qemu"
-            PACKER_DEBUG:
-              type: boolean
-              default: "false"
-            PACKER_URL:
-              type: string
-              default: "https://releases.hashicorp.com/packer/0.8.6/packer_0.8.6_linux_amd64.zip"
-            PACKER_ZIP:
-              type: string
-              default: "packer_0.8.6_linux_amd64.zip"
-            PACKER_ZIP_MD5:
-              type: string
-              default: "4cda1c44cf666fada495dd8e01522e1c"
-            PACKER_ARGS:
-              type: string
-              default: ""
-            UPLOAD_URL:
-              type: string
-              default: "${_param:jenkins_packer_upload_url}"
-            SKIP_UPLOAD:
-              type: boolean
-              default: "false"
-            CLEANUP_OLD:
-              type: boolean
-              default: "true"
-            CLEANUP_KEEP:
-              type: string
-              default: "3"
-            GLANCE_UPLOAD:
-              type: boolean
-              default: "true"
-            GLANCE_IMG_TYPES:
-              type: string
-              default: "qcow2"
-            GLANCE_URL:
-              type: string
-              default: "https://cloud-cz.bud.mirantis.net:5000"
-            GLANCE_CREDENTIALS_ID:
-              type: string
-              default: "openstack-devcloud-credentials"
-            GLANCE_PROJECT:
-              type: string
-              default: "mcp-mk"
-            GLANCE_ARGS:
-              type: string
-              default: ""
-            GLANCE_PUBLIC:
-              type: boolean
-              default: "true"
-            OPENSTACK_API_CLIENT:
-              type: string
-              default: ""
-            IMAGE_NAME:
-              type: string
-              default: ubuntu-14-04-x64
-            EXTRA_VARIABLES:
-              type: text
-              default: ""
-        build-image-ubuntu-16-04:
-          type: workflow-scm
-          concurrent: false
-          discard:
-            build:
-              keep_num: 5
-              keep_days: 5
-            artifact:
-              keep_num: 6
-              keep_days: 6
-          scm:
-            type: git
-            url: "${_param:jenkins_packer_pipeline}"
-            credentials: "gerrit"
-          display_name: "[Images] Build Ubuntu 16.04 image"
-          param:
-            BUILD_OS:
-              type: string
-              default: "ubuntu-16.04"
-            BUILD_ONLY:
-              type: string
-              default: "qemu"
-            PACKER_DEBUG:
-              type: boolean
-              default: "false"
-            PACKER_URL:
-              type: string
-              default: "https://releases.hashicorp.com/packer/0.8.6/packer_0.8.6_linux_amd64.zip"
-            PACKER_ZIP:
-              type: string
-              default: "packer_0.8.6_linux_amd64.zip"
-            PACKER_ZIP_MD5:
-              type: string
-              default: "4cda1c44cf666fada495dd8e01522e1c"
-            PACKER_ARGS:
-              type: string
-              default: ""
-            UPLOAD_URL:
-              type: string
-              default: "${_param:jenkins_packer_upload_url}"
-            SKIP_UPLOAD:
-              type: boolean
-              default: "false"
-            CLEANUP_OLD:
-              type: boolean
-              default: "true"
-            CLEANUP_KEEP:
-              type: string
-              default: "3"
-            GLANCE_UPLOAD:
-              type: boolean
-              default: "true"
-            GLANCE_IMG_TYPES:
-              type: string
-              default: "qcow2"
-            GLANCE_URL:
-              type: string
-              default: "https://cloud-cz.bud.mirantis.net:5000"
-            GLANCE_CREDENTIALS_ID:
-              type: string
-              default: "openstack-devcloud-credentials"
-            GLANCE_PROJECT:
-              type: string
-              default: "mcp-mk"
-            GLANCE_ARGS:
-              type: string
-              default: ""
-            GLANCE_PUBLIC:
-              type: boolean
-              default: "true"
-            OPENSTACK_API_CLIENT:
-              type: string
-              default: ""
-            IMAGE_NAME:
-              type: string
-              default: ubuntu-16-04-x64
-            EXTRA_VARIABLES:
-              type: text
-              default: ""
\ No newline at end of file
diff --git a/jenkins/client/job/salt-models/tests.yml b/jenkins/client/job/salt-models/tests.yml
index 983a88b..145cfa9 100644
--- a/jenkins/client/job/salt-models/tests.yml
+++ b/jenkins/client/job/salt-models/tests.yml
@@ -272,37 +272,39 @@
               COOKIECUTTER_TEMPLATE_URL:
                 type: string
                 default: "${_param:jenkins_gerrit_url}/mk/{{cookiecutter_template}}"
-              CREDENTIALS_ID:
-                type: string
-                default: gerrit
               COOKIECUTTER_TEMPLATE_BRANCH:
                 type: string
                 default: master
-              RECLASS_MODEL_URL:
+                description: "Those variable will be ignored, in case gerritTrigger=>GERRIT_BRANCH"
+              COOKIECUTTER_TEMPLATE_REF:
+                type: string
+                default: ""
+                description: "Example: refs/changes/49/25549/1"
+              RECLASS_SYSTEM_URL:
                 type: string
                 default: "${_param:jenkins_gerrit_url}/salt-models/reclass-system"
-              RECLASS_MODEL_BRANCH:
+              RECLASS_SYSTEM_BRANCH:
                 type: string
                 default: master
+                description: "Those variable will be ignored, in case gerritTrigger=>GERRIT_BRANCH"
+              RECLASS_SYSTEM_GIT_REF:
+                type: string
+                default: ""
+                description: "Example: refs/changes/49/25549/1"
               DISTRIB_REVISION:
                 type: string
                 default: 'nightly'
-              SYSTEM_GIT_URL:
-                type: string
-                default: ""
-              SYSTEM_GIT_REF:
-                type: string
-                default: ""
-              PARALLEL_NODE_GROUP_SIZE:
-                type: string
-                default: "1"
+                description: "Those variable will be ignored, in case gerritTrigger=>GERRIT_BRANCH. Version of bin-artifacts,passed to test-env"
               EXTRA_FORMULAS:
                 type: string
-                default: "aptly artifactory auditd backupninja collectd devops-portal docker elasticsearch fluentd freeipa gerrit glusterfs grafana haproxy heka horizon influxdb jenkins keepalived kibana libvirt maas memcached mysql nginx ntp openldap openssh postfix prometheus rsync rsyslog rundeck sensu sphinx telegraf xtrabackup watchdog logrotate"
+                default: "aptly artifactory auditd backupninja collectd devops-portal docker elasticsearch fluentd freeipa gerrit glusterfs grafana haproxy heka horizon influxdb jenkins keepalived kibana libvirt maas memcached mysql nginx ntp openldap openscap openssh postfix prometheus rsync rsyslog rundeck sensu sphinx telegraf xtrabackup watchdog logrotate"
               RECLASS_VERSION:
                 type: string
                 default: 'v1.5.4'
-                description: "Version (branch) of Reclass we will use"
+                description: "Version (branch) of reclass PACKAGE we will use"
+              CREDENTIALS_ID:
+                type: string
+                default: gerrit
       job:
         test-salt-model-node:
           name: test-salt-model-node
@@ -385,7 +387,7 @@
             build:
               keep_num: 300
             artifact:
-              keep_num: 30
+              keep_num: 300
           type: workflow-scm
           concurrent: true
           plugin_properties:
@@ -402,5 +404,5 @@
             script: test-cookiecutter-reclass-chunk.groovy
           param:
             EXTRA_VARIABLES_YAML:
-              type: string
+              type: text
               default: ""
diff --git a/openscap/server/init.yml b/openscap/server/init.yml
new file mode 100644
index 0000000..0f2a76f
--- /dev/null
+++ b/openscap/server/init.yml
@@ -0,0 +1,2 @@
+classes:
+- service.openscap.cis
diff --git a/salt/master/formula/git/openscap.yml b/salt/master/formula/git/openscap.yml
new file mode 100644
index 0000000..a091ffe
--- /dev/null
+++ b/salt/master/formula/git/openscap.yml
@@ -0,0 +1,10 @@
+parameters:
+  salt:
+    master:
+      environment:
+        dev:
+          formula:
+            openscap:
+              source: git
+              address: '${_param:salt_master_environment_repository}/salt-formula-openscap.git'
+              revision: ${_param:salt_master_environment_revision}
diff --git a/salt/master/formula/pkg/openscap.yml b/salt/master/formula/pkg/openscap.yml
new file mode 100644
index 0000000..ebb6e86
--- /dev/null
+++ b/salt/master/formula/pkg/openscap.yml
@@ -0,0 +1,9 @@
+parameters:
+  salt:
+    master:
+      environment:
+        prd:
+          formula:
+            openscap:
+              source: pkg
+              name: salt-formula-openscap