[CICDANSIBLE] Add availability_zone Heat stack parameter
[oom/offline-installer.git] / tools / cicdansible / heat / node.yaml
1 #This yaml template instantiates kubernetes nodes (using instance.yaml subtemplate).
2 #It contains some node specific things, and has been split from main template
3 #to be able to do some late evaluation tricks.
4 heat_template_version: 2017-02-24
5 description: "This template instantiates a single kubernetes node using the instance.yaml subtemplate"
6 parameters:
7   key_name:
8     type: string
9   flavor_name:
10     type: string
11   nodenum:
12     type: number
13   image_name:
14     type: string
15   network:
16     type: string
17   subnet:
18     type: string
19   notify_command:
20     type: string
21   security_group:
22     type: string
23   scheduler_hints:
24     type: json
25   demo_network:
26     type: string
27     default: ""
28   docker_storage_size:
29     type: number
30   availability_zone:
31     type: string
32 resources:
33   #Volume for storing /var/lib/docker for node.
34   docker_storage:
35     type: OS::Cinder::Volume
36     properties:
37       name: docker_storage
38       size: { get_param: docker_storage_size }
39   #Call generic instance template.
40   instance:
41     type: instance.yaml
42     properties:
43       instance_name:
44         str_replace_strict:
45           template: "node%index%"
46           params: { "%index%": { get_param: nodenum } }
47       key_name: { get_param: key_name }
48       image_name: { get_param: image_name }
49       network: { get_param: network }
50       subnet: { get_param: subnet }
51       flavor_name: { get_param: flavor_name }
52       availability_zone: { get_param: availability_zone }
53       notify_command: { get_param: notify_command }
54       security_group: { get_param: security_group }
55       scheduler_hints: { get_param: scheduler_hints }
56       demo_network: { get_param: demo_network }
57   #Attachment of docker volume to node.
58   docker_storage_attachment:
59     type: OS::Cinder::VolumeAttachment
60     properties:
61       volume_id: { get_resource: docker_storage }
62       instance_uuid: { get_resource: instance }
63 outputs:
64   OS::stack_id:
65     value: { get_resource: instance }
66   port_id:
67     value: { get_attr: ["instance", "port_id"] }
68   ip:
69     value: { get_attr: ["instance", "ip"] }
70   volumes:
71     value: [[{ get_resource: docker_storage }, "/var/lib/docker"]]