Disable cinder-backup by default
[apex-tripleo-heat-templates.git] / extraconfig / all_nodes / swap-partition.yaml
1 heat_template_version: 2014-10-16
2
3 description: >
4   Extra config to add swap space to nodes.
5
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.
9 parameters:
10   controller_servers:
11     type: json
12   compute_servers:
13     type: json
14   blockstorage_servers:
15     type: json
16   objectstorage_servers:
17     type: json
18   cephstorage_servers:
19     type: json
20   swap_partition_label:
21     type: string
22     description: Swap partition label
23     default: 'swap1'
24
25
26 resources:
27
28   SwapConfig:
29     type: OS::Heat::SoftwareConfig
30     properties:
31       group: script
32       config: |
33         #!/bin/bash
34         set -eux
35         swap_partition=$(realpath /dev/disk/by-label/$swap_partition_label)
36         swapon $swap_partition
37         echo "$swap_partition swap swap defaults 0 0" >> /etc/fstab
38       inputs:
39         - name: swap_partition_label
40           description: Swap partition label
41           default: 'swap1'
42
43   ControllerSwapDeployment:
44     type: OS::Heat::SoftwareDeploymentGroup
45     properties:
46       config: {get_resource: SwapConfig}
47       servers: {get_param: controller_servers}
48       input_values:
49         swap_partition_label: {get_param: swap_partition_label}
50       actions: ["CREATE"]
51
52   ComputeSwapDeployment:
53     type: OS::Heat::SoftwareDeploymentGroup
54     properties:
55       config: {get_resource: SwapConfig}
56       servers: {get_param: compute_servers}
57       input_values:
58         swap_partition_label: {get_param: swap_partition_label}
59       actions: ["CREATE"]
60
61   BlockStorageSwapDeployment:
62     type: OS::Heat::SoftwareDeploymentGroup
63     properties:
64       config: {get_resource: SwapConfig}
65       servers: {get_param: blockstorage_servers}
66       input_values:
67         swap_partition_label: {get_param: swap_partition_label}
68       actions: ["CREATE"]
69
70   ObjectStorageSwapDeployment:
71     type: OS::Heat::SoftwareDeploymentGroup
72     properties:
73       config: {get_resource: SwapConfig}
74       servers: {get_param: objectstorage_servers}
75       input_values:
76         swap_partition_label: {get_param: swap_partition_label}
77       actions: ["CREATE"]
78
79   CephStorageSwapDeployment:
80     type: OS::Heat::SoftwareDeploymentGroup
81     properties:
82       config: {get_resource: SwapConfig}
83       servers: {get_param: cephstorage_servers}
84       input_values:
85         swap_partition_label: {get_param: swap_partition_label}
86       actions: ["CREATE"]