distribute_bootstrap.yml 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. ---
  2. - name: Gather node information
  3. openshift_facts:
  4. role: node
  5. local_facts:
  6. bootstrapped: true
  7. - name: Copy master bootstrap config locally
  8. slurp:
  9. src: "/etc/origin/master/bootstrap.kubeconfig"
  10. register: bootstrap_credentials
  11. delegate_to: "{{ groups.oo_first_master.0 }}"
  12. run_once: true
  13. no_log: true
  14. - name: Distribute bootstrap kubeconfig if one does not exist
  15. copy:
  16. content: "{{ bootstrap_credentials.content | b64decode }}"
  17. dest: "/etc/origin/node/bootstrap.kubeconfig"
  18. mode: 0700
  19. owner: root
  20. group: root
  21. force: no
  22. no_log: true
  23. - name: Start and enable node for bootstrapping
  24. systemd:
  25. name: "{{ openshift_service_type }}-node"
  26. state: restarted
  27. enabled: yes
  28. no_block: yes
  29. register: node_start
  30. - when: node_start is failed
  31. block:
  32. - name: Get node logs
  33. command: journalctl --no-pager -n 300 -u {{ openshift_service_type }}-node
  34. register: logs_node
  35. ignore_errors: true
  36. - debug:
  37. msg: "{{ logs_node.stdout_lines }}"
  38. - fail:
  39. msg: Node start failed.