distribute_bootstrap.yml 952 B

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