-
Notifications
You must be signed in to change notification settings - Fork 0
/
complex.yml
133 lines (130 loc) · 3.55 KB
/
complex.yml
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
heat_template_version: 2017-02-24
description: Simple template to deploy a single compute instance
parameters:
instname:
type: string
description: FQDN
default: "test.example.lcl"
ipapass:
type: string
description: OTP from ipa host add script
default: error
flavor:
type: string
description: new VM flavor
default: "Basic-1-4-50"
image_name:
type: string
description: source image for vm
default: "Centos-7-1805"
root_size:
type: number
description: size of root partition
default: 50
data_size:
type: number
description: size of partition with data
default: 50
ssh_key:
type: string
description: key is used to connect server via ssh with default user
default: heat_key
network_id:
type: string
description: id number of network
default: my-net1
subnet_id:
type: string
description: id number of subnetwork
default: my-subnet1
resources:
test.instance:
type: OS::Nova::Server
properties:
name: {get_param: instname}
block_device_mapping_v2:
- device_name: "vda"
boot_index: 0
disk_bus: "virtio"
volume_id: {get_resource: test.instance.disk.a}
delete_on_termination: true
- device_name: "vdb"
boot_index: 1
disk_bus: "virtio"
volume_id: {get_resource: test.instance.disk.b}
flavor: {get_param: flavor}
flavor_update_policy: RESIZE
key_name: {get_param: ssh_key}
networks:
- port: {get_resource: test.instance.port}
user_data_format: SOFTWARE_CONFIG
user_data: {get_resource: init}
user_data_update_policy: IGNORE
test.instance.disk.a:
type: OS::Cinder::Volume
properties:
image: {get_param: image_name}
size: {get_param: root_size}
name:
list_join: ['.', [{get_param: instname}, 'a']]
test.instance.disk.b:
type: OS::Cinder::Volume
properties:
size: {get_param: data_size}
name:
list_join: ['.', [{get_param: instname}, 'b']]
test.instance.port:
type: OS::Neutron::Port
properties:
name:
list_join:
- '.'
- - {get_param: instname}
- '0'
network_id: {get_param: network_id}
fixed_ips:
- subnet_id: {get_param: subnet_id}
init:
type: OS::Heat::MultipartMime
properties:
parts:
# - config: {get_resource: disk.format}
- config: {get_resource: upgrade}
- config: {get_resource: add2ipa}
upgrade:
type: OS::Heat::CloudConfig
properties:
cloud_config:
package_upgrade: true
add2ipa:
type: OS::Heat::CloudConfig
properties:
cloud_config:
fqdn: {get_param: instname}
packages:
- epel-release
- ipa-client
- adcli
- certmonger
- oddjob-mkhomedir
- realmd
- sssd
runcmd:
- [ ipa-client-install, --mkhomedir, --force-ntpd, --ssh-trust-dns, --enable-dns-updates, --unattended, --password, {get_param: ipapass} ]
# disk.format:
# type: OS::Heat::CloudConfig
# properties:
# cloud_config:
# disk_setup:
# /dev/vdb:
# table_type: 'gpt'
# layout:
# - [99, 83]
# overwrite: false
# fs_setup:
# - label: home
# filesystem: 'xfs'
# device: '/dev/vdb1'
# overwrite: false
# mounts:
# - [ /dev/vdb1, /home, "xfs", "defaults", "0", "0" ]