bootkube.yml 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. ---
  2. # Generate config using openshift-installer, set Base Domain to testing.tt
  3. # Add bootstrap host in [bootstrap] group and set ignition_file
  4. # Add master host to [masters] group
  5. # Add worker hosts in [workers] group
  6. # Make sure bootstrap has <clusterid>-api.<dns base> name
  7. # Make sure masters have <clusterid>-etcd-<index>.<dns base> name
  8. # FIXME: use dnsmasq to fake DNS entries
  9. - import_playbook: init/main.yml
  10. vars:
  11. l_install_base_packages: True
  12. l_repo_hosts: "all:!all"
  13. # TODO: proper firewalld setup
  14. # 49500 on bootstrap; 2379, 6443, 10250 on masters, 10250 on workers
  15. - import_playbook: container-runtime/private/setup_storage.yml
  16. - import_playbook: container-runtime/private/config.yml
  17. - name: install nodes
  18. hosts: nodes
  19. tasks:
  20. - import_role:
  21. name: openshift_node40
  22. tasks_from: install.yml
  23. - name: Config bootstrap node
  24. hosts: bootstrap
  25. tasks:
  26. - import_role:
  27. name: openshift_node40
  28. tasks_from: config.yml
  29. - import_role:
  30. name: openshift_node40
  31. tasks_from: systemd.yml
  32. - name: Start masters
  33. hosts: masters
  34. tasks:
  35. # TODO Read this from master's ignition file
  36. - set_fact:
  37. openshift_bootstrap_endpoint: "https://{{ bootstrap }}:49500/config/master?etcd_index={{ index }}"
  38. vars:
  39. bootstrap: "{{ hostvars[groups['bootstrap'][0]]['ansible_host'] }}"
  40. index: "{{ groups['masters'].index(inventory_hostname) }}"
  41. - name: Wait for bootstrap endpoint to show up
  42. uri:
  43. url: "{{ openshift_bootstrap_endpoint }}"
  44. validate_certs: false
  45. delay: 10
  46. retries: 60
  47. register: result
  48. until:
  49. - "'status' in result"
  50. - result.status == 200
  51. - import_role:
  52. name: openshift_node40
  53. tasks_from: config.yml
  54. - name: Make sure etcd user exists
  55. user:
  56. name: etcd
  57. - import_role:
  58. name: openshift_node40
  59. tasks_from: systemd.yml
  60. - name: Start workers
  61. hosts: workers
  62. tasks:
  63. # TODO Read this from master's ignition file
  64. - set_fact:
  65. openshift_bootstrap_endpoint: "https://{{ bootstrap }}:49500/config/worker"
  66. vars:
  67. bootstrap: "{{ hostvars[groups['bootstrap'][0]]['ansible_host'] }}"
  68. - name: Wait for bootstrap endpoint to show up
  69. uri:
  70. url: "{{ openshift_bootstrap_endpoint }}"
  71. validate_certs: false
  72. delay: 10
  73. retries: 60
  74. register: result
  75. until:
  76. - "'status' in result"
  77. - result.status == 200
  78. - import_role:
  79. name: openshift_node40
  80. tasks_from: config.yml
  81. - import_role:
  82. name: openshift_node40
  83. tasks_from: systemd.yml