Merge "Move 'linux_system_repo_*_url' to defaults"
diff --git a/defaults/init.yml b/defaults/init.yml
index 1d4eafd..f17e399 100644
--- a/defaults/init.yml
+++ b/defaults/init.yml
@@ -1,5 +1,11 @@
+classes:
+- system.defaults.linux_system_repo
 parameters:
 # Transition in progress.
 # Please ignore 'G' transition marker - it uses only for internal purposes
   _param:
-    apt_mk_version: 'stable'
+    apt_mk_version: "stable"
+    linux_system_architecture: 'amd64'
+    linux_system_repo_url: "http://mirror.mirantis.com/${_param:apt_mk_version}/"
+    # Openstack
+    openstack_version: 'pike'
diff --git a/defaults/linux_system_repo.yml b/defaults/linux_system_repo.yml
new file mode 100644
index 0000000..b59437d
--- /dev/null
+++ b/defaults/linux_system_repo.yml
@@ -0,0 +1,36 @@
+parameters:
+  _param:
+    # Global
+    linux_repo_refresh_db: true
+    linux_system_repo_url: "http://mirror.mirantis.com/${_param:apt_mk_version}/"
+    # Global-updates
+    linux_system_repo_update_ubuntu_url: ${_param:linux_system_repo_update_url}/ubuntu/
+    linux_system_repo_update_url: ${_param:linux_system_repo_url}/update/${_param:apt_mk_version}/
+    # Global-hotfix
+    linux_system_repo_hotfix_ubuntu_url: ${_param:linux_system_repo_hotfix_url}/ubuntu/
+    linux_system_repo_hotfix_url: ${_param:linux_system_repo_url}/hotfix/${_param:apt_mk_version}/
+
+    # Per repos
+    linux_system_repo_mcp_aptly_url: ${_param:linux_system_repo_url}/aptly/
+    linux_system_repo_mcp_cassandra_url: ${_param:linux_system_repo_url}/cassandra/
+    linux_system_repo_mcp_docker_legacy_url: ${_param:linux_system_repo_url}/docker-1.x/
+    linux_system_repo_mcp_docker_url: ${_param:linux_system_repo_url}/docker/
+    linux_system_repo_mcp_elasticsearch_curator_url: ${_param:linux_system_repo_url}/elasticsearch-curator-5/
+    linux_system_repo_mcp_elasticsearch_url: ${_param:linux_system_repo_url}/elasticsearch-5.x/
+    linux_system_repo_mcp_extra_url: ${_param:linux_system_repo_url}/extra/
+    linux_system_repo_mcp_glusterfs_url: ${_param:linux_system_repo_url}/glusterfs-${_param:linux_system_repo_mcp_glusterfs_version_number}/
+    linux_system_repo_mcp_influxdb_url: ${_param:linux_system_repo_url}/influxdb
+    linux_system_repo_mcp_jenkins_url: ${_param:linux_system_repo_url}/jenkins/
+    linux_system_repo_mcp_maas_url: ${_param:linux_system_repo_url}/maas/
+    linux_system_repo_mcp_percona_url: ${_param:linux_system_repo_url}/percona/
+    linux_system_repo_mcp_saltstack_url: ${_param:linux_system_repo_url}/saltstack-${_param:linux_system_repo_mcp_saltstack_version_number}/
+    linux_system_repo_mirantis_openstack_url: ${_param:linux_system_repo_url}/openstack-${_param:openstack_version}/
+    linux_system_repo_ubuntu_url: ${_param:linux_system_repo_url}/ubuntu/
+
+
+    # Repo-component versions (if applicable)
+    salt_version: 2017.7 # TODO should be deprecated after q4
+    linux_system_repo_mcp_cassandra_version: '21x'
+    linux_system_repo_mcp_glusterfs_version_number: "3.8"
+    linux_system_repo_mcp_saltstack_version_number: "${_param:salt_version}"
+    linux_system_repo_mcp_ceph_codename: 'luminous'
diff --git a/linux/system/repo/mcp/apt_mirantis/aptly.yml b/linux/system/repo/mcp/apt_mirantis/aptly.yml
index 8cbccda..e06597c 100644
--- a/linux/system/repo/mcp/apt_mirantis/aptly.yml
+++ b/linux/system/repo/mcp/apt_mirantis/aptly.yml
@@ -1,9 +1,6 @@
 classes:
 - system.linux.system.repo.keystorage.aptly
 parameters:
-  _param:
-    linux_system_repo_url: http://mirror.mirantis.com/${_param:apt_mk_version}/
-    linux_system_repo_mcp_aptly_url: ${_param:linux_system_repo_url}/aptly/
   linux:
     system:
       repo:
diff --git a/linux/system/repo/mcp/apt_mirantis/cassandra.yml b/linux/system/repo/mcp/apt_mirantis/cassandra.yml
index 29684e2..9b651fa 100644
--- a/linux/system/repo/mcp/apt_mirantis/cassandra.yml
+++ b/linux/system/repo/mcp/apt_mirantis/cassandra.yml
@@ -1,10 +1,6 @@
 classes:
 - system.linux.system.repo.keystorage.cassandra
 parameters:
-  _param:
-    linux_system_repo_mcp_cassandra_version: '21x'
-    linux_system_repo_url: http://mirror.mirantis.com/${_param:apt_mk_version}/
-    linux_system_repo_mcp_cassandra_url: ${_param:linux_system_repo_url}/cassandra/
   linux:
     system:
       repo:
diff --git a/linux/system/repo/mcp/apt_mirantis/docker.yml b/linux/system/repo/mcp/apt_mirantis/docker.yml
index fe9f5db..82411c5 100644
--- a/linux/system/repo/mcp/apt_mirantis/docker.yml
+++ b/linux/system/repo/mcp/apt_mirantis/docker.yml
@@ -1,9 +1,6 @@
 classes:
 - system.linux.system.repo.keystorage.docker
 parameters:
-  _param:
-    linux_system_repo_url: http://mirror.mirantis.com/${_param:apt_mk_version}/
-    linux_system_repo_mcp_docker_url: ${_param:linux_system_repo_url}/docker/
   linux:
     system:
       repo:
diff --git a/linux/system/repo/mcp/apt_mirantis/docker_legacy.yml b/linux/system/repo/mcp/apt_mirantis/docker_legacy.yml
index 045b8c7..acb0a5c 100644
--- a/linux/system/repo/mcp/apt_mirantis/docker_legacy.yml
+++ b/linux/system/repo/mcp/apt_mirantis/docker_legacy.yml
@@ -1,9 +1,6 @@
 classes:
 - system.linux.system.repo.keystorage.docker_legacy
 parameters:
-  _param:
-    linux_system_repo_url: http://mirror.mirantis.com/${_param:apt_mk_version}/
-    linux_system_repo_mcp_docker_legacy_url: ${_param:linux_system_repo_url}/docker-1.x/
   linux:
     system:
       repo:
diff --git a/linux/system/repo/mcp/apt_mirantis/elastic/es.yml b/linux/system/repo/mcp/apt_mirantis/elastic/es.yml
index 1767112..c0d75d8 100644
--- a/linux/system/repo/mcp/apt_mirantis/elastic/es.yml
+++ b/linux/system/repo/mcp/apt_mirantis/elastic/es.yml
@@ -1,9 +1,6 @@
 classes:
 - system.linux.system.repo.keystorage.elasticsearch
 parameters:
-  _param:
-    linux_system_repo_url: http://mirror.mirantis.com/${_param:apt_mk_version}/
-    linux_system_repo_mcp_elasticsearch_url: ${_param:linux_system_repo_url}/elasticsearch-5.x/
   linux:
     system:
       repo:
diff --git a/linux/system/repo/mcp/apt_mirantis/elastic/es_curator.yml b/linux/system/repo/mcp/apt_mirantis/elastic/es_curator.yml
index ac049d9..4d1ce8c 100644
--- a/linux/system/repo/mcp/apt_mirantis/elastic/es_curator.yml
+++ b/linux/system/repo/mcp/apt_mirantis/elastic/es_curator.yml
@@ -1,9 +1,6 @@
 classes:
 - system.linux.system.repo.keystorage.elasticsearch
 parameters:
-  _param:
-    linux_system_repo_url: http://mirror.mirantis.com/${_param:apt_mk_version}/
-    linux_system_repo_mcp_elasticsearch_curator_url: ${_param:linux_system_repo_url}/elasticsearch-curator-5/
   linux:
     system:
       repo:
diff --git a/linux/system/repo/mcp/apt_mirantis/extra.yml b/linux/system/repo/mcp/apt_mirantis/extra.yml
index 5523f55..94c1d14 100644
--- a/linux/system/repo/mcp/apt_mirantis/extra.yml
+++ b/linux/system/repo/mcp/apt_mirantis/extra.yml
@@ -1,10 +1,6 @@
 classes:
 - system.linux.system.repo.keystorage.mirantis_com
 parameters:
-  _param:
-    linux_system_architecture: 'amd64'
-    linux_system_repo_url: http://mirror.mirantis.com/${_param:apt_mk_version}/
-    linux_system_repo_mcp_extra_url: ${_param:linux_system_repo_url}/extra/
   linux:
     system:
       repo:
diff --git a/linux/system/repo/mcp/apt_mirantis/glusterfs.yml b/linux/system/repo/mcp/apt_mirantis/glusterfs.yml
index c97d903..1bb025f 100644
--- a/linux/system/repo/mcp/apt_mirantis/glusterfs.yml
+++ b/linux/system/repo/mcp/apt_mirantis/glusterfs.yml
@@ -1,10 +1,6 @@
 classes:
 - system.linux.system.repo.keystorage.glusterfs
 parameters:
-  _param:
-    linux_system_repo_mcp_glusterfs_version_number: "3.8"
-    linux_system_repo_url: http://mirror.mirantis.com/${_param:apt_mk_version}/
-    linux_system_repo_mcp_glusterfs_url: ${_param:linux_system_repo_url}/glusterfs-${_param:linux_system_repo_mcp_glusterfs_version_number}/
   linux:
     system:
       repo:
diff --git a/linux/system/repo/mcp/apt_mirantis/hotfix/ubuntu.yml b/linux/system/repo/mcp/apt_mirantis/hotfix/ubuntu.yml
index 77d5202..fb5ad73 100644
--- a/linux/system/repo/mcp/apt_mirantis/hotfix/ubuntu.yml
+++ b/linux/system/repo/mcp/apt_mirantis/hotfix/ubuntu.yml
@@ -1,22 +1,19 @@
 parameters:
-  _param:
-    linux_system_repo_hotfix_url: http://mirror.mirantis.com/hotfix/${_param:apt_mk_version}/
-    linux_system_repo_hotfix_ubuntu_url: ${_param:linux_system_repo_hotfix_url}/ubuntu/
   linux:
     system:
       repo:
 #        ubuntu_hotfix:
 #          refresh_db: ${_param:linux_repo_refresh_db}
 #          source: "deb [arch=amd64] ${_param:linux_system_repo_hotfix_ubuntu_url} ${_param:linux_system_codename} main restricted universe"
-#          architectures: amd64
+#          architectures: ${_param:linux_system_architecture
 #          default: true
 #        ubuntu_updates_hotfix:
 #          refresh_db: ${_param:linux_repo_refresh_db}
 #          source: "deb [arch=amd64] ${_param:linux_system_repo_hotfix_ubuntu_url} ${_param:linux_system_codename}-updates main restricted universe"
-#          architectures: amd64
+#          architectures: ${_param:linux_system_architecture
 #          default: true
         ubuntu_security_hotfix:
           refresh_db: ${_param:linux_repo_refresh_db}
           source: "deb [arch=amd64] ${_param:linux_system_repo_hotfix_ubuntu_url} ${_param:linux_system_codename}-security main restricted universe"
-          architectures: amd64
+          architectures: ${_param:linux_system_architecture}
           default: true
diff --git a/linux/system/repo/mcp/apt_mirantis/influxdb.yml b/linux/system/repo/mcp/apt_mirantis/influxdb.yml
index 610b6b7..b86d461 100644
--- a/linux/system/repo/mcp/apt_mirantis/influxdb.yml
+++ b/linux/system/repo/mcp/apt_mirantis/influxdb.yml
@@ -1,9 +1,6 @@
 classes:
 - system.linux.system.repo.keystorage.influxdb
 parameters:
-  _param:
-    linux_system_repo_url: http://mirror.mirantis.com/${_param:apt_mk_version}/
-    linux_system_repo_mcp_influxdb_url: ${_param:linux_system_repo_url}/influxdb/
   linux:
     system:
       repo:
diff --git a/linux/system/repo/mcp/apt_mirantis/jenkins.yml b/linux/system/repo/mcp/apt_mirantis/jenkins.yml
index 7e4a6a9..55cebad 100644
--- a/linux/system/repo/mcp/apt_mirantis/jenkins.yml
+++ b/linux/system/repo/mcp/apt_mirantis/jenkins.yml
@@ -1,9 +1,6 @@
 classes:
 - system.linux.system.repo.keystorage.jenkins
 parameters:
-  _param:
-    linux_system_repo_url: http://mirror.mirantis.com/${_param:apt_mk_version}/
-    linux_system_repo_mcp_jenkins_url: ${_param:linux_system_repo_url}/jenkins/
   linux:
     system:
       repo:
diff --git a/linux/system/repo/mcp/apt_mirantis/maas.yml b/linux/system/repo/mcp/apt_mirantis/maas.yml
index 3a533b0..228eec4 100644
--- a/linux/system/repo/mcp/apt_mirantis/maas.yml
+++ b/linux/system/repo/mcp/apt_mirantis/maas.yml
@@ -1,9 +1,6 @@
 classes:
 - system.linux.system.repo.keystorage.maas
 parameters:
-  _param:
-    linux_system_repo_url: http://mirror.mirantis.com/${_param:apt_mk_version}/
-    linux_system_repo_mcp_maas_url: ${_param:linux_system_repo_url}/maas/
   linux:
     system:
       repo:
diff --git a/linux/system/repo/mcp/apt_mirantis/percona.yml b/linux/system/repo/mcp/apt_mirantis/percona.yml
index f6377ea..457cc43 100644
--- a/linux/system/repo/mcp/apt_mirantis/percona.yml
+++ b/linux/system/repo/mcp/apt_mirantis/percona.yml
@@ -1,9 +1,6 @@
 classes:
 - system.linux.system.repo.keystorage.percona
 parameters:
-  _param:
-    linux_system_repo_url: http://mirror.mirantis.com/${_param:apt_mk_version}/
-    linux_system_repo_mcp_percona_url: ${_param:linux_system_repo_url}/percona/
   linux:
     system:
       repo:
diff --git a/linux/system/repo/mcp/apt_mirantis/saltstack.yml b/linux/system/repo/mcp/apt_mirantis/saltstack.yml
index 7e18c2e..2d4dd2c 100644
--- a/linux/system/repo/mcp/apt_mirantis/saltstack.yml
+++ b/linux/system/repo/mcp/apt_mirantis/saltstack.yml
@@ -1,17 +1,13 @@
 classes:
 - system.linux.system.repo.keystorage.saltstack
 parameters:
-  _param:
-    salt_version: 2017.7
-    linux_system_repo_url: http://mirror.mirantis.com/${_param:apt_mk_version}/
-    linux_system_repo_mcp_saltstack_url: ${_param:linux_system_repo_url}/saltstack-${_param:salt_version}/
   linux:
     system:
       repo:
         mcp_saltstack:
           source: "deb [arch=amd64] ${_param:linux_system_repo_mcp_saltstack_url}/${_param:linux_system_codename}/ ${_param:linux_system_codename} main"
           key: ${_param:linux_system_repo_mcp_saltstack_key}
-          architectures: amd64
+          architectures: ${_param:linux_system_architecture}
           clean_file: true
           pinning:
             10:
diff --git a/linux/system/repo/mcp/apt_mirantis/saltstack_2016_3.yml b/linux/system/repo/mcp/apt_mirantis/saltstack_2016_3.yml
index 978d9a4..3445cf6 100644
--- a/linux/system/repo/mcp/apt_mirantis/saltstack_2016_3.yml
+++ b/linux/system/repo/mcp/apt_mirantis/saltstack_2016_3.yml
@@ -6,4 +6,4 @@
 - system.linux.system.repo.mcp.apt_mirantis.saltstack
 parameters:
   _param:
-    salt_version: 2016.3
+    linux_system_repo_mcp_saltstack_version_number: 2016.3
diff --git a/linux/system/repo/mcp/apt_mirantis/ubuntu.yml b/linux/system/repo/mcp/apt_mirantis/ubuntu.yml
index 1a1d5f1..15dabab 100644
--- a/linux/system/repo/mcp/apt_mirantis/ubuntu.yml
+++ b/linux/system/repo/mcp/apt_mirantis/ubuntu.yml
@@ -1,10 +1,6 @@
 classes:
 - system.linux.system.repo.keystorage.ubuntu
 parameters:
-  _param:
-    linux_repo_refresh_db: true
-    linux_system_repo_url: http://mirror.mirantis.com/${_param:apt_mk_version}/
-    linux_system_repo_ubuntu_url: ${_param:linux_system_repo_url}/ubuntu/
   linux:
     system:
       repo:
diff --git a/linux/system/repo/mcp/apt_mirantis/update/ubuntu.yml b/linux/system/repo/mcp/apt_mirantis/update/ubuntu.yml
index d58ff85..07e95da 100644
--- a/linux/system/repo/mcp/apt_mirantis/update/ubuntu.yml
+++ b/linux/system/repo/mcp/apt_mirantis/update/ubuntu.yml
@@ -1,7 +1,4 @@
 parameters:
-  _param:
-    linux_system_repo_update_url: http://mirror.mirantis.com/update/${_param:apt_mk_version}/
-    linux_system_repo_update_ubuntu_url: ${_param:linux_system_repo_update_url}/ubuntu/
   linux:
     system:
       repo:
diff --git a/linux/system/repo/mcp/mirror/v1/openstack.yml b/linux/system/repo/mcp/mirror/v1/openstack.yml
index 66a5530..8a9a3a7 100644
--- a/linux/system/repo/mcp/mirror/v1/openstack.yml
+++ b/linux/system/repo/mcp/mirror/v1/openstack.yml
@@ -1,10 +1,6 @@
 classes:
 - system.linux.system.repo.keystorage.mirantis_com
 parameters:
-  _param:
-    linux_system_architecture: 'amd64'
-    linux_system_repo_url: http://mirror.mirantis.com/${_param:apt_mk_version}/
-    linux_system_repo_mirantis_openstack_url: ${_param:linux_system_repo_url}/openstack-${_param:openstack_version}/
   linux:
     system:
       repo:
diff --git a/maas/region/cluster.yml b/maas/region/cluster.yml
index ff6dac5..3ec995b 100644
--- a/maas/region/cluster.yml
+++ b/maas/region/cluster.yml
@@ -5,7 +5,6 @@
 parameters:
   _param:
     cluster_vip_address: 10.0.175.80
-    linux_system_repo_mcp_saltstack_url: http://mirror.mirantis.com/${_param:apt_mk_version}/saltstack-2017.7/
   maas:
     cluster:
       enabled: true