heat_stack_server.yaml.j2 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  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. {% if openshift_use_kuryr|default(false)|bool %}
  80. api_lb_pool:
  81. default: ''
  82. type: string
  83. label: API LoadBalancer pool ID
  84. description: API Loadbalancer pool resource
  85. {% endif %}
  86. attach_float_net:
  87. type: boolean
  88. default: true
  89. label: Attach-float-net
  90. description: A switch for floating network port connection
  91. floating_network:
  92. type: string
  93. default: ''
  94. label: Floating network
  95. description: Network to allocate floating IP from
  96. availability_zone:
  97. type: string
  98. description: The Availability Zone to launch the instance.
  99. default: nova
  100. volume_size:
  101. type: number
  102. description: Size of the volume to be created.
  103. default: 1
  104. constraints:
  105. - range: { min: 1, max: 1024 }
  106. description: must be between 1 and 1024 Gb.
  107. node_labels:
  108. type: json
  109. description: OpenShift Node Labels
  110. default: {"region": "default" }
  111. scheduler_hints:
  112. type: json
  113. description: Server scheduler hints.
  114. default: {}
  115. outputs:
  116. name:
  117. description: Name of the server
  118. value: { get_attr: [ server, name ] }
  119. private_ip:
  120. description: Private IP of the server
  121. value:
  122. get_attr:
  123. - server
  124. - addresses
  125. - { get_param: net_name }
  126. - 0
  127. - addr
  128. floating_ip:
  129. description: Floating IP of the server
  130. value:
  131. get_attr:
  132. - server
  133. - addresses
  134. - { get_param: net_name }
  135. {% if openshift_openstack_provider_network_name %}
  136. - 0
  137. {% else %}
  138. - 1
  139. {% endif %}
  140. - addr
  141. conditions:
  142. no_floating: {not: { get_param: attach_float_net} }
  143. {% if openshift_use_flannel|default(False)|bool %}
  144. no_data_subnet: {not: { get_param: attach_data_net} }
  145. {% endif %}
  146. resources:
  147. server:
  148. type: OS::Nova::Server
  149. properties:
  150. name: { get_param: name }
  151. key_name: { get_param: key_name }
  152. image: { get_param: image }
  153. flavor: { get_param: flavor }
  154. networks:
  155. {% if openshift_use_flannel|default(False)|bool %}
  156. if:
  157. - no_data_subnet
  158. {% if use_trunk_ports|default(false)|bool %}
  159. - - port: { get_attr: [trunk-port, port_id] }
  160. {% else %}
  161. - - port: { get_resource: port }
  162. {% endif %}
  163. {% if use_trunk_ports|default(false)|bool %}
  164. - - port: { get_attr: [trunk-port, port_id] }
  165. {% else %}
  166. - - port: { get_resource: port }
  167. - port: { get_resource: data_port }
  168. {% endif %}
  169. {% else %}
  170. {% if use_trunk_ports|default(false)|bool %}
  171. - port: { get_attr: [trunk-port, port_id] }
  172. {% else %}
  173. - port: { get_resource: port }
  174. {% endif %}
  175. {% endif %}
  176. user_data:
  177. get_file: user-data
  178. user_data_format: RAW
  179. user_data_update_policy: IGNORE
  180. metadata:
  181. group: { get_param: group }
  182. environment: { get_param: cluster_env }
  183. clusterid: { get_param: cluster_id }
  184. host-type: { get_param: type }
  185. sub-host-type: { get_param: subtype }
  186. node_labels: { get_param: node_labels }
  187. {% if openshift_openstack_dns_nameservers %}
  188. openshift_hostname: { get_param: name }
  189. {% endif %}
  190. scheduler_hints: { get_param: scheduler_hints }
  191. {% if use_trunk_ports|default(false)|bool %}
  192. trunk-port:
  193. type: OS::Neutron::Trunk
  194. properties:
  195. name: { get_param: name }
  196. port: { get_resource: port }
  197. {% endif %}
  198. port:
  199. type: OS::Neutron::Port
  200. properties:
  201. network: { get_param: net }
  202. {% if not openshift_openstack_provider_network_name %}
  203. fixed_ips:
  204. - subnet: { get_param: subnet }
  205. {% endif %}
  206. security_groups: { get_param: secgrp }
  207. {% if openshift_use_flannel|default(False)|bool %}
  208. data_port:
  209. type: OS::Neutron::Port
  210. condition: { not: no_data_subnet }
  211. properties:
  212. network: { get_param: data_net }
  213. port_security_enabled: false
  214. {% if not openshift_openstack_provider_network_name %}
  215. fixed_ips:
  216. - subnet: { get_param: data_subnet }
  217. {% endif %}
  218. {% endif %}
  219. {% if not openshift_openstack_provider_network_name %}
  220. floating-ip:
  221. condition: { not: no_floating }
  222. type: OS::Neutron::FloatingIP
  223. properties:
  224. floating_network: { get_param: floating_network }
  225. port_id: { get_resource: port }
  226. {% endif %}
  227. {% if not openshift_openstack_ephemeral_volumes|default(false)|bool %}
  228. cinder_volume:
  229. type: OS::Cinder::Volume
  230. properties:
  231. size: { get_param: volume_size }
  232. availability_zone: { get_param: availability_zone }
  233. metadata:
  234. purpose: openshift_docker_storage
  235. volume_attachment:
  236. type: OS::Cinder::VolumeAttachment
  237. properties:
  238. volume_id: { get_resource: cinder_volume }
  239. instance_uuid: { get_resource: server }
  240. {% endif %}
  241. {% if openshift_use_kuryr|default(false)|bool %}
  242. lb_member:
  243. type: OS::Neutron::LBaaS::PoolMember
  244. condition:
  245. equals:
  246. - get_param: type
  247. - master
  248. properties:
  249. pool: { get_param: api_lb_pool }
  250. protocol_port: {{ openshift_master_api_port|default(8443) }}
  251. address: { get_attr: [server, first_address]}
  252. subnet: { get_param: subnet }
  253. {% endif %}