basic_facts.yml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. ---
  2. - name: Ensure that all non-node hosts are accessible
  3. hosts: oo_masters_to_config:oo_etcd_to_config:oo_lb_to_config:oo_nfs_to_config
  4. any_errors_fatal: true
  5. tasks:
  6. - name: Initialize basic host facts
  7. # l_init_fact_hosts is passed in via play during control-plane-only
  8. # upgrades and scale-up plays; otherwise oo_all_hosts is used.
  9. hosts: "{{ l_init_fact_hosts | default('oo_all_hosts') }}"
  10. roles:
  11. - role: openshift_facts
  12. tasks:
  13. # TODO: Should this role be refactored into health_checks??
  14. - name: Run openshift_sanitize_inventory to set variables
  15. import_role:
  16. name: openshift_sanitize_inventory
  17. no_log: True
  18. - name: Detecting Operating System from ostree_booted
  19. stat:
  20. path: /run/ostree-booted
  21. register: ostree_booted
  22. # TODO(michaelgugino) remove this line once CI is updated.
  23. - name: set openshift_deployment_type if unset
  24. set_fact:
  25. openshift_deployment_type: "{{ deployment_type }}"
  26. when:
  27. - openshift_deployment_type is undefined
  28. - deployment_type is defined
  29. - name: initialize_facts set fact openshift_is_atomic and openshift_is_containerized
  30. set_fact:
  31. openshift_is_atomic: "{{ ostree_booted.stat.exists }}"
  32. openshift_is_containerized: "{{ ostree_booted.stat.exists or (containerized | default(false) | bool) }}"
  33. # TODO: Should this be moved into health checks??
  34. # Seems as though any check that happens with a corresponding fail should move into health_checks
  35. # Fail as early as possible if Atomic and old version of Docker
  36. - when:
  37. - openshift_is_atomic | bool
  38. block:
  39. # See https://access.redhat.com/articles/2317361
  40. # and https://github.com/ansible/ansible/issues/15892
  41. # NOTE: the "'s can not be removed at this level else the docker command will fail
  42. # NOTE: When ansible >2.2.1.x is used this can be updated per
  43. # https://github.com/openshift/openshift-ansible/pull/3475#discussion_r103525121
  44. - name: Determine Atomic Host Docker Version
  45. shell: 'CURLY="{"; docker version --format "$CURLY{json .Server.Version}}"'
  46. register: l_atomic_docker_version
  47. - name: assert atomic host docker version is 1.12 or later
  48. assert:
  49. that:
  50. - l_atomic_docker_version.stdout | replace('"', '') is version_compare('1.12','>=')
  51. msg: Installation on Atomic Host requires Docker 1.12 or later. Please upgrade and restart the Atomic Host.
  52. - name: Initialize special first-master variables
  53. hosts: oo_first_master
  54. roles:
  55. - role: openshift_facts
  56. tasks:
  57. - set_fact:
  58. # We need to setup openshift_client_binary here for special uses of delegate_to in
  59. # later roles and plays.
  60. first_master_client_binary: "{{ openshift_client_binary }}"
  61. #Some roles may require this to be set for first master
  62. openshift_client_binary: "{{ openshift_client_binary }}"
  63. - name: Disable web console if required
  64. hosts: oo_masters_to_config
  65. gather_facts: no
  66. tasks:
  67. - set_fact:
  68. openshift_web_console_install: False
  69. when: openshift_deployment_subtype == 'registry' or ( osm_disabled_features is defined and 'WebConsole' in osm_disabled_features )