main.yml 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. ---
  2. openshift_node_debug_level: "{{ debug_level | default(2) }}"
  3. openshift_node_iptables_sync_period: '30s'
  4. osn_storage_plugin_deps:
  5. - ceph
  6. - glusterfs
  7. - iscsi
  8. openshift_node_local_quota_per_fsgroup: ""
  9. openshift_node_proxy_mode: iptables
  10. openshift_set_node_ip: False
  11. openshift_config_base: '/etc/origin'
  12. openshift_deployment_type: "{{ openshift_deployment_type | default('origin') }}"
  13. system_images_registry_dict:
  14. openshift-enterprise: "registry.access.redhat.com"
  15. origin: "docker.io"
  16. system_images_registry: "{{ system_images_registry_dict[openshift_deployment_type | default('origin')] }}"
  17. l_openshift_images_dict:
  18. origin: 'docker.io/openshift/origin-${component}:${version}'
  19. openshift-enterprise: 'registry.access.redhat.com/openshift3/ose-${component}:${version}'
  20. l_osm_registry_url_default: "{{ l_openshift_images_dict[openshift_deployment_type] }}"
  21. l_os_registry_url: "{{ oreg_url | default(l_osm_registry_url_default) | regex_replace('${version}' | regex_escape, openshift_image_tag | default('${version}')) }}"
  22. osn_image_default: "{{ l_os_registry_url | regex_replace('${component}' | regex_escape, 'node') }}"
  23. osn_image: "{{ (system_images_registry == 'docker') | ternary(osn_image_default, (osn_image_default.split('/')|length==2) | ternary(system_images_registry + '/' + osn_image_default, osn_image_default)) }}"
  24. system_osn_image: "{{ (system_images_registry == 'docker') | ternary('docker:' + osn_image, osn_image) }}"
  25. openshift_oreg_url_default_dict:
  26. origin: "openshift/origin-${component}:${version}"
  27. openshift-enterprise: "openshift3/ose-${component}:${version}"
  28. openshift_oreg_url_default: "{{ openshift_oreg_url_default_dict[openshift_deployment_type] }}"
  29. oreg_url_node: "{{ oreg_url | default(openshift_oreg_url_default) | regex_replace('${version}' | regex_escape, openshift_image_tag | default('${version}')) }}"
  30. openshift_dns_ip: "{{ ansible_default_ipv4['address'] }}"
  31. openshift_node_env_vars: {}
  32. # Create list of 'k=v' pairs.
  33. l_node_kubelet_node_labels: "{{ openshift_node_labels | default({}) | lib_utils_oo_dict_to_keqv_list }}"
  34. openshift_node_kubelet_args_dict:
  35. aws:
  36. cloud-provider:
  37. - aws
  38. cloud-config:
  39. - "{{ openshift_config_base ~ '/cloudprovider/aws.conf' }}"
  40. node-labels: "{{ l_node_kubelet_node_labels }}"
  41. openstack:
  42. cloud-provider:
  43. - openstack
  44. cloud-config:
  45. - "{{ openshift_config_base ~ '/cloudprovider/openstack.conf' }}"
  46. node-labels: "{{ l_node_kubelet_node_labels }}"
  47. gce:
  48. cloud-provider:
  49. - gce
  50. cloud-config:
  51. - "{{ openshift_config_base ~ '/cloudprovider/gce.conf' }}"
  52. node-labels: "{{ l_node_kubelet_node_labels }}"
  53. azure:
  54. cloud-provider:
  55. - azure
  56. cloud-config:
  57. - "{{ openshift_config_base ~ '/cloudprovider/azure.conf' }}"
  58. node-labels: "{{ l_node_kubelet_node_labels }}"
  59. vsphere:
  60. cloud-provider:
  61. - vsphere
  62. cloud-config:
  63. - "{{ openshift_config_base ~ '/cloudprovider/vsphere.conf' }}"
  64. node-labels: "{{ l_node_kubelet_node_labels }}"
  65. undefined:
  66. node-labels: "{{ l_node_kubelet_node_labels }}"
  67. l_node_kubelet_args_default: "{{ openshift_node_kubelet_args_dict[openshift_cloudprovider_kind | default('undefined')] }}"
  68. l_openshift_node_kubelet_args: "{{ openshift_node_kubelet_args | default({}) }}"
  69. # Combine the default kubelet_args dictionary (based on cloud provider, if provided)
  70. # with user-supplied openshift_node_kubelet_args.
  71. # openshift_node_kubelet_args will override the defaults, if keys and/or subkeys
  72. # are present in both.
  73. l2_openshift_node_kubelet_args: "{{ l_node_kubelet_args_default | combine(l_openshift_node_kubelet_args, recursive=True) }}"
  74. openshift_node_dnsmasq_install_network_manager_hook: true
  75. # lo must always be present in this list or dnsmasq will conflict with
  76. # the node's dns service.
  77. openshift_node_dnsmasq_except_interfaces:
  78. - lo
  79. r_openshift_node_firewall_enabled: "{{ os_firewall_enabled | default(True) }}"
  80. r_openshift_node_use_firewalld: "{{ os_firewall_use_firewalld | default(False) }}"
  81. l_is_node_system_container: "{{ openshift_use_node_system_container | default(openshift_use_system_containers | default(openshift_is_containerized | default(false))) | bool }}"
  82. openshift_node_syscon_auth_mounts_l:
  83. - type: bind
  84. source: "{{ oreg_auth_credentials_path }}"
  85. destination: "/root/.docker"
  86. options:
  87. - ro
  88. - bind
  89. # If we need to add new mounts in the future, or the user wants to mount data.
  90. # This should be in the same format as auth_mounts_l above.
  91. openshift_node_syscon_add_mounts_l: []
  92. openshift_service_type_dict:
  93. origin: origin
  94. openshift-enterprise: atomic-openshift
  95. openshift_service_type: "{{ openshift_service_type_dict[openshift_deployment_type] }}"
  96. default_r_openshift_node_image_prep_packages:
  97. - "{{ openshift_service_type }}-node"
  98. - "{{ openshift_service_type }}-docker-excluder"
  99. - ansible
  100. - bash-completion
  101. - docker
  102. - haproxy
  103. - dnsmasq
  104. - ntp
  105. - logrotate
  106. - httpd-tools
  107. - bind-utils
  108. - firewalld
  109. - libselinux-python
  110. - conntrack-tools
  111. - openssl
  112. - cloud-init
  113. - iproute
  114. - python-dbus
  115. - PyYAML
  116. - yum-utils
  117. - glusterfs-fuse
  118. - device-mapper-multipath
  119. - nfs-utils
  120. - cockpit-ws
  121. - cockpit-system
  122. - cockpit-bridge
  123. - cockpit-docker
  124. - iscsi-initiator-utils
  125. - ceph-common
  126. r_openshift_node_image_prep_packages: "{{ default_r_openshift_node_image_prep_packages | union(openshift_node_image_prep_packages | default([])) }}"
  127. r_openshift_node_os_firewall_deny: []
  128. default_r_openshift_node_os_firewall_allow:
  129. - service: Kubernetes kubelet
  130. port: 10250/tcp
  131. - service: http
  132. port: 80/tcp
  133. - service: https
  134. port: 443/tcp
  135. - service: OpenShift OVS sdn
  136. port: 4789/udp
  137. cond: openshift_use_openshift_sdn | bool
  138. - service: Calico BGP Port
  139. port: 179/tcp
  140. cond: "{{ openshift_node_use_calico }}"
  141. - service: Kubernetes service NodePort TCP
  142. port: "{{ openshift_node_port_range | default('') }}/tcp"
  143. cond: "{{ openshift_node_port_range is defined }}"
  144. - service: Kubernetes service NodePort UDP
  145. port: "{{ openshift_node_port_range | default('') }}/udp"
  146. cond: "{{ openshift_node_port_range is defined }}"
  147. # Allow multiple port ranges to be added to the role
  148. r_openshift_node_os_firewall_allow: "{{ default_r_openshift_node_os_firewall_allow | union(openshift_node_open_ports | default([])) }}"
  149. # oreg_url is defined by user input
  150. oreg_host: "{{ oreg_url.split('/')[0] if (oreg_url is defined and '.' in oreg_url.split('/')[0]) else '' }}"
  151. oreg_auth_credentials_path: "{{ openshift_node_data_dir }}/.docker"
  152. oreg_auth_credentials_replace: False
  153. l_bind_docker_reg_auth: False
  154. openshift_use_crio: False
  155. l_crio_var_sock: "/var/run/crio/crio.sock"
  156. openshift_docker_alternative_creds: "{{ (openshift_docker_use_system_container | default(False) | bool) or (openshift_use_crio_only | default(False) | bool) }}"
  157. openshift_docker_service_name: "{{ 'container-engine' if (openshift_docker_use_system_container | default(False) | bool) else 'docker' }}"
  158. # These defaults assume forcing journald persistence, fsync to disk once
  159. # a second, rate-limiting to 10,000 logs a second, no forwarding to
  160. # syslog or wall, using 8GB of disk space maximum, using 10MB journal
  161. # files, keeping only a days worth of logs per journal file, and
  162. # retaining journal files no longer than a month.
  163. journald_vars_to_replace:
  164. - { var: Storage, val: persistent }
  165. - { var: Compress, val: yes }
  166. - { var: SyncIntervalSec, val: 1s }
  167. - { var: RateLimitInterval, val: 1s }
  168. - { var: RateLimitBurst, val: 10000 }
  169. - { var: SystemMaxUse, val: 8G }
  170. - { var: SystemKeepFree, val: 20% }
  171. - { var: SystemMaxFileSize, val: 10M }
  172. - { var: MaxRetentionSec, val: 1month }
  173. - { var: MaxFileSec, val: 1day }
  174. - { var: ForwardToSyslog, val: no }
  175. - { var: ForwardToWall, val: no }
  176. # NOTE
  177. # r_openshift_node_*_default may be defined external to this role.
  178. # openshift_use_*, if defined, may affect other roles or play behavior.
  179. openshift_node_use_openshift_sdn_default: "{{ openshift_use_openshift_sdn | default(True) }}"
  180. openshift_node_use_openshift_sdn: "{{ openshift_node_use_openshift_sdn_default }}"
  181. openshift_node_sdn_network_plugin_name_default: "{{ os_sdn_network_plugin_name | default('redhat/openshift-ovs-subnet') }}"
  182. openshift_node_sdn_network_plugin_name: "{{ openshift_node_sdn_network_plugin_name_default }}"
  183. openshift_node_use_calico_default: "{{ openshift_use_calico | default(False) }}"
  184. openshift_node_use_calico: "{{ openshift_node_use_calico_default }}"
  185. openshift_node_use_nuage_default: "{{ openshift_use_nuage | default(False) }}"
  186. openshift_node_use_nuage: "{{ openshift_node_use_nuage_default }}"
  187. openshift_node_use_contiv_default: "{{ openshift_use_contiv | default(False) }}"
  188. openshift_node_use_contiv: "{{ openshift_node_use_contiv_default }}"
  189. openshift_node_use_kuryr_default: "{{ openshift_use_kuryr | default(False) }}"
  190. openshift_node_use_kuryr: "{{ openshift_node_use_kuryr_default }}"
  191. openshift_node_data_dir_default: "{{ openshift_data_dir | default('/var/lib/origin') }}"
  192. openshift_node_data_dir: "{{ openshift_node_data_dir_default }}"
  193. openshift_node_config_dir_default: "/etc/origin/node"
  194. openshift_node_config_dir: "{{ openshift_node_config_dir_default }}"
  195. openshift_node_image_config_latest_default: "{{ openshift_image_config_latest | default(False) }}"
  196. openshift_node_image_config_latest: "{{ openshift_node_image_config_latest_default }}"
  197. openshift_node_use_instance_profiles: False