1 heat_template_version: ocata
4 Extra config to add swap space to nodes.
6 # Parameters passed from the parent template - note if you maintain
7 # out-of-tree templates they may require additional parameters if the
8 # in-tree templates add a new role.
14 description: Amount of swap space to allocate in megabytes
18 description: Full path to location of swap file
25 type: OS::Heat::SoftwareConfig
31 if [ ! -f $swap_path ]; then
32 dd if=/dev/zero of=$swap_path count=$swap_size_megabytes bs=1M
37 echo "$swap_path already exists"
39 echo "$swap_path swap swap defaults 0 0" >> /etc/fstab
41 - name: swap_size_megabytes
42 description: Amount of swap space to allocate in megabytes
45 description: Full path to location of swap file
48 {% for role in roles %}
49 {{role.name}}SwapDeployment:
50 type: OS::Heat::SoftwareDeploymentGroup
52 config: {get_resource: SwapConfig}
53 servers: {get_param: [servers, {{role.name}}]}
55 swap_size_megabytes: {get_param: swap_size_megabytes}
56 swap_path: {get_param: swap_path}