-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathhead.yaml
145 lines (117 loc) · 3.57 KB
/
head.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
heat_template_version: 2014-10-16
description: >
A host used for HPC head node other optional services.
parameters:
key_name:
description: >
A pre-submitted SSH key to access the VM hosts
type: string
constraints:
- custom_constraint: nova.keypair
image:
description: >
Select a base image to use for the VMs
type: string
constraints:
- custom_constraint: glance.image
flavor:
description: >
Define the hardware characteristics for the VMs: CPU, Memory, base disk
type: string
constraints:
- custom_constraint: nova.flavor
hostname:
description: >
The Infrastructure hostname portion of the FQDN
type: string
timeout:
description: Time to wait until the setup is ready.
type: number
default: 600
# Software Subscription information
rhn_username:
description: >
A valid user with entitlements to RHEL and OpenShift software repos
type: string
rhn_password:
description: >
The password for the RHN user
type: string
hidden: true
rhn_pool:
description: >
A subscription pool containing the RHEL and OpenShift software repos
OPTIONAL
type: string
hidden: true
ssh_user:
description: >
The user for SSH access to the VM hosts
type: string
# Network topology and location
port:
description: Neutron port (with a floating IP address) to assign to the DNS Nova Server
type: string
resources:
# A VM to provide host based orchestration and other sub-services
host:
type: OS::Nova::Server
properties:
name: {get_param: hostname}
admin_user: {get_param: ssh_user}
image: {get_param: image}
flavor: {get_param: flavor}
key_name: {get_param: key_name}
networks:
- port: {get_param: port}
user_data_format: SOFTWARE_CONFIG
user_data: {get_resource: init}
# Install, configure and enable the Heat configuration agent
config_agent:
type: collect-config-setup/install_config_agent_centos_yum.yaml
# Collect the results from a set of resources
init:
type: OS::Heat::MultipartMime
properties:
parts:
- config: {get_resource: rhn_register}
- config: {get_resource: host_update}
- config: {get_attr: [config_agent, config]}
type: multipart
- config: {get_resource: node_boot}
node_boot:
type: OS::Heat::SoftwareConfig
properties:
config:
str_replace:
params:
$WC_NOTIFY: { get_attr: ['wait_handle', 'curl_cli'] }
template: {get_file: fragments/head-boot.sh}
# Register the host with RHN for access to software packages
rhn_register:
type: OS::Heat::SoftwareConfig
properties:
config:
str_replace:
params:
$RHN_USERNAME: {get_param: rhn_username}
$RHN_PASSWORD: {get_param: rhn_password}
$POOL_ID: {get_param: rhn_pool}
template: {get_file: fragments/rhn-register.sh}
# Make sure the host software is current
host_update:
type: OS::Heat::SoftwareConfig
properties:
config:
get_file: fragments/host-update.sh
# Wait until the cloud-init process ends and reports or times out
wait_condition:
type: OS::Heat::WaitCondition
properties:
handle: {get_resource: wait_handle}
timeout: {get_param: timeout}
# This is passed to infra_init cloud-init script as a curl CLI command
# When the cloud-init process ends it queries the URL with
# a message which ends the wait and returns the value
wait_handle:
type: OS::Heat::WaitConditionHandle