[submodule] Bump Pharos for maas:machines sync 15/61615/4
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Fri, 31 Aug 2018 00:16:08 +0000 (02:16 +0200)
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Thu, 6 Sep 2018 13:34:44 +0000 (15:34 +0200)
Drop duplicate maas:machines definitions which could cause conflicts
in rare corner cases.

Slightly refactor j2 template expansion to make `conf.virtual.nodes`
available during first stage.

Change-Id: I04d56e346b12c6eb97da5c0c0ab1e3446e5fc1b8
Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
ci/deploy.sh
mcp/reclass/classes/cluster/all-mcp-arch-common/infra/maas.yml.j2
mcp/scripts/lib_template.sh
mcp/scripts/pharos

index f64b3b8..b7d19d8 100755 (executable)
@@ -267,11 +267,11 @@ MCP_DPDK_MODE=$([[ "$DEPLOY_SCENARIO" =~ ovs ]] && echo 1 || echo 0)
 export MCP_REPO_ROOT_PATH MCP_VCP MCP_DPDK_MODE MCP_STORAGE_DIR \
        MCP_JUMP_ARCH=$(uname -i)
 do_templates_scenario "${MCP_STORAGE_DIR}" "${TARGET_LAB}" "${TARGET_POD}" \
-                      "${BASE_CONFIG_URI}" "${SCENARIO_DIR}"
+                      "${BASE_CONFIG_URI}" "${SCENARIO_DIR}" \
+                      "${SCENARIO_DIR}/${DEPLOY_SCENARIO}.yaml"
 do_templates_cluster  "${MCP_STORAGE_DIR}" "${TARGET_LAB}" "${TARGET_POD}" \
                       "${MCP_REPO_ROOT_PATH}" \
-                      "${SCENARIO_DIR}/defaults.yaml" \
-                      "${SCENARIO_DIR}/${DEPLOY_SCENARIO}.yaml"
+                      "${SCENARIO_DIR}/defaults.yaml"
 
 # Determine additional data (e.g. jump bridge names) based on XDF
 source "${DEPLOY_DIR}/xdf_data.sh"
index 7ee1aa1..ea97773 100644 (file)
@@ -106,37 +106,6 @@ parameters:
             =m+zE
             -----END PGP PUBLIC KEY BLOCK-----
 {%- endif %}
-      machines:
-      {%- set pxe_interface = conf.idf.net_config.admin.interface %}
-      {%- set ctl_roles = conf.virtual.nodes.control | length %}
-      {%- for node in conf.nodes %}
-      {%- if (node.node.type == 'baremetal' and (
-              loop.index > nm.cmp001.idx or loop.index0 < ctl_roles)) %}
-        {%- if loop.index > nm.cmp001.idx %}
-        cmp{{ '%03d' | format(loop.index - nm.cmp001.idx) }}:
-        {%- else %}
-        {{ conf.virtual.nodes.control[loop.index0] }}:
-        {%- endif %}
-          interface:
-            mac: {{ node.interfaces[pxe_interface].mac_address }}
-          power_parameters:
-            power_address: {{ node.remote_management.address.rsplit('/')[0] }}
-            power_password: {{ node.remote_management.pass }}
-            power_type: {{ node.remote_management.type }}
-            power_user: {{ node.remote_management.user }}
-          architecture: {{ node.node.arch | dpkg_arch }}/generic
-          distro_series: xenial
-          hwe_kernel: ${_param:hwe_kernel}
-          {%- if loop.index > nm.cmp001.idx %}
-          disk_layout:
-            type: lvm
-            root_device: sda
-            volume_group: vgroot
-            volume_name: lvroot
-            volume_size: 100
-          {%- endif %}
-      {%- endif %}
-      {%- endfor %}
       salt_master_ip: ${_param:reclass_config_master}
       domain: ${_param:cluster_domain}
       maas_config:
index 0cfc02f..daa0444 100644 (file)
@@ -23,7 +23,8 @@ function do_templates_scenario {
   local target_lab=$1; shift
   local target_pod=$1; shift
   local lab_config_uri=$1; shift
-  local scenario_dir=$1
+  local scenario_dir=$1; shift
+  local extra_yaml=("$@")
 
   BASE_CONFIG_PDF="${lab_config_uri}/labs/${target_lab}/${target_pod}.yaml"
   BASE_CONFIG_IDF="${lab_config_uri}/labs/${target_lab}/idf-${target_pod}.yaml"
@@ -49,6 +50,9 @@ function do_templates_scenario {
       notify_e "[ERROR] IDF does not match yaml schema!"
     fi
   fi
+  for _yaml in "${extra_yaml[@]}"; do
+    awk '/^---$/{f=1;next;}f' "${_yaml}" >> "${LOCAL_PDF}"
+  done
   if ! "${PHAROS_GEN_CFG}" -y "${LOCAL_PDF}" \
     -i "$(dirname "$(readlink -f "${PHAROS_IA}")")" \
     -j "${PHAROS_IA}" -v > "${image_dir}/pod_config.yml"; then
index 1b233cf..738497a 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 1b233cfbf7b42aaf951f175e9cf818d2b8428561
+Subproject commit 738497a53b80e3b770457b4160532274fd924388