init.yml 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. ---
  2. - name: Create initial host groups for localhost
  3. hosts: localhost
  4. connection: local
  5. become: no
  6. gather_facts: no
  7. tags:
  8. - always
  9. tasks:
  10. - include_vars: ../../../byo/openshift-cluster/cluster_hosts.yml
  11. - name: Evaluate group l_oo_all_hosts
  12. add_host:
  13. name: "{{ item }}"
  14. groups: l_oo_all_hosts
  15. with_items: "{{ g_all_hosts | default([]) }}"
  16. changed_when: False
  17. - name: Create initial host groups for all hosts
  18. hosts: l_oo_all_hosts
  19. gather_facts: no
  20. tags:
  21. - always
  22. tasks:
  23. - include_vars: ../../../byo/openshift-cluster/cluster_hosts.yml
  24. - include: ../evaluate_groups.yml
  25. vars:
  26. # Do not allow adding hosts during upgrade.
  27. g_new_master_hosts: []
  28. g_new_node_hosts: []
  29. openshift_cluster_id: "{{ cluster_id | default('default') }}"
  30. openshift_deployment_type: "{{ deployment_type }}"
  31. - name: Set oo_options
  32. hosts: oo_all_hosts
  33. tasks:
  34. - set_fact:
  35. openshift_docker_additional_registries: "{{ lookup('oo_option', 'docker_additional_registries') }}"
  36. when: openshift_docker_additional_registries is not defined
  37. - set_fact:
  38. openshift_docker_insecure_registries: "{{ lookup('oo_option', 'docker_insecure_registries') }}"
  39. when: openshift_docker_insecure_registries is not defined
  40. - set_fact:
  41. openshift_docker_blocked_registries: "{{ lookup('oo_option', 'docker_blocked_registries') }}"
  42. when: openshift_docker_blocked_registries is not defined
  43. - set_fact:
  44. openshift_docker_options: "{{ lookup('oo_option', 'docker_options') }}"
  45. when: openshift_docker_options is not defined
  46. - set_fact:
  47. openshift_docker_log_driver: "{{ lookup('oo_option', 'docker_log_driver') }}"
  48. when: openshift_docker_log_driver is not defined
  49. - set_fact:
  50. openshift_docker_log_options: "{{ lookup('oo_option', 'docker_log_options') }}"
  51. when: openshift_docker_log_options is not defined
  52. - include: ../initialize_facts.yml
  53. - name: Ensure clean repo cache in the event repos have been changed manually
  54. hosts: oo_all_hosts
  55. tags:
  56. - pre_upgrade
  57. tasks:
  58. - name: Clean package cache
  59. command: "{{ ansible_pkg_mgr }} clean all"
  60. when: not openshift.common.is_atomic | bool
  61. args:
  62. warn: no