heat_stack_server.yaml.j2 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  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 provider_network %}
  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 provider_network %}
  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 not provider_network %}
  80. floating_network:
  81. type: string
  82. label: Floating network
  83. description: Network to allocate floating IP from
  84. {% endif %}
  85. availability_zone:
  86. type: string
  87. description: The Availability Zone to launch the instance.
  88. default: nova
  89. volume_size:
  90. type: number
  91. description: Size of the volume to be created.
  92. default: 1
  93. constraints:
  94. - range: { min: 1, max: 1024 }
  95. description: must be between 1 and 1024 Gb.
  96. node_labels:
  97. type: json
  98. description: OpenShift Node Labels
  99. default: {"region": "default" }
  100. scheduler_hints:
  101. type: json
  102. description: Server scheduler hints.
  103. default: {}
  104. outputs:
  105. name:
  106. description: Name of the server
  107. value: { get_attr: [ server, name ] }
  108. private_ip:
  109. description: Private IP of the server
  110. value:
  111. get_attr:
  112. - server
  113. - addresses
  114. - { get_param: net_name }
  115. - 0
  116. - addr
  117. floating_ip:
  118. description: Floating IP of the server
  119. value:
  120. get_attr:
  121. - server
  122. - addresses
  123. - { get_param: net_name }
  124. {% if provider_network %}
  125. - 0
  126. {% else %}
  127. - 1
  128. {% endif %}
  129. - addr
  130. {% if openshift_use_flannel|default(False)|bool %}
  131. conditions:
  132. no_data_subnet: {not: { get_param: attach_data_net} }
  133. {% endif %}
  134. resources:
  135. server:
  136. type: OS::Nova::Server
  137. properties:
  138. name: { get_param: name }
  139. key_name: { get_param: key_name }
  140. image: { get_param: image }
  141. flavor: { get_param: flavor }
  142. networks:
  143. {% if openshift_use_flannel|default(False)|bool %}
  144. if:
  145. - no_data_subnet
  146. {% if use_trunk_ports|default(false)|bool %}
  147. - - port: { get_attr: [trunk-port, port_id] }
  148. {% else %}
  149. - - port: { get_resource: port }
  150. {% endif %}
  151. {% if use_trunk_ports|default(false)|bool %}
  152. - - port: { get_attr: [trunk-port, port_id] }
  153. {% else %}
  154. - - port: { get_resource: port }
  155. - port: { get_resource: data_port }
  156. {% endif %}
  157. {% else %}
  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. {% endif %}
  164. user_data:
  165. get_file: user-data
  166. user_data_format: RAW
  167. user_data_update_policy: IGNORE
  168. metadata:
  169. group: { get_param: group }
  170. environment: { get_param: cluster_env }
  171. clusterid: { get_param: cluster_id }
  172. host-type: { get_param: type }
  173. sub-host-type: { get_param: subtype }
  174. node_labels: { get_param: node_labels }
  175. scheduler_hints: { get_param: scheduler_hints }
  176. {% if use_trunk_ports|default(false)|bool %}
  177. trunk-port:
  178. type: OS::Neutron::Trunk
  179. properties:
  180. name: { get_param: name }
  181. port: { get_resource: port }
  182. {% endif %}
  183. port:
  184. type: OS::Neutron::Port
  185. properties:
  186. network: { get_param: net }
  187. {% if not provider_network %}
  188. fixed_ips:
  189. - subnet: { get_param: subnet }
  190. {% endif %}
  191. security_groups: { get_param: secgrp }
  192. {% if openshift_use_flannel|default(False)|bool %}
  193. data_port:
  194. type: OS::Neutron::Port
  195. condition: { not: no_data_subnet }
  196. properties:
  197. network: { get_param: data_net }
  198. port_security_enabled: false
  199. {% if not provider_network %}
  200. fixed_ips:
  201. - subnet: { get_param: data_subnet }
  202. {% endif %}
  203. {% endif %}
  204. {% if not provider_network %}
  205. floating-ip:
  206. type: OS::Neutron::FloatingIP
  207. properties:
  208. floating_network: { get_param: floating_network }
  209. port_id: { get_resource: port }
  210. {% endif %}
  211. {% if not ephemeral_volumes|default(false)|bool %}
  212. cinder_volume:
  213. type: OS::Cinder::Volume
  214. properties:
  215. size: { get_param: volume_size }
  216. availability_zone: { get_param: availability_zone }
  217. volume_attachment:
  218. type: OS::Cinder::VolumeAttachment
  219. properties:
  220. volume_id: { get_resource: cinder_volume }
  221. instance_uuid: { get_resource: server }
  222. mountpoint: /dev/sdb
  223. {% endif %}