config.yml 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. ---
  2. - name: Check that node image is present
  3. command: 'docker images -q "{{ osn_image }}"'
  4. register: node_image
  5. # This task runs async to save time while the node is being configured
  6. - name: Pre-pull node image
  7. docker_image:
  8. name: "{{ osn_image }}"
  9. environment:
  10. NO_PROXY: "{{ openshift.common.no_proxy | default('') }}"
  11. when: node_image.stdout_lines == []
  12. # 10 minutes to pull the image
  13. async: 600
  14. poll: 0
  15. register: image_prepull
  16. - name: Install the systemd units
  17. import_tasks: systemd_units.yml
  18. - file:
  19. dest: "{{ l2_openshift_node_kubelet_args['config'] }}"
  20. state: directory
  21. when: ('config' in l2_openshift_node_kubelet_args) | bool
  22. - name: Configure Node Environment Variables
  23. lineinfile:
  24. dest: /etc/sysconfig/{{ openshift_service_type }}-node
  25. regexp: "^{{ item.key }}="
  26. line: "{{ item.key }}={{ item.value }}"
  27. create: true
  28. with_dict: "{{ openshift_node_env_vars }}"
  29. - name: Ensure the node static pod directory exists
  30. file:
  31. path: "{{ openshift.common.config_base }}/node/pods"
  32. state: directory
  33. mode: 0755
  34. - name: Create flexvolume directory when running on atomic
  35. file:
  36. state: directory
  37. path: "/etc/origin/kubelet-plugins/volume/exec"
  38. mode: '0750'
  39. when: openshift_is_atomic | bool
  40. - name: include aws provider credentials
  41. import_tasks: aws.yml
  42. when: not (openshift_node_use_instance_profiles | default(False))
  43. - name: Check status of node image pre-pull
  44. async_status:
  45. jid: "{{ image_prepull.ansible_job_id }}"
  46. register: job_result
  47. until: job_result.finished
  48. when:
  49. - node_image.stdout_lines == []
  50. - not openshift_is_atomic | bool
  51. retries: 20
  52. delay: 30
  53. failed_when: false