heat_stack_server.yaml.j2 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  1. heat_template_version: 2016-10-14
  2. description: OpenShift cluster server
  3. parameters:
  4. name:
  5. type: string
  6. label: Name
  7. description: Name
  8. group:
  9. type: string
  10. label: Host Group
  11. description: The Primary Ansible Host Group
  12. default: host
  13. cluster_env:
  14. type: string
  15. label: Cluster environment
  16. description: Environment of the cluster
  17. cluster_id:
  18. type: string
  19. label: Cluster ID
  20. description: Identifier of the cluster
  21. type:
  22. type: string
  23. label: Type
  24. description: Type master or node
  25. subtype:
  26. type: string
  27. label: Sub-type
  28. description: Sub-type compute or infra for nodes, default otherwise
  29. default: default
  30. key_name:
  31. type: string
  32. label: Key name
  33. description: Key name of keypair
  34. image:
  35. type: string
  36. label: Image
  37. description: Name of the image
  38. flavor:
  39. type: string
  40. label: Flavor
  41. description: Name of the flavor
  42. net:
  43. type: string
  44. label: Net ID
  45. description: Net resource
  46. net_name:
  47. type: string
  48. label: Net name
  49. description: Net name
  50. {% if not openshift_openstack_provider_network_name %}
  51. subnet:
  52. type: string
  53. label: Subnet ID
  54. description: Subnet resource
  55. {% endif %}
  56. {% if openshift_use_flannel|default(False)|bool %}
  57. attach_data_net:
  58. type: boolean
  59. default: false
  60. label: Attach-data-net
  61. description: A switch for data port connection
  62. data_net:
  63. type: string
  64. default: ''
  65. label: Net ID
  66. description: Net resource
  67. {% if not openshift_openstack_provider_network_name %}
  68. data_subnet:
  69. type: string
  70. default: ''
  71. label: Subnet ID
  72. description: Subnet resource
  73. {% endif %}
  74. {% endif %}
  75. secgrp:
  76. type: comma_delimited_list
  77. label: Security groups
  78. description: Security group resources
  79. attach_float_net:
  80. type: boolean
  81. default: true
  82. label: Attach-float-net
  83. description: A switch for floating network port connection
  84. floating_network:
  85. type: string
  86. default: ''
  87. label: Floating network
  88. description: Network to allocate floating IP from
  89. availability_zone:
  90. type: string
  91. description: The Availability Zone to launch the instance.
  92. default: nova
  93. volume_size:
  94. type: number
  95. description: Size of the volume to be created.
  96. default: 1
  97. constraints:
  98. - range: { min: 1, max: 1024 }
  99. description: must be between 1 and 1024 Gb.
  100. node_labels:
  101. type: json
  102. description: OpenShift Node Labels
  103. default: {"region": "default" }
  104. scheduler_hints:
  105. type: json
  106. description: Server scheduler hints.
  107. default: {}
  108. outputs:
  109. name:
  110. description: Name of the server
  111. value: { get_attr: [ server, name ] }
  112. private_ip:
  113. description: Private IP of the server
  114. value:
  115. get_attr:
  116. - server
  117. - addresses
  118. - { get_param: net_name }
  119. - 0
  120. - addr
  121. floating_ip:
  122. description: Floating IP of the server
  123. value:
  124. get_attr:
  125. - server
  126. - addresses
  127. - { get_param: net_name }
  128. {% if openshift_openstack_provider_network_name %}
  129. - 0
  130. {% else %}
  131. - 1
  132. {% endif %}
  133. - addr
  134. conditions:
  135. no_floating: {not: { get_param: attach_float_net} }
  136. {% if openshift_use_flannel|default(False)|bool %}
  137. no_data_subnet: {not: { get_param: attach_data_net} }
  138. {% endif %}
  139. resources:
  140. server:
  141. type: OS::Nova::Server
  142. properties:
  143. name: { get_param: name }
  144. key_name: { get_param: key_name }
  145. image: { get_param: image }
  146. flavor: { get_param: flavor }
  147. networks:
  148. {% if openshift_use_flannel|default(False)|bool %}
  149. if:
  150. - no_data_subnet
  151. {% if use_trunk_ports|default(false)|bool %}
  152. - - port: { get_attr: [trunk-port, port_id] }
  153. {% else %}
  154. - - port: { get_resource: port }
  155. {% endif %}
  156. {% if use_trunk_ports|default(false)|bool %}
  157. - - port: { get_attr: [trunk-port, port_id] }
  158. {% else %}
  159. - - port: { get_resource: port }
  160. - port: { get_resource: data_port }
  161. {% endif %}
  162. {% else %}
  163. {% if use_trunk_ports|default(false)|bool %}
  164. - port: { get_attr: [trunk-port, port_id] }
  165. {% else %}
  166. - port: { get_resource: port }
  167. {% endif %}
  168. {% endif %}
  169. user_data:
  170. get_file: user-data
  171. user_data_format: RAW
  172. user_data_update_policy: IGNORE
  173. metadata:
  174. group: { get_param: group }
  175. environment: { get_param: cluster_env }
  176. clusterid: { get_param: cluster_id }
  177. host-type: { get_param: type }
  178. sub-host-type: { get_param: subtype }
  179. node_labels: { get_param: node_labels }
  180. {% if openshift_openstack_dns_nameservers %}
  181. openshift_hostname: { get_param: name }
  182. {% endif %}
  183. scheduler_hints: { get_param: scheduler_hints }
  184. {% if use_trunk_ports|default(false)|bool %}
  185. trunk-port:
  186. type: OS::Neutron::Trunk
  187. properties:
  188. name: { get_param: name }
  189. port: { get_resource: port }
  190. {% endif %}
  191. port:
  192. type: OS::Neutron::Port
  193. properties:
  194. network: { get_param: net }
  195. {% if not openshift_openstack_provider_network_name %}
  196. fixed_ips:
  197. - subnet: { get_param: subnet }
  198. {% endif %}
  199. security_groups: { get_param: secgrp }
  200. {% if openshift_use_flannel|default(False)|bool %}
  201. data_port:
  202. type: OS::Neutron::Port
  203. condition: { not: no_data_subnet }
  204. properties:
  205. network: { get_param: data_net }
  206. port_security_enabled: false
  207. {% if not openshift_openstack_provider_network_name %}
  208. fixed_ips:
  209. - subnet: { get_param: data_subnet }
  210. {% endif %}
  211. {% endif %}
  212. {% if not openshift_openstack_provider_network_name %}
  213. floating-ip:
  214. condition: { not: no_floating }
  215. type: OS::Neutron::FloatingIP
  216. properties:
  217. floating_network: { get_param: floating_network }
  218. port_id: { get_resource: port }
  219. {% endif %}
  220. {% if not openshift_openstack_ephemeral_volumes|default(false)|bool %}
  221. cinder_volume:
  222. type: OS::Cinder::Volume
  223. properties:
  224. size: { get_param: volume_size }
  225. availability_zone: { get_param: availability_zone }
  226. metadata:
  227. purpose: openshift_docker_storage
  228. volume_attachment:
  229. type: OS::Cinder::VolumeAttachment
  230. properties:
  231. volume_id: { get_resource: cinder_volume }
  232. instance_uuid: { get_resource: server }
  233. {% endif %}