init.yml 2.1 KB

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