wire_aggregator.yml 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. ---
  2. # TODO: this currently has a bug where hostnames are required
  3. - name: Creating Aggregator signer certs
  4. command: >
  5. oc adm ca create-signer-cert
  6. --cert=/etc/origin/master/front-proxy-ca.crt
  7. --key=/etc/origin/master/front-proxy-ca.key
  8. --serial=/etc/origin/master/ca.serial.txt
  9. # oc_adm_ca_server_cert:
  10. # cert: /etc/origin/master/front-proxy-ca.crt
  11. # key: /etc/origin/master/front-proxy-ca.key
  12. - name: Create api-client config for Aggregator
  13. command: >
  14. oc adm create-api-client-config
  15. --certificate-authority=/etc/origin/master/front-proxy-ca.crt
  16. --signer-cert=/etc/origin/master/front-proxy-ca.crt
  17. --signer-key=/etc/origin/master/front-proxy-ca.key
  18. --user aggregator-front-proxy
  19. --client-dir=/etc/origin/master
  20. --signer-serial=/etc/origin/master/ca.serial.txt
  21. - name: Update master config
  22. yedit:
  23. state: present
  24. src: /etc/origin/master/master-config.yaml
  25. edits:
  26. - key: aggregatorConfig.proxyClientInfo.certFile
  27. value: aggregator-front-proxy.crt
  28. - key: aggregatorConfig.proxyClientInfo.keyFile
  29. value: aggregator-front-proxy.key
  30. - key: authConfig.requestHeader.clientCA
  31. value: front-proxy-ca.crt
  32. - key: authConfig.requestHeader.clientCommonNames
  33. value: [aggregator-front-proxy]
  34. - key: authConfig.requestHeader.usernameHeaders
  35. value: [X-Remote-User]
  36. - key: authConfig.requestHeader.groupHeaders
  37. value: [X-Remote-Group]
  38. - key: authConfig.requestHeader.extraHeaderPrefixes
  39. value: [X-Remote-Extra-]
  40. register: yedit_output
  41. #restart master serially here
  42. - name: restart master
  43. systemd: name={{ openshift.common.service_type }}-master state=restarted
  44. when:
  45. - yedit_output.changed
  46. - openshift.master.ha is not defined or not openshift.master.ha | bool
  47. - name: restart master api
  48. systemd: name={{ openshift.common.service_type }}-master-api state=restarted
  49. when:
  50. - yedit_output.changed
  51. - openshift.master.ha is defined and openshift.master.ha | bool
  52. - openshift.master.cluster_method == 'native'
  53. - name: restart master controllers
  54. systemd: name={{ openshift.common.service_type }}-master-controllers state=restarted
  55. when:
  56. - yedit_output.changed
  57. - openshift.master.ha is defined and openshift.master.ha | bool
  58. - openshift.master.cluster_method == 'native'
  59. - name: Verify API Server
  60. # Using curl here since the uri module requires python-httplib2 and
  61. # wait_for port doesn't provide health information.
  62. command: >
  63. curl --silent --tlsv1.2
  64. {% if openshift.common.version_gte_3_2_or_1_2 | bool %}
  65. --cacert {{ openshift.common.config_base }}/master/ca-bundle.crt
  66. {% else %}
  67. --cacert {{ openshift.common.config_base }}/master/ca.crt
  68. {% endif %}
  69. {{ openshift.master.api_url }}/healthz/ready
  70. args:
  71. # Disables the following warning:
  72. # Consider using get_url or uri module rather than running curl
  73. warn: no
  74. register: api_available_output
  75. until: api_available_output.stdout == 'ok'
  76. retries: 120
  77. delay: 1
  78. changed_when: false
  79. when:
  80. - yedit_output.changed