Merge "Fix for AllNodesExtraConfig and fix environment files to create swap files/partitions"

This commit is contained in:
Jenkins 2017-01-16 23:27:02 +00:00 committed by Gerrit Code Review
commit 7ec199d64e
5 changed files with 17 additions and 17 deletions

View File

@ -0,0 +1,3 @@
# Use this environment to create a swap partition in all Overcloud nodes
resource_registry:
OS::TripleO::AllNodesExtraConfig: ../extraconfig/all_nodes/swap-partition.yaml

View File

@ -0,0 +1,3 @@
# Use this environment to create a swap file in all Overcloud nodes
resource_registry:
OS::TripleO::AllNodesExtraConfig: ../extraconfig/all_nodes/swap.yaml

View File

@ -1,11 +1,7 @@
heat_template_version: ocata
description: >
Extra config to add swap space to nodes.
description: Template file to add a swap partition to a node.
# Parameters passed from the parent template - note if you maintain
# out-of-tree templates they may require additional parameters if the
# in-tree templates add a new role.
parameters:
servers:
type: json
@ -14,9 +10,7 @@ parameters:
description: Swap partition label
default: 'swap1'
resources:
SwapConfig:
type: OS::Heat::SoftwareConfig
properties:
@ -25,8 +19,13 @@ resources:
#!/bin/bash
set -eux
swap_partition=$(realpath /dev/disk/by-label/$swap_partition_label)
swapon $swap_partition
echo "$swap_partition swap swap defaults 0 0" >> /etc/fstab
if [ -f "$swap_partition" ]; then
swapon $swap_partition
echo "$swap_partition swap swap defaults 0 0" >> /etc/fstab
else
echo "$swap_partition needs to be a valid path"
echo "Check that $swap_partition_label is a valid partition label"
fi
inputs:
- name: swap_partition_label
description: Swap partition label

View File

@ -1,11 +1,7 @@
heat_template_version: ocata
description: >
Extra config to add swap space to nodes.
description: Template file to add a swap file to a node.
# Parameters passed from the parent template - note if you maintain
# out-of-tree templates they may require additional parameters if the
# in-tree templates add a new role.
parameters:
servers:
type: json
@ -18,9 +14,7 @@ parameters:
description: Full path to location of swap file
default: '/swap'
resources:
SwapConfig:
type: OS::Heat::SoftwareConfig
properties:

View File

@ -593,8 +593,9 @@ resources:
- {{role.name}}AllNodesValidationDeployment
{% endfor %}
properties:
servers:
{% for role in roles %}
servers: {get_attr: [{{role.name}}, attributes, nova_server_resource]}
{{role.name}}: {get_attr: [{{role.name}}, attributes, nova_server_resource]}
{% endfor %}
# Upgrade steps for all roles