Add username parameter for rabbit
[apex-tripleo-heat-templates.git] / nova-compute-instance.yaml
1 HeatTemplateFormatVersion: '2012-12-12'
2 Description: 'Nova Compute'
3 Parameters:
4   AdminPassword:
5     Default: unset
6     Description: The password for the keystone admin account, used for monitoring, querying neutron etc.
7     Type: String
8     NoEcho: true
9   KeyName: 
10     Description: Name of an existing EC2 KeyPair to enable SSH access to the instances
11     Type: String
12     Default: default
13   Flavor:
14     Description: Use this flavor
15     Type: String
16     Default: baremetal
17   ImageUpdatePolicy:
18     Default: 'REPLACE'
19     Description: What policy to use when reconstructing instances. REBUILD for rebuilds, REBUILD_PRESERVE_EPHEMERAL to preserve /mnt.
20     Type: String
21   NovaImage:
22     Type: String
23     Default: overcloud-compute
24   KeystoneHost:
25     Type: String
26   NeutronFlatNetworks:
27     Type: String
28     Default: ''
29     Description: If set, flat networks to configure in neutron plugins.
30   NeutronHost:
31     Type: String
32   NeutronPhysicalBridge:
33     Default: ''
34     Description: An OVS bridge to create for accessing external networks.
35     Type: String
36   NeutronPublicInterface:
37     Default: ''
38     Description: A port to add to the NeutronPhysicalBridge.
39     Type: String
40   RabbitHost:
41     Type: String
42   RabbitUserName:
43     Type: String
44   RabbitPassword:
45     Type: String
46     NoEcho: true
47   CeilometerComputeAgent:
48     Description: Indicates whether the Compute agent is present and expects nova-compute to be configured accordingly
49     Type: String
50     Default: ''
51     AllowedValues: ['', Present]
52   CeilometerMeteringSecret:
53     Default: unset
54     Description: Secret shared by the ceilometer services.
55     Type: String
56     NoEcho: true
57   CeilometerPassword:
58     Default: unset
59     Description: The password for the ceilometer service account.
60     Type: String
61     NoEcho: true
62   NovaComputeDriver:
63     Type: String
64     Default: libvirt.LibvirtDriver
65   NovaComputeLibvirtType:
66     Type: String
67     Default: ''
68   NovaApiHost:
69     Type: String
70   NovaPassword:
71     Default: unset
72     Description: The password for the nova service account, used by nova-api.
73     Type: String
74     NoEcho: true
75   GlanceHost:
76     Type: String
77   CeilometerDSN:
78     Type: String
79   NovaDSN:
80     Type: String
81   NeutronDSN:
82     Type: String
83   NeutronBridgeMappings:
84     Type: String
85   NeutronNetworkVLANRanges:
86     Type: String
87   NeutronNetworkType:
88     Type: String
89   NeutronEnableTunnelling:
90     Type: String
91   StaticHosts:
92     Default: ''
93     Description: Static content to append to /etc/hosts
94     Type: String
95 Resources:
96   ComputeAccessPolicy:
97     Type: OS::Heat::AccessPolicy
98     Properties:
99       AllowedResources: [ NovaCompute0 ]
100   ComputeUser:
101     Type: AWS::IAM::User
102     Properties:
103       Policies: [ { Ref: ComputeAccessPolicy } ]
104   NovaCompute0Key:
105     Type: AWS::IAM::AccessKey
106     Properties:
107       UserName:
108         Ref: ComputeUser
109   NovaCompute0CompletionCondition:
110     Type: AWS::CloudFormation::WaitCondition
111     DependsOn: notCompute0
112     Properties:
113       Handle: {Ref: NovaCompute0CompletionHandle}
114       Count: '1'
115       Timeout: '1800'
116   NovaCompute0CompletionHandle:
117     Type: AWS::CloudFormation::WaitConditionHandle
118   NovaCompute0:
119     Type: OS::Nova::Server
120     Properties:
121       image:
122         {Ref: NovaImage}
123       image_update_policy:
124         Ref: ImageUpdatePolicy
125       flavor: {Ref: Flavor}
126       key_name: {Ref: KeyName}
127     Metadata:
128       os-collect-config:
129         cfn:
130           access_key_id:
131             Ref: NovaCompute0Key
132           secret_access_key:
133             Fn::GetAtt: [ NovaCompute0Key, SecretAccessKey ]
134           stack_name: {Ref: 'AWS::StackName'}
135           path: NovaCompute0Config.Metadata
136       OpenStack::ImageBuilder::Elements: [ nova-compute ]
137   NovaCompute0Config:
138     Type: AWS::AutoScaling::LaunchConfiguration
139     Properties:
140       InstanceType: '0'
141       ImageId: '0'
142     Metadata:
143       completion-handle:
144         Ref: NovaCompute0CompletionHandle
145       os-collect-config:
146         cfn:
147           access_key_id:
148             Ref: NovaCompute0Key
149           secret_access_key:
150             Fn::GetAtt: [ NovaCompute0Key, SecretAccessKey ]
151           stack_name: {Ref: 'AWS::StackName'}
152           path: NovaCompute0Config.Metadata
153       nova:
154         compute_driver: {Ref: NovaComputeDriver}
155         compute_libvirt_type: {Ref: NovaComputeLibvirtType}
156         db: {Ref: NovaDSN}
157         host: {Ref: NovaApiHost}
158         service-password:
159           Ref: NovaPassword
160       ceilometer:
161         db: {Ref: CeilometerDSN}
162         metering_secret: {Ref: CeilometerMeteringSecret}
163         service-password: {Ref: CeilometerPassword}
164         compute_agent: {Ref: CeilometerComputeAgent}
165       glance:
166         host: {Ref: GlanceHost}
167       hosts: {Ref: StaticHosts}
168       keystone:
169         host: {Ref: KeystoneHost}
170       neutron:
171         flat-networks: {Ref: NeutronFlatNetworks}
172         host: {Ref: NeutronHost}
173         ovs_db: {Ref: NeutronDSN}
174         ovs:
175           local_ip:
176             Fn::Select:
177               - 0
178               - Fn::Select:
179                 - ctlplane
180                 - Fn::GetAtt:
181                   - NovaCompute0
182                   - networks
183           tenant_network_type: {Ref: NeutronNetworkType}
184           network_vlan_ranges: {Ref: NeutronNetworkVLANRanges}
185           bridge_mappings: {Ref: NeutronBridgeMappings}
186           enable_tunneling: {Ref: NeutronEnableTunnelling}
187           physical_bridge: {Ref: NeutronPhysicalBridge}
188           public_interface: {Ref: NeutronPublicInterface}
189         service-password:
190           Ref: NeutronPassword
191       admin-password: {Ref: AdminPassword}
192       rabbit:
193         host: {Ref: RabbitHost}
194         username: {Ref: RabbitUserName}
195         password: {Ref: RabbitPassword}