node.yaml 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. ---
  2. - name: Create CNI bin directory
  3. file:
  4. state: directory
  5. path: "{{ cni_bin_dir }}"
  6. mode: 0755
  7. owner: root
  8. group: root
  9. recurse: yes
  10. - name: Create CNI extraction tempdir
  11. command: mktemp -d
  12. register: cni_tmpdir
  13. - name: Download CNI
  14. get_url:
  15. url: "{{ cni_bin_url }}"
  16. checksum: "sha1:{{ cni_bin_checksum }}"
  17. mode: 0644
  18. dest: "{{ cni_tmpdir.stdout }}"
  19. register: downloaded_tarball
  20. - name: Extract CNI
  21. become: yes
  22. unarchive:
  23. remote_src: True
  24. src: "{{ downloaded_tarball.dest }}"
  25. dest: "{{ cni_bin_dir }}"
  26. when: downloaded_tarball.changed
  27. - name: Ensure CNI net.d exists
  28. file:
  29. path: /etc/cni/net.d
  30. recurse: yes
  31. state: directory
  32. - name: Configure OpenShift node with disabled service proxy
  33. lineinfile:
  34. dest: "/etc/sysconfig/{{ openshift.common.service_type }}-node"
  35. regexp: '^OPTIONS="?(.*?)"?$'
  36. backrefs: yes
  37. backup: yes
  38. line: 'OPTIONS="\1 --disable dns,proxy,plugins"'
  39. - name: force node restart to disable the proxy
  40. service:
  41. name: "{{ openshift.common.service_type }}-node"
  42. state: restarted