1 heat_template_version: ocata
3 description: Template file to add a swap file to a node.
10 description: Amount of swap space to allocate in megabytes
14 description: Full path to location of swap file
19 type: OS::Heat::SoftwareConfig
25 if [ ! -f $swap_path ]; then
26 dd if=/dev/zero of=$swap_path count=$swap_size_megabytes bs=1M
31 echo "$swap_path already exists"
33 echo "$swap_path swap swap defaults 0 0" >> /etc/fstab
35 - name: swap_size_megabytes
36 description: Amount of swap space to allocate in megabytes
39 description: Full path to location of swap file
42 {% for role in roles %}
43 {{role.name}}SwapDeployment:
44 type: OS::Heat::SoftwareDeploymentGroup
46 config: {get_resource: SwapConfig}
47 servers: {get_param: [servers, {{role.name}}]}
49 swap_size_megabytes: {get_param: swap_size_megabytes}
50 swap_path: {get_param: swap_path}