Puppet: Swift Storage node support
[apex-tripleo-heat-templates.git] / swift-storage-puppet.yaml
1 heat_template_version: 2014-10-16
2 description: 'Common Swift Storage Configuration'
3 parameters:
4   #FIXME: this should not be required.
5   ControllerIP:
6     default: ''
7     type: string
8   Flavor:
9     description: Flavor for Swift storage nodes to request when deploying.
10     type: string
11     constraints:
12       - custom_constraint: nova.flavor
13   HashSuffix:
14     default: unset
15     description: A random string to be used as a salt when hashing to determine mappings
16       in the ring.
17     hidden: true
18     type: string
19   Image:
20     default: overcloud-swift-storage
21     type: string
22   KeyName:
23     default: default
24     description: Name of an existing EC2 KeyPair to enable SSH access to the instances
25     type: string
26   MountCheck:
27     default: 'false'
28     description: Value of mount_check in Swift account/container/object -server.conf
29     type: boolean
30   #FIXME: this is is not required. Leaving here for compatability with the overcloud template.
31   NeutronEnableTunnelling:
32     default: "True"
33     type: string
34   #FIXME: this is is not required. Leaving here for compatability with the overcloud template.
35   NeutronNetworkType:
36     default: gre
37     type: string
38   MinPartHours:
39     type: number
40     default: 1
41     description: The minimum time (in hours) before a partition in a ring can be moved following a rebalance.
42   PartPower:
43     default: 10
44     description: Partition Power to use when building Swift rings
45     type: number
46   #FIXME: this is is not required. Leaving here for compatability with the overcloud template.
47   Password:
48     default: unset
49     description: The password for the swift service account, used by the swift proxy
50       services.
51     hidden: true
52     type: string
53   Replicas:
54     type: number
55     default: 1
56     description: How many replicas to use in the swift rings.
57   SnmpdReadonlyUserName:
58     default: ro_snmp_user
59     description: The user name for SNMPd with readonly rights running on all Overcloud nodes
60     type: string
61   SnmpdReadonlyUserPassword:
62     default: unset
63     description: The user password for SNMPd with readonly rights running on all Overcloud nodes
64     type: string
65     hidden: true
66
67 resources:
68
69   SwiftStorage:
70     type: OS::Nova::Server
71     properties:
72       image: {get_param: Image}
73       flavor: {get_param: Flavor}
74       key_name: {get_param: KeyName}
75       user_data_format: SOFTWARE_CONFIG
76       networks:
77         - network: ctlplane
78
79   StoragePuppetConfig:
80     type: OS::Heat::SoftwareConfig
81     properties:
82       group: puppet
83       outputs:
84       - name: result
85       config:
86         get_file: puppet/overcloud_object.pp
87
88   StoragePuppetDeployment:
89     type: OS::Heat::StructuredDeployment
90     properties:
91       name: puppet_1
92       server: {get_resource: SwiftStorage}
93       config: {get_resource: StoragePuppetConfig}
94
95   StorageRingbuilderPuppetConfig:
96     type: OS::Heat::SoftwareConfig
97     properties:
98       group: puppet
99       outputs:
100       - name: result
101       config:
102         get_file: puppet/ringbuilder.pp
103
104   StorageRingbuilderPuppetDeployment:
105     type: OS::Heat::StructuredDeployment
106     properties:
107       name: puppet_2
108       server: {get_resource: SwiftStorage}
109       config: {get_resource: StorageRingbuilderPuppetConfig}
110
111   SwiftStorageHieraConfig:
112     type: OS::Heat::StructuredConfig
113     properties:
114       group: os-apply-config
115       config:
116         hiera:
117           hierarchy:
118             - heat_config_%{::deploy_config_name}
119             - object
120             - common
121           datafiles:
122             common:
123               raw_data: {get_file: puppet/hieradata/common.yaml}
124             object:
125               raw_data: {get_file: puppet/hieradata/object.yaml}
126               oac_data: # data we map in from other OAC configurations
127                 tripleo::ringbuilder::devices: swift.devices
128               mapped_data: # data supplied directly to this deployment configuration, etc
129                 swift::swift_hash_suffix: { get_input: swift_hash_suffix }
130                 tripleo::ringbuilder::part_power: { get_input: swift_part_power }
131                 tripleo::ringbuilder::replicas: {get_input: swift_replicas }
132                 # Swift
133                 swift::storage::all::storage_local_net_ip: {get_input: local_ip}
134                 swift_mount_check: {get_input: swift_mount_check }
135                 tripleo::ringbuilder::min_part_hours: { get_input: swift_min_part_hours }
136                 # NOTE(dprince): build_ring support is currently not wired in.
137                 # See: https://review.openstack.org/#/c/109225/
138                 tripleo::ringbuilder::build_ring: True
139
140
141   SwiftStorageHieraDeploy:
142     type: OS::Heat::StructuredDeployment
143     properties:
144       server: {get_resource: SwiftStorage}
145       config: {get_resource: SwiftStorageHieraConfig}
146       signal_transport: NO_SIGNAL
147       input_values:
148         local_ip: {get_attr: [SwiftStorage, networks, ctlplane, 0]}
149         snmpd_readonly_user_name: {get_param: SnmpdReadonlyUserName}
150         snmpd_readonly_user_password: {get_param: SnmpdReadonlyUserPassword}
151         swift_hash_suffix: {get_param: HashSuffix}
152         swift_mount_check: {get_param: MountCheck}
153         swift_min_part_hours: {get_param: MinPartHours}
154         swift_part_power: {get_param: PartPower}
155         swift_replicas: { get_param: Replicas}
156
157 outputs:
158   hosts_entry:
159     value:
160       str_replace:
161         template: "IP HOST HOST.novalocal"
162         params:
163           IP: {get_attr: [SwiftStorage, networks, ctlplane, 0]}
164           HOST: {get_attr: [SwiftStorage, name]}
165   nova_server_resource:
166     description: Heat resource handle for the swift storage server
167     value:
168       {get_resource: SwiftStorage}
169   swift_device:
170     description: Swift device formatted for swift-ring-builder
171     value:
172       str_replace:
173         template: 'r1z1-IP:%PORT%/d1'
174         params:
175           IP: {get_attr: [SwiftStorage, networks, ctlplane, 0]}