config.yml 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. # TODO: add the validate parameter when there is a validation command to run
  23. - name: Create the Node config
  24. template:
  25. dest: "{{ openshift.common.config_base }}/node/node-config.yaml"
  26. src: node.yaml.v1.j2
  27. backup: true
  28. owner: root
  29. group: root
  30. mode: 0600
  31. - name: Configure Node Environment Variables
  32. lineinfile:
  33. dest: /etc/sysconfig/{{ openshift_service_type }}-node
  34. regexp: "^{{ item.key }}="
  35. line: "{{ item.key }}={{ item.value }}"
  36. create: true
  37. with_dict: "{{ openshift_node_env_vars }}"
  38. - name: Ensure the node static pod directory exists
  39. file:
  40. path: "{{ openshift.common.config_base }}/node/pods"
  41. state: directory
  42. mode: 0755
  43. - name: Create flexvolume directory when running on atomic
  44. file:
  45. state: directory
  46. path: "{{ openshift_flexvolume_container_directory_default }}/volume/exec"
  47. mode: '0750'
  48. when: openshift_is_atomic | bool
  49. - name: include aws provider credentials
  50. import_tasks: aws.yml
  51. when: not (openshift_node_use_instance_profiles | default(False))
  52. - name: Check status of node image pre-pull
  53. async_status:
  54. jid: "{{ image_prepull.ansible_job_id }}"
  55. register: job_result
  56. until: job_result.finished
  57. when:
  58. - node_image.stdout_lines == []
  59. - not openshift_is_atomic | bool
  60. retries: 20
  61. delay: 30
  62. failed_when: false