node_system_container.yml 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. ---
  2. # system containers create their own service unit files based on templates
  3. # that are part of the container image.
  4. # oc_atomic_container will create a systemd service unit file in
  5. # /etc/systemd/system/origin-node.service (origin) or
  6. # /etc/systemd/system/atomic-openshift-node.service (enterprise)
  7. - name: Pre-pull node system container image
  8. command: >
  9. atomic pull --storage=ostree {{ 'docker:' if system_images_registry == 'docker' else system_images_registry + '/' }}{{ osn_image }}:{{ openshift_image_tag }}
  10. register: pull_result
  11. changed_when: "'Pulling layer' in pull_result.stdout"
  12. - name: Install or Update node system container
  13. oc_atomic_container:
  14. name: "{{ openshift_service_type }}-node"
  15. image: "{{ 'docker:' if system_images_registry == 'docker' else system_images_registry + '/' }}{{ osn_image }}:{{ openshift_image_tag }}"
  16. values:
  17. - "DNS_DOMAIN={{ openshift.common.dns_domain }}"
  18. - "DOCKER_SERVICE={{ openshift_docker_service_name }}.service"
  19. - "MASTER_SERVICE={{ openshift_service_type }}-master-controllers.service"
  20. - 'ADDTL_MOUNTS={{ l_node_syscon_add_mounts2 }}'
  21. state: latest
  22. vars:
  23. # We need to evaluate some variables here to ensure
  24. # l_bind_docker_reg_auth is evaluated after registry_auth.yml has been
  25. # processed.
  26. # Determine if we want to include auth credentials mount.
  27. l_node_syscon_auth_mounts_l: "{{ l_bind_docker_reg_auth | ternary(openshift_node_syscon_auth_mounts_l,[]) }}"
  28. # Join any user-provided mounts and auth_mounts into a combined list.
  29. l_node_syscon_add_mounts_l: "{{ openshift_node_syscon_add_mounts_l | union(l_node_syscon_auth_mounts_l) }}"
  30. # We must prepend a ',' here to ensure the value is inserted properly into an
  31. # existing json list in the container's config.json
  32. # lib_utils_oo_l_of_d_to_csv is a custom filter plugin in roles/lib_utils/oo_filters.py
  33. l_node_syscon_add_mounts: ",{{ l_node_syscon_add_mounts_l | lib_utils_oo_l_of_d_to_csv }}"
  34. # if we have just a ',' then both mount lists were empty, we don't want to add
  35. # anything to config.json
  36. l_node_syscon_add_mounts2: "{{ (l_node_syscon_add_mounts != ',') | bool | ternary(l_node_syscon_add_mounts,'') }}"