main.yml 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. ---
  2. - name: Detecting Operating System
  3. stat:
  4. path: /run/ostree-booted
  5. register: ostree_booted
  6. # Locally setup containerized facts for now
  7. - set_fact:
  8. l_is_atomic: "{{ ostree_booted.stat.exists }}"
  9. - set_fact:
  10. l_is_containerized: "{{ (l_is_atomic | bool) or (containerized | default(false) | bool) }}"
  11. l_is_openvswitch_system_container: "{{ (use_openvswitch_system_container | default(use_system_containers) | bool) }}"
  12. l_is_node_system_container: "{{ (use_node_system_container | default(use_system_containers) | bool) }}"
  13. l_is_master_system_container: "{{ (use_master_system_container | default(use_system_containers) | bool) }}"
  14. l_is_etcd_system_container: "{{ (use_etcd_system_container | default(use_system_containers) | bool) }}"
  15. - name: Validate python version
  16. fail:
  17. msg: |
  18. openshift-ansible requires Python 3 for {{ ansible_distribution }};
  19. For information on enabling Python 3 with Ansible, see https://docs.ansible.com/ansible/python_3_support.html
  20. when: ansible_distribution == 'Fedora' and ansible_python['version']['major'] != 3
  21. - name: Validate python version
  22. fail:
  23. msg: "openshift-ansible requires Python 2 for {{ ansible_distribution }}"
  24. when: ansible_distribution != 'Fedora' and ansible_python['version']['major'] != 2
  25. - name: Ensure various deps are installed
  26. package: name={{ item }} state=present
  27. with_items: "{{ required_packages }}"
  28. when: not l_is_atomic | bool
  29. - name: Gather Cluster facts and set is_containerized if needed
  30. openshift_facts:
  31. role: common
  32. local_facts:
  33. debug_level: "{{ openshift_debug_level | default(2) }}"
  34. # TODO: Deprecate deployment_type in favor of openshift_deployment_type
  35. deployment_type: "{{ openshift_deployment_type | default(deployment_type) }}"
  36. deployment_subtype: "{{ openshift_deployment_subtype | default(None) }}"
  37. cluster_id: "{{ openshift_cluster_id | default('default') }}"
  38. hostname: "{{ openshift_hostname | default(None) }}"
  39. ip: "{{ openshift_ip | default(None) }}"
  40. is_containerized: "{{ l_is_containerized | default(None) }}"
  41. is_openvswitch_system_container: "{{ l_is_openvswitch_system_container | default(false) }}"
  42. is_node_system_container: "{{ l_is_node_system_container | default(false) }}"
  43. is_master_system_container: "{{ l_is_master_system_container | default(false) }}"
  44. is_etcd_system_container: "{{ l_is_etcd_system_container | default(false) }}"
  45. system_images_registry: "{{ system_images_registry | default('') }}"
  46. public_hostname: "{{ openshift_public_hostname | default(None) }}"
  47. public_ip: "{{ openshift_public_ip | default(None) }}"
  48. portal_net: "{{ openshift_portal_net | default(openshift_master_portal_net) | default(None) }}"
  49. http_proxy: "{{ openshift_http_proxy | default(None) }}"
  50. https_proxy: "{{ openshift_https_proxy | default(None) }}"
  51. no_proxy: "{{ openshift_no_proxy | default(None) }}"
  52. generate_no_proxy_hosts: "{{ openshift_generate_no_proxy_hosts | default(True) }}"
  53. no_proxy_internal_hostnames: "{{ openshift_no_proxy_internal_hostnames | default(None) }}"
  54. sdn_network_plugin_name: "{{ os_sdn_network_plugin_name | default(None) }}"
  55. use_openshift_sdn: "{{ openshift_use_openshift_sdn | default(None) }}"
  56. - name: Set repoquery command
  57. set_fact:
  58. repoquery_cmd: "{{ 'dnf repoquery --latest-limit 1 -d 0' if ansible_pkg_mgr == 'dnf' else 'repoquery --plugins' }}"