bootstrap.yml 918 B

12345678910111213141516171819202122232425262728
  1. ---
  2. - name: ensure the node-bootstrap service account exists
  3. oc_serviceaccount:
  4. name: node-bootstrapper
  5. namespace: openshift-infra
  6. state: present
  7. run_once: true
  8. - name: grant node-bootstrapper the correct permissions to bootstrap
  9. oc_adm_policy_user:
  10. namespace: openshift-infra
  11. user: system:serviceaccount:openshift-infra:node-bootstrapper
  12. resource_kind: cluster-role
  13. resource_name: system:node-bootstrapper
  14. state: present
  15. run_once: true
  16. # TODO: create a module for this command.
  17. # oc_serviceaccounts_kubeconfig
  18. - name: create service account kubeconfig with csr rights
  19. command: "oc serviceaccounts create-kubeconfig node-bootstrapper -n openshift-infra"
  20. register: kubeconfig_out
  21. - name: put service account kubeconfig into a file on disk for bootstrap
  22. copy:
  23. content: "{{ kubeconfig_out.stdout }}"
  24. dest: "{{ openshift_master_config_dir }}/bootstrap.kubeconfig"