Allow manual hosts entry exports in overcloud.
[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   RabbitPassword:
43     Type: String
44     NoEcho: true
45   CeilometerComputeAgent:
46     Description: Indicates whether the Compute agent is present and expects nova-compute to be configured accordingly
47     Type: String
48     Default: ''
49     AllowedValues: ['', Present]
50   CeilometerMeteringSecret:
51     Default: unset
52     Description: Secret shared by the ceilometer services.
53     Type: String
54     NoEcho: true
55   CeilometerPassword:
56     Default: unset
57     Description: The password for the ceilometer service account.
58     Type: String
59     NoEcho: true
60   NovaComputeDriver:
61     Type: String
62     Default: libvirt.LibvirtDriver
63   NovaComputeLibvirtType:
64     Type: String
65     Default: ''
66   NovaApiHost:
67     Type: String
68   NovaPassword:
69     Default: unset
70     Description: The password for the nova service account, used by nova-api.
71     Type: String
72     NoEcho: true
73   GlanceHost:
74     Type: String
75   CeilometerDSN:
76     Type: String
77   NovaDSN:
78     Type: String
79   NeutronDSN:
80     Type: String
81   NeutronBridgeMappings:
82     Type: String
83   NeutronNetworkVLANRanges:
84     Type: String
85   NeutronNetworkType:
86     Type: String
87   NeutronEnableTunnelling:
88     Type: String
89   StaticHosts:
90     Default: ''
91     Description: Static content to append to /etc/hosts
92     Type: String
93 Resources:
94   ComputeAccessPolicy:
95     Type: OS::Heat::AccessPolicy
96     Properties:
97       AllowedResources: [ NovaCompute0 ]
98   ComputeUser:
99     Type: AWS::IAM::User
100     Properties:
101       Policies: [ { Ref: ComputeAccessPolicy } ]
102   NovaCompute0Key:
103     Type: AWS::IAM::AccessKey
104     Properties:
105       UserName:
106         Ref: ComputeUser
107   NovaCompute0CompletionCondition:
108     Type: AWS::CloudFormation::WaitCondition
109     DependsOn: notCompute0
110     Properties:
111       Handle: {Ref: NovaCompute0CompletionHandle}
112       Count: '1'
113       Timeout: '1800'
114   NovaCompute0CompletionHandle:
115     Type: AWS::CloudFormation::WaitConditionHandle
116   NovaCompute0:
117     Type: OS::Nova::Server
118     Properties:
119       image:
120         {Ref: NovaImage}
121       image_update_policy:
122         Ref: ImageUpdatePolicy
123       flavor: {Ref: Flavor}
124       key_name: {Ref: KeyName}
125     Metadata:
126       os-collect-config:
127         cfn:
128           access_key_id:
129             Ref: NovaCompute0Key
130           secret_access_key:
131             Fn::GetAtt: [ NovaCompute0Key, SecretAccessKey ]
132           stack_name: {Ref: 'AWS::StackName'}
133           path: NovaCompute0Config.Metadata
134       OpenStack::ImageBuilder::Elements: [ nova-compute ]
135   NovaCompute0Config:
136     Type: AWS::AutoScaling::LaunchConfiguration
137     Properties:
138       InstanceType: '0'
139       ImageId: '0'
140     Metadata:
141       completion-handle:
142         Ref: NovaCompute0CompletionHandle
143       os-collect-config:
144         cfn:
145           access_key_id:
146             Ref: NovaCompute0Key
147           secret_access_key:
148             Fn::GetAtt: [ NovaCompute0Key, SecretAccessKey ]
149           stack_name: {Ref: 'AWS::StackName'}
150           path: NovaCompute0Config.Metadata
151       nova:
152         compute_driver: {Ref: NovaComputeDriver}
153         compute_libvirt_type: {Ref: NovaComputeLibvirtType}
154         db: {Ref: NovaDSN}
155         host: {Ref: NovaApiHost}
156         service-password:
157           Ref: NovaPassword
158       ceilometer:
159         db: {Ref: CeilometerDSN}
160         metering_secret: {Ref: CeilometerMeteringSecret}
161         service-password: {Ref: CeilometerPassword}
162         compute_agent: {Ref: CeilometerComputeAgent}
163       glance:
164         host: {Ref: GlanceHost}
165       hosts: {Ref: StaticHosts}
166       keystone:
167         host: {Ref: KeystoneHost}
168       neutron:
169         flat-networks: {Ref: NeutronFlatNetworks}
170         host: {Ref: NeutronHost}
171         ovs_db: {Ref: NeutronDSN}
172         ovs:
173           local_ip:
174             Fn::Select:
175               - 0
176               - Fn::Select:
177                 - ctlplane
178                 - Fn::GetAtt:
179                   - NovaCompute0
180                   - networks
181           tenant_network_type: {Ref: NeutronNetworkType}
182           network_vlan_ranges: {Ref: NeutronNetworkVLANRanges}
183           bridge_mappings: {Ref: NeutronBridgeMappings}
184           enable_tunneling: {Ref: NeutronEnableTunnelling}
185           physical_bridge: {Ref: NeutronPhysicalBridge}
186           public_interface: {Ref: NeutronPublicInterface}
187         service-password:
188           Ref: NeutronPassword
189       admin-password: {Ref: AdminPassword}
190       rabbit:
191         host: {Ref: RabbitHost}
192         password: {Ref: RabbitPassword}