2aadea8db7300157a8d2cb601567a0a5dde42498
[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   NovaImage:
18     Type: String
19     Default: overcloud-compute
20   KeystoneHost:
21     Type: String
22   NeutronHost:
23     Type: String
24   RabbitHost:
25     Type: String
26   RabbitPassword:
27     Type: String
28     NoEcho: true
29   NovaComputeDriver:
30     Type: String
31     Default: libvirt.LibvirtDriver
32   NovaComputeLibvirtType:
33     Type: String
34     Default: ''
35   NovaApiHost:
36     Type: String
37   NovaPassword:
38     Default: unset
39     Description: The password for the nova service account, used by nova-api.
40     Type: String
41     NoEcho: true
42   GlanceHost:
43     Type: String
44   NovaDSN:
45     Type: String
46   NeutronDSN:
47     Type: String
48   NeutronBridgeMappings:
49     Type: String
50   NeutronNetworkVLANRanges:
51     Type: String
52   NeutronNetworkType:
53     Type: String
54   NeutronEnableTunnelling:
55     Type: String
56 Resources:
57   ComputeAccessPolicy:
58     Type: OS::Heat::AccessPolicy
59     Properties:
60       AllowedResources: [ NovaCompute0 ]
61   ComputeUser:
62     Type: AWS::IAM::User
63     Properties:
64       Policies: [ { Ref: ComputeAccessPolicy } ]
65   ComputeKey:
66     Type: AWS::IAM::AccessKey
67     Properties:
68       UserName:
69         Ref: ComputeUser
70   CompletionCondition:
71     Type: AWS::CloudFormation::WaitCondition
72     DependsOn: notcompute
73     Properties:
74       Handle: {Ref: CompletionHandle}
75       Count: '1'
76       Timeout: '1800'
77   CompletionHandle:
78     Type: AWS::CloudFormation::WaitConditionHandle
79   NovaCompute0:
80     Type: OS::Nova::Server
81     Properties:
82       image:
83         {Ref: NovaImage}
84       flavor: {Ref: Flavor}
85       key_name: {Ref: KeyName}
86     Metadata:
87       os-collect-config:
88         cfn:
89           access_key_id:
90             Ref: ComputeKey
91           secret_access_key:
92             Fn::GetAtt: [ ComputeKey, SecretAccessKey ]
93           stack_name: {Ref: 'AWS::StackName'}
94           path: NovaCompute0Config.Metadata
95       OpenStack::ImageBuilder::Elements: [ nova-compute ]
96   NovaCompute0Config:
97     Type: AWS::AutoScaling::LaunchConfiguration
98     Properties:
99       InstanceType: '0'
100       ImageId: '0'
101     Metadata:
102       completion-handle:
103         Ref: CompletionHandle
104       os-collect-config:
105         cfn:
106           access_key_id:
107             Ref: ComputeKey
108           secret_access_key:
109             Fn::GetAtt: [ ComputeKey, SecretAccessKey ]
110           stack_name: {Ref: 'AWS::StackName'}
111           path: NovaCompute0Config.Metadata
112       nova:
113         compute_driver: {Ref: NovaComputeDriver}
114         compute_libvirt_type: {Ref: NovaComputeLibvirtType}
115         db: {Ref: NovaDSN}
116         host: {Ref: NovaApiHost}
117         service-password:
118           Ref: NovaPassword
119       glance:
120         host: {Ref: GlanceHost}
121       keystone:
122         host: {Ref: KeystoneHost}
123       neutron:
124         host: {Ref: NeutronHost}
125         ovs_db: {Ref: NeutronDSN}
126         ovs:
127           local_ip:
128             Fn::Select:
129               - 0
130               - Fn::Select:
131                 - ctlplane
132                 - Fn::GetAtt:
133                   - NovaCompute0
134                   - networks
135           tenant_network_type: {Ref: NeutronNetworkType}
136           network_vlan_ranges: {Ref: NeutronNetworkVLANRanges}
137           bridge_mappings: {Ref: NeutronBridgeMappings}
138           enable_tunneling: {Ref: NeutronEnableTunnelling}
139         service-password:
140           Ref: NeutronPassword
141       admin-password: {Ref: AdminPassword}
142       rabbit:
143         host: {Ref: RabbitHost}
144         password: {Ref: RabbitPassword}