static.yml 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. ---
  2. - name: Enable bootstrapping in the master config
  3. yedit:
  4. src: /etc/origin/master/master-config.yaml
  5. edits:
  6. - key: kubernetesMasterConfig.controllerArguments.cluster-signing-cert-file
  7. value:
  8. - /etc/origin/master/ca.crt
  9. - key: kubernetesMasterConfig.controllerArguments.cluster-signing-key-file
  10. value:
  11. - /etc/origin/master/ca.key
  12. when:
  13. - openshift_control_plane_apply_cluster_signing_config | default(True)
  14. - name: Create temp directory for static pods
  15. command: mktemp -d /tmp/openshift-ansible-XXXXXX
  16. register: mktemp
  17. changed_when: false
  18. - name: Prepare master static pods
  19. copy:
  20. src: "{{ item }}"
  21. dest: "{{ mktemp.stdout }}"
  22. mode: 0600
  23. with_items:
  24. - apiserver.yaml
  25. - controller.yaml
  26. - name: Update master static pods
  27. yedit:
  28. src: "{{ mktemp.stdout }}/{{ item }}"
  29. edits:
  30. - key: spec.containers[0].image
  31. value: "{{ osm_image }}"
  32. with_items:
  33. - apiserver.yaml
  34. - controller.yaml
  35. - name: Update master static pod (api)
  36. yedit:
  37. src: "{{ mktemp.stdout }}/apiserver.yaml"
  38. edits:
  39. - key: spec.containers[0].livenessProbe.httpGet.port
  40. value: "{{ openshift_master_api_port }}"
  41. - key: spec.containers[0].readinessProbe.httpGet.port
  42. value: "{{ openshift_master_api_port }}"
  43. - name: ensure pod location exists
  44. file:
  45. path: "{{ openshift_control_plane_static_pod_location }}"
  46. state: directory
  47. mode: "0755"
  48. - name: Update master static pods
  49. copy:
  50. remote_src: true
  51. src: "{{ mktemp.stdout }}/{{ item }}"
  52. dest: "{{ openshift_control_plane_static_pod_location }}"
  53. mode: 0600
  54. with_items:
  55. - apiserver.yaml
  56. - controller.yaml
  57. - name: Remove old files in /etc/sysconfig
  58. file:
  59. name: "{{ item }}"
  60. state: absent
  61. with_items:
  62. - /etc/sysconfig/{{ openshift_service_type }}-master-api
  63. - /etc/sysconfig/{{ openshift_service_type }}-master-controllers
  64. - name: Remove temporary directory
  65. file:
  66. name: "{{ mktemp.stdout }}"
  67. state: absent
  68. changed_when: False