Heat templates for deploying OpenStack
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

openshift-master.yaml 6.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. heat_template_version: queens
  2. description: External tasks definition for OpenShift
  3. parameters:
  4. RoleNetIpMap:
  5. default: {}
  6. type: json
  7. ServiceData:
  8. default: {}
  9. description: Dictionary packing service data
  10. type: json
  11. ServiceNetMap:
  12. default: {}
  13. description: Mapping of service_name -> network name. Typically set
  14. via parameter_defaults in the resource registry. This
  15. mapping overrides those in ServiceNetMapDefaults.
  16. type: json
  17. DefaultPasswords:
  18. default: {}
  19. type: json
  20. RoleName:
  21. default: ''
  22. description: Role name on which the service is applied
  23. type: string
  24. RoleParameters:
  25. default: {}
  26. description: Parameters specific to the role
  27. type: json
  28. EndpointMap:
  29. default: {}
  30. description: Mapping of service endpoint -> protocol. Typically set
  31. via parameter_defaults in the resource registry.
  32. type: json
  33. outputs:
  34. role_data:
  35. description: Role data for the Openshift Service
  36. value:
  37. service_name: openshift_master
  38. config_settings:
  39. tripleo.openshift_master.firewall_rules:
  40. '200 openshift-master api':
  41. dport: 6443
  42. proto: tcp
  43. '200 openshift-master etcd':
  44. dport:
  45. - 2379
  46. - 2380
  47. proto: tcp
  48. upgrade_tasks: []
  49. step_config: ''
  50. external_deploy_tasks:
  51. - name: openshift_master step 2
  52. when: step == '2'
  53. block:
  54. - name: create openshift temp dirs
  55. file:
  56. path: "{{item}}"
  57. state: directory
  58. with_items:
  59. - "{{playbook_dir}}/openshift"
  60. - name: generate openshift inventory
  61. copy:
  62. dest: "{{playbook_dir}}/openshift/inventory.yml"
  63. content: |
  64. masters:
  65. hosts:
  66. {% for host in groups['openshift_master'] -%}
  67. {{ hostvars.raw_get(host)['ansible_hostname'] }}:
  68. ansible_user: {{ hostvars.raw_get(host)['ansible_user'] | default(hostvars.raw_get(host)['ansible_ssh_user']) | default('root') }}
  69. ansible_host: {{ hostvars.raw_get(host)['ansible_host'] | default(host) }}
  70. ansible_become: true
  71. {% endfor %}
  72. nodes:
  73. hosts:
  74. {% for host in groups['openshift_worker'] -%}
  75. {{ hostvars.raw_get(host)['ansible_hostname'] }}:
  76. ansible_user: {{ hostvars.raw_get(host)['ansible_user'] | default(hostvars.raw_get(host)['ansible_ssh_user']) | default('root') }}
  77. ansible_host: {{ hostvars.raw_get(host)['ansible_host'] | default(host) }}
  78. ansible_become: true
  79. openshift_schedulable: true
  80. {% endfor %}
  81. etcd:
  82. children:
  83. masters: {}
  84. OSEv3:
  85. children:
  86. masters: {}
  87. nodes: {}
  88. - name: generate openshift global vars
  89. copy:
  90. dest: "{{playbook_dir}}/openshift/global_vars.yml"
  91. content: |
  92. containerized: true
  93. openshift_master_cluster_method: native
  94. openshift_use_dnsmasq: true
  95. openshift_deployment_type: origin
  96. openshift_release: '3.6'
  97. openshift_image_tag: v3.6.1
  98. enable_excluders: false
  99. openshift_docker_selinux_enabled: false
  100. osm_etcd_image: "registry.fedoraproject.org/f27/etcd"
  101. # NOTE(flaper87): Needed for the gate
  102. openshift_disable_check: disk_availability,docker_storage,memory_availability,docker_image_availability
  103. skip_ovs_svc_handlers: true
  104. - name: generate openshift playbook
  105. copy:
  106. dest: "{{playbook_dir}}/openshift/playbook.yml"
  107. content: |
  108. # NOTE(flaper87): The NetworkManager setup has been moved
  109. # into openshift-ansible but it's not been released yet.
  110. # This code will go away as soon as an rpm with the required
  111. # roles hits the repo.
  112. - name: Install NetworkManager
  113. hosts: all
  114. tasks:
  115. - name: install NetworkManager
  116. package:
  117. name: NetworkManager
  118. state: present
  119. - name: generate nm dispatcher script
  120. copy:
  121. dest: "/etc/NetworkManager/dispatcher.d/99-os-net-config-origin-dns.sh"
  122. owner: root
  123. mode: 0755
  124. content: >-
  125. #!/bin/bash -x
  126. for dev in $(jq '.network_config[] | {name}.name' /etc/os-net-config/config.json);
  127. do
  128. temp="${dev%\"}"
  129. temp="${temp#\"}"
  130. export DEVICE_IFACE=$temp
  131. /etc/NetworkManager/dispatcher.d/99-origin-dns.sh $DEVICE_IFACE up
  132. done
  133. - name: Enable NetworkManager
  134. service:
  135. name: NetworkManager
  136. state: restarted
  137. enabled: yes
  138. - include: /usr/share/ansible/openshift-ansible/playbooks/byo/config.yml
  139. - name: set openshift command
  140. set_fact:
  141. openshift_command: >-
  142. {%- if openshift_command is defined -%}
  143. {{openshift_command}}
  144. {%- else -%}
  145. ANSIBLE_HOST_KEY_CHECKING=False
  146. ansible-playbook
  147. -i '{{playbook_dir}}/openshift/inventory.yml'
  148. --extra-vars '@{{playbook_dir}}/openshift/global_vars.yml'
  149. '{{playbook_dir}}/openshift/playbook.yml'
  150. {%- endif -%}
  151. - name: print openshift command
  152. debug:
  153. var: openshift_command
  154. - name: run openshift (immediate log at {{playbook_dir}}/openshift/playbook.log)
  155. shell: |
  156. {{openshift_command}} 2>&1 | tee {{playbook_dir}}/openshift/playbook.log
  157. exit ${PIPESTATUS[0]}
  158. register: outputs
  159. - name: print openshift outputs
  160. debug:
  161. var: (outputs.stderr|default('')).split('\n')|union(outputs.stdout_lines|default([]))
  162. failed_when: outputs|failed
  163. when: outputs is defined