static.yml 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. - name: Create temp directory for static pods
  13. command: mktemp -d /tmp/openshift-ansible-XXXXXX
  14. register: mktemp
  15. changed_when: false
  16. - name: Prepare master static pods
  17. copy:
  18. src: "{{ item }}"
  19. dest: "{{ mktemp.stdout }}"
  20. mode: 0600
  21. with_items:
  22. - apiserver.yaml
  23. - controller.yaml
  24. - name: Update master static pods
  25. yedit:
  26. src: "{{ mktemp.stdout }}/{{ item }}"
  27. edits:
  28. - key: spec.containers[0].image
  29. value: "{{ osm_image }}:{{ openshift_image_tag }}"
  30. with_items:
  31. - apiserver.yaml
  32. - controller.yaml
  33. - name: Update master static pods
  34. copy:
  35. remote_src: true
  36. src: "{{ mktemp.stdout }}/{{ item }}"
  37. dest: "/etc/origin/node/pods/"
  38. mode: 0600
  39. with_items:
  40. - apiserver.yaml
  41. - controller.yaml
  42. - name: Remove temporary directory
  43. file:
  44. name: "{{ mktemp.stdout }}"
  45. state: absent
  46. changed_when: False
  47. - name: Establish the default bootstrap kubeconfig for masters
  48. copy:
  49. remote_src: true
  50. src: "/etc/origin/master/admin.kubeconfig"
  51. dest: "{{ item }}"
  52. mode: 0600
  53. with_items:
  54. # bootstrap as an admin
  55. - /etc/origin/node/bootstrap.kubeconfig
  56. # copy to this location to bypass initial bootstrap request
  57. - /etc/origin/node/node.kubeconfig