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