node_system_container.yml 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. # TODO: remove when system container is fixed to not include it
  8. - name: Ensure old system path is set
  9. file:
  10. state: directory
  11. path: "{{ item }}"
  12. mode: '0750'
  13. with_items:
  14. - "/etc/origin/openvswitch"
  15. - "/var/lib/kubelet"
  16. - name: Pre-pull node system container image
  17. command: >
  18. atomic pull --storage=ostree {{ system_osn_image }}
  19. register: pull_result
  20. retries: 3
  21. delay: 5
  22. until: pull_result.rc == 0
  23. changed_when: "'Pulling layer' in pull_result.stdout"
  24. - name: Install or Update node system container
  25. oc_atomic_container:
  26. name: "{{ openshift_service_type }}-node"
  27. image: "{{ osn_image }}"
  28. values:
  29. - "DNS_DOMAIN={{ openshift.common.dns_domain }}"
  30. - "DOCKER_SERVICE={{ openshift_docker_service_name }}.service"
  31. - "MASTER_SERVICE={{ openshift_service_type }}-master-controllers.service"
  32. - 'ADDTL_MOUNTS={{ l_node_syscon_add_mounts2 }}'
  33. state: latest
  34. vars:
  35. # We need to evaluate some variables here to ensure
  36. # l_bind_docker_reg_auth is evaluated after registry_auth.yml has been
  37. # processed.
  38. # Determine if we want to include auth credentials mount.
  39. l_node_syscon_auth_mounts_l: "{{ l_bind_docker_reg_auth | ternary(openshift_node_syscon_auth_mounts_l,[]) }}"
  40. # Join any user-provided mounts and auth_mounts into a combined list.
  41. l_node_syscon_add_mounts_l: "{{ openshift_node_syscon_add_mounts_l | union(l_node_syscon_auth_mounts_l) }}"
  42. # We must prepend a ',' here to ensure the value is inserted properly into an
  43. # existing json list in the container's config.json
  44. # lib_utils_oo_l_of_d_to_csv is a custom filter plugin in roles/lib_utils/oo_filters.py
  45. l_node_syscon_add_mounts: ",{{ l_node_syscon_add_mounts_l | lib_utils_oo_l_of_d_to_csv }}"
  46. # if we have just a ',' then both mount lists were empty, we don't want to add
  47. # anything to config.json
  48. l_node_syscon_add_mounts2: "{{ (l_node_syscon_add_mounts != ',') | bool | ternary(l_node_syscon_add_mounts,'') }}"
  49. # TODO: network manager on RHEL is failing to execute 99-origin-dns.sh with signal 13, an immediate
  50. # restart seems to allow the job to configure. Only occurs with system containers.
  51. - name: Restart network manager to ensure networking configuration is in place
  52. systemd:
  53. name: NetworkManager
  54. enabled: yes
  55. state: restarted