main.yml 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. ---
  2. docker_cli_auth_config_path: '/root/.docker'
  3. openshift_docker_signature_verification: False
  4. repoquery_cmd: "{{ 'dnf repoquery --latest-limit 1 -d 0' if ansible_pkg_mgr == 'dnf' else 'repoquery --plugins' }}"
  5. openshift_docker_alternative_creds: False
  6. # oreg_url is defined by user input.
  7. oreg_host: "{{ oreg_url.split('/')[0] if (oreg_url is defined and '.' in oreg_url.split('/')[0]) else '' }}"
  8. oreg_auth_credentials_replace: False
  9. openshift_docker_use_system_container: False
  10. openshift_docker_disable_push_dockerhub: False # bool
  11. openshift_docker_selinux_enabled: True
  12. openshift_docker_service_name: "{{ 'container-engine' if (openshift_docker_use_system_container | default(False)) else 'docker' }}"
  13. openshift_docker_hosted_registry_insecure: False # bool
  14. openshift_docker_hosted_registry_network_default: "{{ openshift_portal_net | default(False) }}"
  15. openshift_docker_hosted_registry_network: "{{ openshift_docker_hosted_registry_network_default }}"
  16. openshift_docker_additional_registries: []
  17. openshift_docker_blocked_registries: []
  18. openshift_docker_insecure_registries: []
  19. openshift_docker_ent_reg: 'registry.access.redhat.com'
  20. openshift_docker_options: False # str
  21. openshift_docker_log_driver: False # str
  22. openshift_docker_log_options: []
  23. # The l2_docker_* variables convert csv strings to lists, if
  24. # necessary. These variables should be used in place of their respective
  25. # openshift_docker_* counterparts to ensure the properly formatted lists are
  26. # utilized.
  27. l2_docker_additional_registries: "{% if openshift_docker_additional_registries is string %}{% if openshift_docker_additional_registries == '' %}[]{% elif ',' in openshift_docker_additional_registries %}{{ openshift_docker_additional_registries.split(',') | list }}{% else %}{{ [ openshift_docker_additional_registries ] }}{% endif %}{% else %}{{ openshift_docker_additional_registries }}{% endif %}"
  28. l2_docker_blocked_registries: "{% if openshift_docker_blocked_registries is string %}{% if openshift_docker_blocked_registries == '' %}[]{% elif ',' in openshift_docker_blocked_registries %}{{ openshift_docker_blocked_registries.split(',') | list }}{% else %}{{ [ openshift_docker_blocked_registries ] }}{% endif %}{% else %}{{ openshift_docker_blocked_registries }}{% endif %}"
  29. l2_docker_insecure_registries: "{% if openshift_docker_insecure_registries is string %}{% if openshift_docker_insecure_registries == '' %}[]{% elif ',' in openshift_docker_insecure_registries %}{{ openshift_docker_insecure_registries.split(',') | list }}{% else %}{{ [ openshift_docker_insecure_registries ] }}{% endif %}{% else %}{{ openshift_docker_insecure_registries }}{% endif %}"
  30. l2_docker_log_options: "{% if openshift_docker_log_options is string %}{% if ',' in openshift_docker_log_options %}{{ openshift_docker_log_options.split(',') | list }}{% else %}{{ [ openshift_docker_log_options ] }}{% endif %}{% else %}{{ openshift_docker_log_options }}{% endif %}"
  31. openshift_docker_use_etc_containers: False
  32. containers_registries_conf_path: /etc/containers/registries.conf
  33. r_crio_firewall_enabled: "{{ os_firewall_enabled | default(True) }}"
  34. r_crio_use_firewalld: "{{ os_firewall_use_firewalld | default(False) }}"
  35. r_crio_os_firewall_deny: []
  36. r_crio_os_firewall_allow:
  37. - service: crio
  38. port: 10010/tcp
  39. openshift_docker_is_node_or_master: "{{ True if inventory_hostname in (groups['oo_masters_to_config']|default([])) or inventory_hostname in (groups['oo_nodes_to_config']|default([])) else False | bool }}"
  40. docker_alt_storage_path: /var/lib/containers/docker
  41. docker_default_storage_path: /var/lib/docker
  42. docker_storage_path: "{{ docker_default_storage_path }}"
  43. docker_storage_size: 40G
  44. docker_storage_setup_options:
  45. vg: docker_vg
  46. data_size: 99%VG
  47. storage_driver: overlay2
  48. root_lv_name: docker-root-lv
  49. root_lv_size: 100%FREE
  50. root_lv_mount_path: "{{ docker_storage_path }}"
  51. docker_storage_extra_options:
  52. - "--storage-opt overlay2.override_kernel_check=true"
  53. - "--storage-opt overlay2.size={{ docker_storage_size }}"
  54. - "--graph={{ docker_storage_path}}"
  55. # Set local versions of facts that must be in json format for container-daemon.json
  56. # NOTE: When jinja2.9+ is used the container-daemon.json file can move to using tojson
  57. l_docker_log_options: "{{ l2_docker_log_options | to_json }}"
  58. l_docker_log_options_dict: "{{ l2_docker_log_options | oo_list_to_dict | to_json }}"
  59. l_docker_additional_registries: "{{ l2_docker_additional_registries | to_json }}"
  60. l_docker_blocked_registries: "{{ l2_docker_blocked_registries | to_json }}"
  61. l_docker_insecure_registries: "{{ l2_docker_insecure_registries | to_json }}"
  62. l_docker_selinux_enabled: "{{ openshift_docker_selinux_enabled | to_json }}"
  63. docker_http_proxy: "{{ openshift_http_proxy | default('') }}"
  64. docker_https_proxy: "{{ openshift.common.https_proxy | default('') }}"
  65. docker_no_proxy: "{{ openshift.common.no_proxy | default('') }}"
  66. openshift_use_crio: False
  67. openshift_use_crio_only: False
  68. l_openshift_image_tag_default: "{{ openshift_release | default('latest') }}"
  69. l_openshift_image_tag: "{{ openshift_image_tag | default(l_openshift_image_tag_default) | string}}"
  70. # --------------------- #
  71. # systemcontainers_crio #
  72. # --------------------- #
  73. l_insecure_crio_registries: "{{ '\"{}\"'.format('\", \"'.join(l2_docker_insecure_registries)) }}"
  74. l_crio_registries: "{{ l2_docker_additional_registries + ['docker.io'] }}"
  75. l_additional_crio_registries: "{{ '\"{}\"'.format('\", \"'.join(l_crio_registries)) }}"
  76. openshift_crio_image_tag_default: "latest"
  77. l_crt_crio_image_tag_dict:
  78. openshift-enterprise: "{{ l_openshift_image_tag }}"
  79. origin: "{{ openshift_crio_image_tag | default(openshift_crio_image_tag_default) }}"
  80. l_crt_crio_image_prepend_dict:
  81. openshift-enterprise: "registry.access.redhat.com/openshift3"
  82. origin: "docker.io/gscrivano"
  83. l_crt_crio_image_dict:
  84. Fedora:
  85. crio_image_name: "cri-o-fedora"
  86. crio_image_tag: "latest"
  87. CentOS:
  88. crio_image_name: "cri-o-centos"
  89. crio_image_tag: "latest"
  90. RedHat:
  91. crio_image_name: "cri-o"
  92. crio_image_tag: "{{ openshift_crio_image_tag | default(l_crt_crio_image_tag_dict[openshift_deployment_type]) }}"
  93. l_crio_image_prepend: "{{ l_crt_crio_image_prepend_dict[openshift_deployment_type] }}"
  94. l_crio_image_name: "{{ l_crt_crio_image_dict[ansible_distribution]['crio_image_name'] }}"
  95. l_crio_image_tag: "{{ l_crt_crio_image_dict[ansible_distribution] }}"
  96. l_crio_image_default: "{{ l_crio_image_prepend }}/{{ l_crio_image_name }}:{{ l_crio_image_tag }}"
  97. l_crio_image: "{{ openshift_crio_systemcontainer_image_override | default(l_crio_image_default) }}"
  98. # ----------------------- #
  99. # systemcontainers_docker #
  100. # ----------------------- #
  101. l_crt_docker_image_prepend_dict:
  102. Fedora: "registry.fedoraproject.org/latest"
  103. Centos: "docker.io/gscrivano"
  104. RedHat: "registry.access.redhat.com/openshift3"
  105. openshift_docker_image_tag_default: "latest"
  106. l_crt_docker_image_tag_dict:
  107. openshift-enterprise: "{{ l_openshift_image_tag }}"
  108. origin: "{{ openshift_docker_image_tag | default(openshift_docker_image_tag_default) }}"
  109. l_docker_image_prepend: "{{ l_crt_docker_image_prepend_dict[ansible_distribution] }}"
  110. l_docker_image_tag: "{{ l_crt_docker_image_tag_dict[openshift_deployment_type] }}"
  111. l_docker_image_default: "{{ l_docker_image_prepend }}/{{ openshift_docker_service_name }}:{{ l_docker_image_tag }}"
  112. l_docker_image: "{{ openshift_docker_systemcontainer_image_override | default(l_docker_image_default) }}"
  113. l_is_node_system_container: "{{ (openshift_use_node_system_container | default(openshift_use_system_containers | default(false)) | bool) }}"