main.yml 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. ---
  2. docker_cli_auth_config_path: '/root/.docker'
  3. openshift_docker_signature_verification: False
  4. openshift_docker_alternative_creds: False
  5. # oreg_url is defined by user input.
  6. oreg_host: "{{ oreg_url.split('/')[0] if (oreg_url is defined and '.' in oreg_url.split('/')[0]) else '' }}"
  7. oreg_auth_credentials_replace: False
  8. openshift_docker_use_system_container: False
  9. openshift_docker_disable_push_dockerhub: False # bool
  10. openshift_docker_selinux_enabled: True
  11. openshift_docker_service_name: "{{ 'container-engine' if (openshift_docker_use_system_container | default(False) | bool) else 'docker' }}"
  12. openshift_docker_hosted_registry_insecure: False # bool
  13. openshift_docker_hosted_registry_network: "{{ openshift.common.portal_net }}"
  14. openshift_docker_additional_registries: []
  15. openshift_docker_blocked_registries: []
  16. openshift_docker_insecure_registries: []
  17. openshift_docker_ent_reg: 'registry.access.redhat.com'
  18. openshift_docker_options: False # str
  19. openshift_docker_log_driver: False # str
  20. openshift_docker_log_options: []
  21. # The l2_docker_* variables convert csv strings to lists, if
  22. # necessary. These variables should be used in place of their respective
  23. # openshift_docker_* counterparts to ensure the properly formatted lists are
  24. # utilized.
  25. 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 %}"
  26. 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 %}"
  27. 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 %}"
  28. 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 %}"
  29. openshift_docker_use_etc_containers: False
  30. containers_registries_conf_path: /etc/containers/registries.conf
  31. r_crio_firewall_enabled: "{{ os_firewall_enabled | default(True) }}"
  32. r_crio_use_firewalld: "{{ os_firewall_use_firewalld | default(False) }}"
  33. r_crio_os_firewall_deny: []
  34. r_crio_os_firewall_allow:
  35. - service: crio
  36. port: 10010/tcp
  37. r_crio_use_openshift_sdn: "{{ openshift_use_openshift_sdn | default(True) }}"
  38. 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 }}"
  39. docker_alt_storage_path: /var/lib/containers/docker
  40. docker_default_storage_path: /var/lib/docker
  41. docker_storage_path: "{{ docker_default_storage_path }}"
  42. docker_storage_size: 40G
  43. docker_storage_setup_options:
  44. vg: docker_vg
  45. data_size: 99%VG
  46. storage_driver: overlay2
  47. root_lv_name: docker-root-lv
  48. root_lv_size: 100%FREE
  49. root_lv_mount_path: "{{ docker_storage_path }}"
  50. docker_storage_extra_options:
  51. - "--storage-opt overlay2.override_kernel_check=true"
  52. - "{{ '--storage-opt overlay2.size=' ~ docker_storage_size if container_runtime_docker_storage_setup_device is defined and container_runtime_docker_storage_setup_device != '' else '' }}"
  53. - "--graph={{ docker_storage_path}}"
  54. # Set local versions of facts that must be in json format for container-daemon.json
  55. # NOTE: When jinja2.9+ is used the container-daemon.json file can move to using tojson
  56. l_docker_log_options: "{{ l2_docker_log_options | to_json }}"
  57. l_docker_log_options_dict: "{{ l2_docker_log_options | lib_utils_oo_list_to_dict | to_json }}"
  58. l_docker_additional_registries: "{{ l2_docker_additional_registries | to_json }}"
  59. l_docker_blocked_registries: "{{ l2_docker_blocked_registries | to_json }}"
  60. l_docker_insecure_registries: "{{ l2_docker_insecure_registries | to_json }}"
  61. l_docker_selinux_enabled: "{{ openshift_docker_selinux_enabled | to_json }}"
  62. docker_http_proxy: "{{ openshift_http_proxy | default('') }}"
  63. docker_https_proxy: "{{ openshift.common.https_proxy | default('') }}"
  64. docker_no_proxy: "{{ openshift.common.no_proxy | default('') }}"
  65. openshift_use_crio: False
  66. openshift_crio_use_rpm: 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. l_required_docker_version: '1.12'
  71. # --------------------- #
  72. # systemcontainers_crio #
  73. # --------------------- #
  74. l_insecure_crio_registries: "{{ '\"{}\"'.format('\", \"'.join(l2_docker_insecure_registries)) }}"
  75. l_crio_registries: "{{ l2_docker_additional_registries + ['docker.io'] }}"
  76. l_additional_crio_registries: "{{ '\"{}\"'.format('\", \"'.join(l_crio_registries)) }}"
  77. # this is a list of dictionaries of mounts
  78. # container_runtime_crio_additional_mounts:
  79. # - destination: /test
  80. # source: /var/test
  81. # options:
  82. # - rw
  83. # - mode=755
  84. # type: bind
  85. container_runtime_crio_additional_mounts: []
  86. l_crio_additional_mounts: "{{ ',' + (container_runtime_crio_additional_mounts | lib_utils_oo_l_of_d_to_csv) if container_runtime_crio_additional_mounts != [] else '' }}"
  87. # this is a list of dictionaries of mounts
  88. # container_runtime_docker_additional_mounts:
  89. # - destination: /test
  90. # source: /var/test
  91. # options:
  92. # - rw
  93. # - mode=755
  94. # type: bind
  95. container_runtime_docker_additional_mounts: []
  96. l_docker_additional_mounts: "{{ ',' + (container_runtime_docker_additional_mounts | lib_utils_oo_l_of_d_to_csv) if container_runtime_docker_additional_mounts != [] else '' }}"
  97. openshift_crio_image_tag_default: "latest"
  98. l_crt_crio_image_tag_dict:
  99. openshift-enterprise: "{{ l_openshift_image_tag }}"
  100. origin: "{{ openshift_crio_image_tag | default(openshift_crio_image_tag_default) }}"
  101. l_crt_crio_image_dict:
  102. Fedora: "registry.fedoraproject.org/latest/cri-o"
  103. CentOS: "registry.centos.org/projectatomic/cri-o"
  104. RedHat: "registry.access.redhat.com/openshift3/cri-o"
  105. l_crio_image_name: "{{ l_crt_crio_image_dict[ansible_distribution] }}"
  106. l_crio_image_tag: "{{ l_crt_crio_image_tag_dict[openshift_deployment_type] }}"
  107. l_crio_image_default: "{{ l_crio_image_name }}:{{ l_crio_image_tag }}"
  108. l_crio_image: "{{ openshift_crio_systemcontainer_image_override | default(l_crio_image_default) }}"
  109. # ----------------------- #
  110. # systemcontainers_docker #
  111. # ----------------------- #
  112. l_crt_docker_image_dict:
  113. Fedora: "registry.fedoraproject.org/latest/docker"
  114. CentOS: "registry.centos.org/projectatomic/docker"
  115. RedHat: "registry.access.redhat.com/openshift3/container-engine"
  116. openshift_docker_image_tag_default: "latest"
  117. l_crt_docker_image_tag_dict:
  118. openshift-enterprise: "{{ l_openshift_image_tag }}"
  119. origin: "{{ openshift_docker_image_tag | default(openshift_docker_image_tag_default) }}"
  120. l_docker_image_prepend: "{{ l_crt_docker_image_dict[ansible_distribution] }}"
  121. l_docker_image_tag: "{{ l_crt_docker_image_tag_dict[openshift_deployment_type] }}"
  122. l_docker_image_default: "{{ l_docker_image_prepend }}:{{ l_docker_image_tag }}"
  123. l_docker_image: "{{ openshift_docker_systemcontainer_image_override | default(l_docker_image_default) }}"
  124. l_is_node_system_container: "{{ (openshift_use_node_system_container | default(openshift_use_system_containers | default(false)) | bool) }}"
  125. l_crio_use_new_var_sock: "{{ (l_openshift_image_tag == 'latest') or (l_openshift_image_tag | version_compare('3.9', '>=')) | bool }}"
  126. l_crio_var_sock: "{{ l_crio_use_new_var_sock | ternary('/var/run/crio/crio.sock', '/var/run/crio.sock') }}"
  127. container_runtime_oci_umounts:
  128. - '/var/lib/containers/storage/*'
  129. - '/run/containers/storage/*'
  130. - '/var/lib/origin/*'