heat_stack.yaml.j2 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764
  1. heat_template_version: 2016-10-14
  2. description: OpenShift cluster
  3. parameters:
  4. outputs:
  5. etcd_names:
  6. description: Name of the etcds
  7. value: { get_attr: [ etcd, name ] }
  8. etcd_ips:
  9. description: IPs of the etcds
  10. value: { get_attr: [ etcd, private_ip ] }
  11. etcd_floating_ips:
  12. description: Floating IPs of the etcds
  13. value: { get_attr: [ etcd, floating_ip ] }
  14. master_names:
  15. description: Name of the masters
  16. value: { get_attr: [ masters, name ] }
  17. master_ips:
  18. description: IPs of the masters
  19. value: { get_attr: [ masters, private_ip ] }
  20. master_floating_ips:
  21. description: Floating IPs of the masters
  22. value: { get_attr: [ masters, floating_ip ] }
  23. node_names:
  24. description: Name of the nodes
  25. value: { get_attr: [ compute_nodes, name ] }
  26. node_ips:
  27. description: IPs of the nodes
  28. value: { get_attr: [ compute_nodes, private_ip ] }
  29. node_floating_ips:
  30. description: Floating IPs of the nodes
  31. value: { get_attr: [ compute_nodes, floating_ip ] }
  32. infra_names:
  33. description: Name of the nodes
  34. value: { get_attr: [ infra_nodes, name ] }
  35. infra_ips:
  36. description: IPs of the nodes
  37. value: { get_attr: [ infra_nodes, private_ip ] }
  38. infra_floating_ips:
  39. description: Floating IPs of the nodes
  40. value: { get_attr: [ infra_nodes, floating_ip ] }
  41. {% if num_dns|int > 0 %}
  42. dns_name:
  43. description: Name of the DNS
  44. value:
  45. get_attr:
  46. - dns
  47. - name
  48. dns_floating_ips:
  49. description: Floating IPs of the DNS
  50. value: { get_attr: [ dns, floating_ip ] }
  51. dns_private_ips:
  52. description: Private IPs of the DNS
  53. value: { get_attr: [ dns, private_ip ] }
  54. {% endif %}
  55. resources:
  56. net:
  57. type: OS::Neutron::Net
  58. properties:
  59. name:
  60. str_replace:
  61. template: openshift-ansible-cluster_id-net
  62. params:
  63. cluster_id: {{ stack_name }}
  64. subnet:
  65. type: OS::Neutron::Subnet
  66. properties:
  67. name:
  68. str_replace:
  69. template: openshift-ansible-cluster_id-subnet
  70. params:
  71. cluster_id: {{ stack_name }}
  72. network: { get_resource: net }
  73. cidr:
  74. str_replace:
  75. template: subnet_24_prefix.0/24
  76. params:
  77. subnet_24_prefix: {{ subnet_prefix }}
  78. allocation_pools:
  79. - start:
  80. str_replace:
  81. template: subnet_24_prefix.3
  82. params:
  83. subnet_24_prefix: {{ subnet_prefix }}
  84. end:
  85. str_replace:
  86. template: subnet_24_prefix.254
  87. params:
  88. subnet_24_prefix: {{ subnet_prefix }}
  89. dns_nameservers:
  90. {% for nameserver in dns_nameservers %}
  91. - {{ nameserver }}
  92. {% endfor %}
  93. router:
  94. type: OS::Neutron::Router
  95. properties:
  96. name:
  97. str_replace:
  98. template: openshift-ansible-cluster_id-router
  99. params:
  100. cluster_id: {{ stack_name }}
  101. external_gateway_info:
  102. network: {{ external_network }}
  103. interface:
  104. type: OS::Neutron::RouterInterface
  105. properties:
  106. router_id: { get_resource: router }
  107. subnet_id: { get_resource: subnet }
  108. # keypair:
  109. # type: OS::Nova::KeyPair
  110. # properties:
  111. # name:
  112. # str_replace:
  113. # template: openshift-ansible-cluster_id-keypair
  114. # params:
  115. # cluster_id: {{ stack_name }}
  116. # public_key: {{ ssh_public_key }}
  117. common-secgrp:
  118. type: OS::Neutron::SecurityGroup
  119. properties:
  120. name:
  121. str_replace:
  122. template: openshift-ansible-cluster_id-common-secgrp
  123. params:
  124. cluster_id: {{ stack_name }}
  125. description:
  126. str_replace:
  127. template: Basic ssh/icmp security group for cluster_id OpenShift cluster
  128. params:
  129. cluster_id: {{ stack_name }}
  130. rules:
  131. - direction: ingress
  132. protocol: tcp
  133. port_range_min: 22
  134. port_range_max: 22
  135. remote_ip_prefix: {{ ssh_ingress_cidr }}
  136. {% if use_bastion|bool %}
  137. - direction: ingress
  138. protocol: tcp
  139. port_range_min: 22
  140. port_range_max: 22
  141. remote_ip_prefix: {{ bastion_ingress_cidr }}
  142. {% endif %}
  143. - direction: ingress
  144. protocol: icmp
  145. remote_ip_prefix: {{ ssh_ingress_cidr }}
  146. {% if openstack_flat_secgrp|default(False)|bool %}
  147. flat-secgrp:
  148. type: OS::Neutron::SecurityGroup
  149. properties:
  150. name:
  151. str_replace:
  152. template: openshift-ansible-cluster_id-flat-secgrp
  153. params:
  154. cluster_id: {{ stack_name }}
  155. description:
  156. str_replace:
  157. template: Security group for cluster_id OpenShift cluster
  158. params:
  159. cluster_id: {{ stack_name }}
  160. rules:
  161. - direction: ingress
  162. protocol: tcp
  163. port_range_min: 4001
  164. port_range_max: 4001
  165. - direction: ingress
  166. protocol: tcp
  167. port_range_min: 8443
  168. port_range_max: 8444
  169. - direction: ingress
  170. protocol: tcp
  171. port_range_min: 8053
  172. port_range_max: 8053
  173. - direction: ingress
  174. protocol: udp
  175. port_range_min: 8053
  176. port_range_max: 8053
  177. - direction: ingress
  178. protocol: tcp
  179. port_range_min: 24224
  180. port_range_max: 24224
  181. - direction: ingress
  182. protocol: udp
  183. port_range_min: 24224
  184. port_range_max: 24224
  185. - direction: ingress
  186. protocol: tcp
  187. port_range_min: 2224
  188. port_range_max: 2224
  189. - direction: ingress
  190. protocol: udp
  191. port_range_min: 5404
  192. port_range_max: 5405
  193. - direction: ingress
  194. protocol: tcp
  195. port_range_min: 9090
  196. port_range_max: 9090
  197. - direction: ingress
  198. protocol: tcp
  199. port_range_min: 2379
  200. port_range_max: 2380
  201. remote_mode: remote_group_id
  202. - direction: ingress
  203. protocol: tcp
  204. port_range_min: 10250
  205. port_range_max: 10250
  206. remote_mode: remote_group_id
  207. - direction: ingress
  208. protocol: udp
  209. port_range_min: 10250
  210. port_range_max: 10250
  211. remote_mode: remote_group_id
  212. - direction: ingress
  213. protocol: tcp
  214. port_range_min: 10255
  215. port_range_max: 10255
  216. remote_mode: remote_group_id
  217. - direction: ingress
  218. protocol: udp
  219. port_range_min: 10255
  220. port_range_max: 10255
  221. remote_mode: remote_group_id
  222. - direction: ingress
  223. protocol: udp
  224. port_range_min: 4789
  225. port_range_max: 4789
  226. remote_mode: remote_group_id
  227. - direction: ingress
  228. protocol: tcp
  229. port_range_min: 30000
  230. port_range_max: 32767
  231. remote_ip_prefix: {{ node_ingress_cidr }}
  232. - direction: ingress
  233. protocol: tcp
  234. port_range_min: 30000
  235. port_range_max: 32767
  236. remote_ip_prefix: "{{ openstack_subnet_prefix }}.0/24"
  237. {% else %}
  238. master-secgrp:
  239. type: OS::Neutron::SecurityGroup
  240. properties:
  241. name:
  242. str_replace:
  243. template: openshift-ansible-cluster_id-master-secgrp
  244. params:
  245. cluster_id: {{ stack_name }}
  246. description:
  247. str_replace:
  248. template: Security group for cluster_id OpenShift cluster master
  249. params:
  250. cluster_id: {{ stack_name }}
  251. rules:
  252. - direction: ingress
  253. protocol: tcp
  254. port_range_min: 4001
  255. port_range_max: 4001
  256. - direction: ingress
  257. protocol: tcp
  258. port_range_min: 8443
  259. port_range_max: 8444
  260. - direction: ingress
  261. protocol: tcp
  262. port_range_min: 8053
  263. port_range_max: 8053
  264. - direction: ingress
  265. protocol: udp
  266. port_range_min: 8053
  267. port_range_max: 8053
  268. - direction: ingress
  269. protocol: tcp
  270. port_range_min: 24224
  271. port_range_max: 24224
  272. - direction: ingress
  273. protocol: udp
  274. port_range_min: 24224
  275. port_range_max: 24224
  276. - direction: ingress
  277. protocol: tcp
  278. port_range_min: 2224
  279. port_range_max: 2224
  280. - direction: ingress
  281. protocol: udp
  282. port_range_min: 5404
  283. port_range_max: 5405
  284. - direction: ingress
  285. protocol: tcp
  286. port_range_min: 9090
  287. port_range_max: 9090
  288. etcd-secgrp:
  289. type: OS::Neutron::SecurityGroup
  290. properties:
  291. name:
  292. str_replace:
  293. template: openshift-ansible-cluster_id-etcd-secgrp
  294. params:
  295. cluster_id: {{ stack_name }}
  296. description:
  297. str_replace:
  298. template: Security group for cluster_id etcd cluster
  299. params:
  300. cluster_id: {{ stack_name }}
  301. rules:
  302. - direction: ingress
  303. protocol: tcp
  304. port_range_min: 2379
  305. port_range_max: 2379
  306. remote_mode: remote_group_id
  307. remote_group_id: { get_resource: master-secgrp }
  308. - direction: ingress
  309. protocol: tcp
  310. port_range_min: 2380
  311. port_range_max: 2380
  312. remote_mode: remote_group_id
  313. node-secgrp:
  314. type: OS::Neutron::SecurityGroup
  315. properties:
  316. name:
  317. str_replace:
  318. template: openshift-ansible-cluster_id-node-secgrp
  319. params:
  320. cluster_id: {{ stack_name }}
  321. description:
  322. str_replace:
  323. template: Security group for cluster_id OpenShift cluster nodes
  324. params:
  325. cluster_id: {{ stack_name }}
  326. rules:
  327. - direction: ingress
  328. protocol: tcp
  329. port_range_min: 10250
  330. port_range_max: 10250
  331. remote_mode: remote_group_id
  332. - direction: ingress
  333. protocol: tcp
  334. port_range_min: 10255
  335. port_range_max: 10255
  336. remote_mode: remote_group_id
  337. - direction: ingress
  338. protocol: udp
  339. port_range_min: 10255
  340. port_range_max: 10255
  341. remote_mode: remote_group_id
  342. - direction: ingress
  343. protocol: udp
  344. port_range_min: 4789
  345. port_range_max: 4789
  346. remote_mode: remote_group_id
  347. - direction: ingress
  348. protocol: tcp
  349. port_range_min: 30000
  350. port_range_max: 32767
  351. remote_ip_prefix: {{ node_ingress_cidr }}
  352. - direction: ingress
  353. protocol: tcp
  354. port_range_min: 30000
  355. port_range_max: 32767
  356. remote_ip_prefix: "{{ openstack_subnet_prefix }}.0/24"
  357. {% endif %}
  358. infra-secgrp:
  359. type: OS::Neutron::SecurityGroup
  360. properties:
  361. name:
  362. str_replace:
  363. template: openshift-ansible-cluster_id-infra-secgrp
  364. params:
  365. cluster_id: {{ stack_name }}
  366. description:
  367. str_replace:
  368. template: Security group for cluster_id OpenShift infrastructure cluster nodes
  369. params:
  370. cluster_id: {{ stack_name }}
  371. rules:
  372. - direction: ingress
  373. protocol: tcp
  374. port_range_min: 80
  375. port_range_max: 80
  376. - direction: ingress
  377. protocol: tcp
  378. port_range_min: 443
  379. port_range_max: 443
  380. {% if num_dns|int > 0 %}
  381. dns-secgrp:
  382. type: OS::Neutron::SecurityGroup
  383. properties:
  384. name:
  385. str_replace:
  386. template: openshift-ansible-cluster_id-dns-secgrp
  387. params:
  388. cluster_id: {{ stack_name }}
  389. description:
  390. str_replace:
  391. template: Security group for cluster_id cluster DNS
  392. params:
  393. cluster_id: {{ stack_name }}
  394. rules:
  395. - direction: ingress
  396. protocol: udp
  397. port_range_min: 53
  398. port_range_max: 53
  399. remote_ip_prefix: {{ node_ingress_cidr }}
  400. - direction: ingress
  401. protocol: udp
  402. port_range_min: 53
  403. port_range_max: 53
  404. remote_ip_prefix: "{{ openstack_subnet_prefix }}.0/24"
  405. - direction: ingress
  406. protocol: tcp
  407. port_range_min: 53
  408. port_range_max: 53
  409. remote_ip_prefix: {{ node_ingress_cidr }}
  410. - direction: ingress
  411. protocol: tcp
  412. port_range_min: 53
  413. port_range_max: 53
  414. remote_ip_prefix: "{{ openstack_subnet_prefix }}.0/24"
  415. {% endif %}
  416. {% if num_masters|int > 1 or ui_ssh_tunnel|bool %}
  417. lb-secgrp:
  418. type: OS::Neutron::SecurityGroup
  419. properties:
  420. name: openshift-ansible-{{ stack_name }}-lb-secgrp
  421. description: Security group for {{ stack_name }} cluster Load Balancer
  422. rules:
  423. - direction: ingress
  424. protocol: tcp
  425. port_range_min: {{ openshift_master_api_port | default(8443) }}
  426. port_range_max: {{ openshift_master_api_port | default(8443) }}
  427. remote_ip_prefix: {{ lb_ingress_cidr | default(bastion_ingress_cidr) }}
  428. {% if ui_ssh_tunnel|bool %}
  429. - direction: ingress
  430. protocol: tcp
  431. port_range_min: {{ openshift_master_api_port | default(8443) }}
  432. port_range_max: {{ openshift_master_api_port | default(8443) }}
  433. remote_ip_prefix: {{ ssh_ingress_cidr }}
  434. {% endif %}
  435. {% if openshift_master_console_port is defined and openshift_master_console_port != openshift_master_api_port %}
  436. - direction: ingress
  437. protocol: tcp
  438. port_range_min: {{ openshift_master_console_port | default(8443) }}
  439. port_range_max: {{ openshift_master_console_port | default(8443) }}
  440. remote_ip_prefix: {{ lb_ingress_cidr | default(bastion_ingress_cidr) }}
  441. {% endif %}
  442. {% endif %}
  443. etcd:
  444. type: OS::Heat::ResourceGroup
  445. properties:
  446. count: {{ num_etcd }}
  447. resource_def:
  448. {% if use_bastion|bool %}
  449. type: server_nofloating.yaml
  450. {% else %}
  451. type: server.yaml
  452. {% endif %}
  453. properties:
  454. name:
  455. str_replace:
  456. template: k8s_type-%index%.cluster_id
  457. params:
  458. cluster_id: {{ stack_name }}
  459. k8s_type: {{ etcd_hostname }}
  460. cluster_env: {{ public_dns_domain }}
  461. cluster_id: {{ stack_name }}
  462. group:
  463. str_replace:
  464. template: k8s_type.cluster_id
  465. params:
  466. k8s_type: etcds
  467. cluster_id: {{ stack_name }}
  468. type: etcd
  469. image: {{ openstack_etcd_image }}
  470. flavor: {{ etcd_flavor }}
  471. key_name: {{ ssh_public_key }}
  472. net: { get_resource: net }
  473. subnet: { get_resource: subnet }
  474. secgrp:
  475. - { get_resource: {% if openstack_flat_secgrp|default(False)|bool %}flat-secgrp{% else %}etcd-secgrp{% endif %} }
  476. - { get_resource: common-secgrp }
  477. {% if not use_bastion|bool %}
  478. floating_network: {{ external_network }}
  479. {% endif %}
  480. net_name:
  481. str_replace:
  482. template: openshift-ansible-cluster_id-net
  483. params:
  484. cluster_id: {{ stack_name }}
  485. volume_size: {{ etcd_volume_size }}
  486. depends_on:
  487. - interface
  488. {% if num_masters|int > 1 %}
  489. loadbalancer:
  490. type: OS::Heat::ResourceGroup
  491. properties:
  492. count: 1
  493. resource_def:
  494. type: server.yaml
  495. properties:
  496. name:
  497. str_replace:
  498. template: k8s_type-%index%.cluster_id
  499. params:
  500. cluster_id: {{ stack_name }}
  501. k8s_type: {{ lb_hostname }}
  502. cluster_env: {{ public_dns_domain }}
  503. cluster_id: {{ stack_name }}
  504. group:
  505. str_replace:
  506. template: k8s_type.cluster_id
  507. params:
  508. k8s_type: lb
  509. cluster_id: {{ stack_name }}
  510. type: lb
  511. image: {{ openstack_lb_image }}
  512. flavor: {{ lb_flavor }}
  513. key_name: {{ ssh_public_key }}
  514. net: { get_resource: net }
  515. subnet: { get_resource: subnet }
  516. secgrp:
  517. - { get_resource: lb-secgrp }
  518. - { get_resource: common-secgrp }
  519. floating_network: {{ external_network }}
  520. net_name:
  521. str_replace:
  522. template: openshift-ansible-cluster_id-net
  523. params:
  524. cluster_id: {{ stack_name }}
  525. volume_size: {{ lb_volume_size }}
  526. depends_on:
  527. - interface
  528. {% endif %}
  529. masters:
  530. type: OS::Heat::ResourceGroup
  531. properties:
  532. count: {{ num_masters }}
  533. resource_def:
  534. {% if use_bastion|bool %}
  535. type: server_nofloating.yaml
  536. {% else %}
  537. type: server.yaml
  538. {% endif %}
  539. properties:
  540. name:
  541. str_replace:
  542. template: k8s_type-%index%.cluster_id
  543. params:
  544. cluster_id: {{ stack_name }}
  545. k8s_type: {{ master_hostname }}
  546. cluster_env: {{ public_dns_domain }}
  547. cluster_id: {{ stack_name }}
  548. group:
  549. str_replace:
  550. template: k8s_type.cluster_id
  551. params:
  552. k8s_type: masters
  553. cluster_id: {{ stack_name }}
  554. type: master
  555. image: {{ openstack_master_image }}
  556. flavor: {{ master_flavor }}
  557. key_name: {{ ssh_public_key }}
  558. net: { get_resource: net }
  559. subnet: { get_resource: subnet }
  560. secgrp:
  561. {% if openstack_flat_secgrp|default(False)|bool %}
  562. - { get_resource: flat-secgrp }
  563. {% else %}
  564. - { get_resource: master-secgrp }
  565. - { get_resource: node-secgrp }
  566. {% if num_etcd|int == 0 %}
  567. - { get_resource: etcd-secgrp }
  568. {% endif %}
  569. {% endif %}
  570. - { get_resource: common-secgrp }
  571. {% if not use_bastion|bool %}
  572. floating_network: {{ external_network }}
  573. {% endif %}
  574. net_name:
  575. str_replace:
  576. template: openshift-ansible-cluster_id-net
  577. params:
  578. cluster_id: {{ stack_name }}
  579. volume_size: {{ master_volume_size }}
  580. depends_on:
  581. - interface
  582. compute_nodes:
  583. type: OS::Heat::ResourceGroup
  584. properties:
  585. count: {{ num_nodes }}
  586. removal_policies:
  587. - resource_list: {{ nodes_to_remove }}
  588. resource_def:
  589. {% if use_bastion|bool %}
  590. type: server_nofloating.yaml
  591. {% else %}
  592. type: server.yaml
  593. {% endif %}
  594. properties:
  595. name:
  596. str_replace:
  597. template: sub_type_k8s_type-%index%.cluster_id
  598. params:
  599. cluster_id: {{ stack_name }}
  600. sub_type_k8s_type: {{ node_hostname }}
  601. cluster_env: {{ public_dns_domain }}
  602. cluster_id: {{ stack_name }}
  603. group:
  604. str_replace:
  605. template: k8s_type.cluster_id
  606. params:
  607. k8s_type: nodes
  608. cluster_id: {{ stack_name }}
  609. type: node
  610. subtype: app
  611. node_labels:
  612. {% for k, v in openshift_cluster_node_labels.app.iteritems() %}
  613. {{ k|e }}: {{ v|e }}
  614. {% endfor %}
  615. image: {{ openstack_node_image }}
  616. flavor: {{ node_flavor }}
  617. key_name: {{ ssh_public_key }}
  618. net: { get_resource: net }
  619. subnet: { get_resource: subnet }
  620. secgrp:
  621. - { get_resource: {% if openstack_flat_secgrp|default(False)|bool %}flat-secgrp{% else %}node-secgrp{% endif %} }
  622. - { get_resource: common-secgrp }
  623. {% if not use_bastion|bool %}
  624. floating_network: {{ external_network }}
  625. {% endif %}
  626. net_name:
  627. str_replace:
  628. template: openshift-ansible-cluster_id-net
  629. params:
  630. cluster_id: {{ stack_name }}
  631. volume_size: {{ node_volume_size }}
  632. depends_on:
  633. - interface
  634. infra_nodes:
  635. type: OS::Heat::ResourceGroup
  636. properties:
  637. count: {{ num_infra }}
  638. resource_def:
  639. type: server.yaml
  640. properties:
  641. name:
  642. str_replace:
  643. template: sub_type_k8s_type-%index%.cluster_id
  644. params:
  645. cluster_id: {{ stack_name }}
  646. sub_type_k8s_type: {{ infra_hostname }}
  647. cluster_env: {{ public_dns_domain }}
  648. cluster_id: {{ stack_name }}
  649. group:
  650. str_replace:
  651. template: k8s_type.cluster_id
  652. params:
  653. k8s_type: infra
  654. cluster_id: {{ stack_name }}
  655. type: node
  656. subtype: infra
  657. node_labels:
  658. {% for k, v in openshift_cluster_node_labels.infra.iteritems() %}
  659. {{ k|e }}: {{ v|e }}
  660. {% endfor %}
  661. image: {{ openstack_infra_image }}
  662. flavor: {{ infra_flavor }}
  663. key_name: {{ ssh_public_key }}
  664. net: { get_resource: net }
  665. subnet: { get_resource: subnet }
  666. secgrp:
  667. # TODO(bogdando) filter only required node rules into infra-secgrp
  668. {% if openstack_flat_secgrp|default(False)|bool %}
  669. - { get_resource: flat-secgrp }
  670. {% else %}
  671. - { get_resource: node-secgrp }
  672. {% endif %}
  673. {% if ui_ssh_tunnel|bool and num_masters|int < 2 %}
  674. - { get_resource: lb-secgrp }
  675. {% endif %}
  676. - { get_resource: infra-secgrp }
  677. - { get_resource: common-secgrp }
  678. floating_network: {{ external_network }}
  679. net_name:
  680. str_replace:
  681. template: openshift-ansible-cluster_id-net
  682. params:
  683. cluster_id: {{ stack_name }}
  684. volume_size: {{ infra_volume_size }}
  685. depends_on:
  686. - interface
  687. {% if num_dns|int > 0 %}
  688. dns:
  689. type: OS::Heat::ResourceGroup
  690. properties:
  691. count: {{ num_dns }}
  692. resource_def:
  693. type: server.yaml
  694. properties:
  695. name:
  696. str_replace:
  697. template: k8s_type-%index%.cluster_id
  698. params:
  699. cluster_id: {{ stack_name }}
  700. k8s_type: {{ dns_hostname }}
  701. cluster_env: {{ public_dns_domain }}
  702. cluster_id: {{ stack_name }}
  703. group:
  704. str_replace:
  705. template: k8s_type.cluster_id
  706. params:
  707. k8s_type: dns
  708. cluster_id: {{ stack_name }}
  709. type: dns
  710. image: {{ openstack_dns_image }}
  711. flavor: {{ dns_flavor }}
  712. key_name: {{ ssh_public_key }}
  713. net: { get_resource: net }
  714. subnet: { get_resource: subnet }
  715. secgrp:
  716. - { get_resource: dns-secgrp }
  717. - { get_resource: common-secgrp }
  718. floating_network: {{ external_network }}
  719. net_name:
  720. str_replace:
  721. template: openshift-ansible-cluster_id-net
  722. params:
  723. cluster_id: {{ stack_name }}
  724. volume_size: {{ dns_volume_size }}
  725. depends_on:
  726. - interface
  727. {% endif %}