diff options
author | Jenkins <jenkins@review.openstack.org> | 2017-01-16 23:27:02 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2017-01-16 23:27:02 +0000 |
commit | 7ec199d64e2eb23b084f32bb42a1e8802fbf9931 (patch) | |
tree | 5aab024a09ea0560cda2bb2677de4991a10a7af3 /extraconfig/all_nodes/swap-partition.j2.yaml | |
parent | e4d28996273ff6c8a1e53351b875686527898358 (diff) | |
parent | 92e203aab60eee1d7f99d244a3576f6c6363fa2e (diff) |
Merge "Fix for AllNodesExtraConfig and fix environment files to create swap files/partitions"
Diffstat (limited to 'extraconfig/all_nodes/swap-partition.j2.yaml')
-rw-r--r-- | extraconfig/all_nodes/swap-partition.j2.yaml | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/extraconfig/all_nodes/swap-partition.j2.yaml b/extraconfig/all_nodes/swap-partition.j2.yaml index ffd30327..b6fef79f 100644 --- a/extraconfig/all_nodes/swap-partition.j2.yaml +++ b/extraconfig/all_nodes/swap-partition.j2.yaml @@ -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 |