bootkube.yml 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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: setup AWS creds
  24. hosts: masters:bootstrap:workers
  25. tasks:
  26. - import_role:
  27. name: openshift_node40
  28. tasks_from: aws.yml
  29. - name: Config bootstrap node
  30. hosts: bootstrap
  31. tasks:
  32. - import_role:
  33. name: openshift_node40
  34. tasks_from: aws.yml
  35. - import_role:
  36. name: openshift_node40
  37. tasks_from: config.yml
  38. - import_role:
  39. name: openshift_node40
  40. tasks_from: systemd.yml
  41. - name: Start masters
  42. hosts: masters
  43. tasks:
  44. # TODO Read this from master's ignition file
  45. - set_fact:
  46. openshift_bootstrap_endpoint: "https://{{ bootstrap }}:49500/config/master?etcd_index={{ index }}"
  47. vars:
  48. bootstrap: "{{ hostvars[groups['bootstrap'][0]]['ansible_host'] }}"
  49. index: "{{ groups['masters'].index(inventory_hostname) }}"
  50. - name: Wait for bootstrap endpoint to show up
  51. uri:
  52. url: "{{ openshift_bootstrap_endpoint }}"
  53. validate_certs: false
  54. delay: 10
  55. retries: 60
  56. register: result
  57. until:
  58. - "'status' in result"
  59. - result.status == 200
  60. - import_role:
  61. name: openshift_node40
  62. tasks_from: config.yml
  63. - name: Make sure etcd user exists
  64. user:
  65. name: etcd
  66. - import_role:
  67. name: openshift_node40
  68. tasks_from: systemd.yml
  69. - name: Start workers
  70. hosts: workers
  71. tasks:
  72. # TODO Read this from master's ignition file
  73. - set_fact:
  74. openshift_bootstrap_endpoint: "https://{{ bootstrap }}:49500/config/worker"
  75. vars:
  76. bootstrap: "{{ hostvars[groups['bootstrap'][0]]['ansible_host'] }}"
  77. - name: Wait for bootstrap endpoint to show up
  78. uri:
  79. url: "{{ openshift_bootstrap_endpoint }}"
  80. validate_certs: false
  81. delay: 10
  82. retries: 60
  83. register: result
  84. until:
  85. - "'status' in result"
  86. - result.status == 200
  87. - import_role:
  88. name: openshift_node40
  89. tasks_from: config.yml
  90. - import_role:
  91. name: openshift_node40
  92. tasks_from: systemd.yml