config.yml 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. ---
  2. - name: Node Install Checkpoint Start
  3. hosts: localhost
  4. connection: local
  5. gather_facts: false
  6. tasks:
  7. - name: Set Node install 'In Progress'
  8. set_stats:
  9. data:
  10. installer_phase_node: "In Progress"
  11. aggregate: false
  12. - name: Disable excluders
  13. hosts: oo_nodes_to_config
  14. gather_facts: no
  15. roles:
  16. - role: openshift_excluder
  17. r_openshift_excluder_action: disable
  18. r_openshift_excluder_service_type: "{{ openshift.common.service_type }}"
  19. - name: Evaluate node groups
  20. hosts: localhost
  21. become: no
  22. connection: local
  23. tasks:
  24. - name: Evaluate oo_containerized_master_nodes
  25. add_host:
  26. name: "{{ item }}"
  27. groups: oo_containerized_master_nodes
  28. ansible_ssh_user: "{{ g_ssh_user | default(omit) }}"
  29. ansible_become: "{{ g_sudo | default(omit) }}"
  30. with_items: "{{ groups.oo_nodes_to_config | default([]) }}"
  31. when:
  32. - hostvars[item].openshift is defined
  33. - hostvars[item].openshift.common is defined
  34. - hostvars[item].openshift.common.is_containerized | bool
  35. - (item in groups.oo_nodes_to_config and item in groups.oo_masters_to_config)
  36. changed_when: False
  37. - name: Configure containerized nodes
  38. hosts: oo_containerized_master_nodes
  39. serial: 1
  40. vars:
  41. openshift_node_master_api_url: "{{ hostvars[groups.oo_first_master.0].openshift.master.api_url }}"
  42. openshift_node_first_master_ip: "{{ hostvars[groups.oo_first_master.0].openshift.common.ip }}"
  43. openshift_docker_hosted_registry_network: "{{ hostvars[groups.oo_first_master.0].openshift.common.portal_net }}"
  44. openshift_no_proxy_internal_hostnames: "{{ hostvars | oo_select_keys(groups['oo_nodes_to_config']
  45. | union(groups['oo_masters_to_config'])
  46. | union(groups['oo_etcd_to_config'] | default([])))
  47. | oo_collect('openshift.common.hostname') | default([]) | join (',')
  48. }}"
  49. roles:
  50. - role: os_firewall
  51. - role: openshift_node
  52. openshift_ca_host: "{{ groups.oo_first_master.0 }}"
  53. - name: Configure nodes
  54. hosts: oo_nodes_to_config:!oo_containerized_master_nodes
  55. vars:
  56. openshift_node_master_api_url: "{{ hostvars[groups.oo_first_master.0].openshift.master.api_url }}"
  57. openshift_node_first_master_ip: "{{ hostvars[groups.oo_first_master.0].openshift.common.ip }}"
  58. openshift_docker_hosted_registry_network: "{{ hostvars[groups.oo_first_master.0].openshift.common.portal_net }}"
  59. openshift_no_proxy_internal_hostnames: "{{ hostvars | oo_select_keys(groups['oo_nodes_to_config']
  60. | union(groups['oo_masters_to_config'])
  61. | union(groups['oo_etcd_to_config'] | default([])))
  62. | oo_collect('openshift.common.hostname') | default([]) | join (',')
  63. }}"
  64. roles:
  65. - role: os_firewall
  66. - role: openshift_node
  67. openshift_ca_host: "{{ groups.oo_first_master.0 }}"
  68. - name: Additional node config
  69. hosts: oo_nodes_to_config
  70. vars:
  71. openshift_node_master_api_url: "{{ hostvars[groups.oo_first_master.0].openshift.master.api_url }}"
  72. roles:
  73. - role: openshift_facts
  74. - role: openshift_etcd_facts
  75. - role: openshift_etcd_client_certificates
  76. etcd_cert_prefix: flannel.etcd-
  77. etcd_ca_host: "{{ groups.oo_etcd_to_config.0 }}"
  78. etcd_cert_subdir: "openshift-node-{{ openshift.common.hostname }}"
  79. etcd_cert_config_dir: "{{ openshift.common.config_base }}/node"
  80. - role: flannel
  81. etcd_urls: "{{ hostvars[groups.oo_first_master.0].openshift.master.etcd_urls }}"
  82. embedded_etcd: "{{ hostvars[groups.oo_first_master.0].openshift.master.embedded_etcd }}"
  83. when: openshift_use_flannel | default(false) | bool
  84. - role: calico
  85. when: openshift_use_calico | default(false) | bool
  86. - role: nuage_node
  87. when: openshift_use_nuage | default(false) | bool
  88. - role: contiv
  89. contiv_role: netplugin
  90. when: openshift_use_contiv | default(false) | bool
  91. - role: nickhammond.logrotate
  92. - role: openshift_manage_node
  93. openshift_master_host: "{{ groups.oo_first_master.0 }}"
  94. when: not openshift_node_bootstrap | default(False)
  95. tasks:
  96. - name: Create group for deployment type
  97. group_by: key=oo_nodes_deployment_type_{{ openshift.common.deployment_type }}
  98. changed_when: False
  99. - name: Re-enable excluder if it was previously enabled
  100. hosts: oo_nodes_to_config
  101. gather_facts: no
  102. roles:
  103. - role: openshift_excluder
  104. r_openshift_excluder_action: enable
  105. r_openshift_excluder_service_type: "{{ openshift.common.service_type }}"
  106. - name: Node Install Checkpoint End
  107. hosts: localhost
  108. connection: local
  109. gather_facts: false
  110. tasks:
  111. - name: Set Node install 'Complete'
  112. set_stats:
  113. data:
  114. installer_phase_node: "Complete"
  115. aggregate: false