config.yml 4.4 KB

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