-
Notifications
You must be signed in to change notification settings - Fork 1
/
server_atomic.yaml
138 lines (131 loc) · 4.12 KB
/
server_atomic.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
heat_template_version: 2016-10-14
parameters:
flavor:
type: string
description: Flavor for the server to be created
constraints:
- custom_constraint: nova.flavor
image:
type: string
description: Image ID or image name to use for the server
constraints:
- custom_constraint: glance.image
key_name:
type: string
description: SSH Key Pair
constraints:
- custom_constraint: nova.keypair
server_name:
type: string
description: Name of the server
purpose_ident:
type: string
description: Server purpose
port_network:
type: string
sec_groups:
type: json
default: { default }
rhn_orgid:
type: string
label: rhn username
description: Name of the rhn activation org
rhn_activationkey:
type: string
label: RHN user password
description: rhn activation key
hidden: true
satellite_fqdn:
type: string
description: FQDN of satellite server
default: notused
satellite_deploy:
type: boolean
description: Register with internal satellite if true
default: false
storage_setup:
type: string
description: The contents for /etc/sysconfig/docker-storage-setup
server_group:
type: string
label: group server belongs to
external_service_subnet:
type: string
description: Subnet to be used for external services
# add-portworx.yaml inserts atomic network and volume parameters here
resources:
resize_lv:
type: OS::Heat::CloudConfig
properties:
cloud_config:
write_files:
- path: /etc/sysconfig/docker-storage-setup
permissions: 0644
owner: root
content: { get_param: storage_setup }
rhn_script:
type: OS::Heat::SoftwareConfig
properties:
config:
str_replace:
params:
__rhn_orgid__: { get_param: rhn_orgid }
__rhn_activationkey__: { get_param: rhn_activationkey }
__satellite_fqdn__: { get_param: satellite_fqdn }
__satellite_deploy__: { get_param: satellite_deploy }
template: |
#!/bin/bash -x
cd /home/cloud-user
if [[ "__satellite_deploy__" = True ]]
then
curl -O http://__satellite_fqdn__/pub/katello-rhsm-consumer
chmod 755 katello-rhsm-consumer
./katello-rhsm-consumer
fi
subscription-manager register --org __rhn_orgid__ --activationkey __rhn_activationkey__
subscription-manager repos --disable=*
subscription-manager repos --enable=rhel-7-server-rpms
ln -sf /usr/share/zoneinfo/UTC /etc/localtime
# add-portworx.yaml inserts extra code to wipe ephemeral disk here
server_init:
type: OS::Heat::MultipartMime
properties:
parts:
- config: { get_resource: resize_lv }
- config: { get_resource: rhn_script }
server:
type: OS::Nova::Server
properties:
name: { get_param: server_name }
flavor: { get_param: flavor}
image: { get_param: image }
key_name: { get_param: key_name }
networks:
- port: { get_resource: port }
# add-portworx.yaml inserts server_atomic network resources here
scheduler_hints:
group: { get_param: server_group }
user_data_format: SOFTWARE_CONFIG
user_data: { get_resource: server_init }
port:
type: OS::Neutron::Port
properties:
name:
str_replace:
template: port_servername
params:
servername: { get_param: server_name }
network: { get_param: port_network }
security_groups: { get_param: sec_groups }
allowed_address_pairs: [ ip_address: { get_param: external_service_subnet } ]
# add-portworx.yaml inserts server_atomic volumes here
outputs:
server_ip:
value: { get_attr: [ server, networks, { get_param: port_network }, 0 ] }
host_entry:
value:
str_replace:
template: servername ipaddress
params:
servername: { get_attr: [ server, networks, { get_param: port_network}, 0 ] }
ipaddress: { get_attr: [ server, name ] }