main.yml 806 B

1234567891011121314151617181920212223242526272829303132
  1. ---
  2. - name: Create docker-gc tempdir
  3. command: mktemp -d
  4. register: templates_tmpdir
  5. # NOTE: oc_adm_policy_user does not support -z (yet)
  6. - name: Add dockergc as privileged
  7. command: "{{ openshift_client_binary }} adm policy add-scc-to-user -z dockergc privileged"
  8. # oc_adm_policy_user:
  9. # user: dockergc
  10. # resource_kind: scc
  11. # resource_name: privileged
  12. # state: present
  13. - name: Create dockergc DaemonSet
  14. become: yes
  15. template:
  16. src: dockergc-ds.yaml.j2
  17. dest: "{{ templates_tmpdir.stdout }}/dockergc-ds.yaml"
  18. - name: Apply dockergc DaemonSet
  19. oc_obj:
  20. state: present
  21. kind: DaemonSet
  22. name: "dockergc"
  23. files:
  24. - "{{ templates_tmpdir.stdout }}/dockergc-ds.yaml"
  25. - name: Remove temp directory
  26. file:
  27. state: absent
  28. name: "{{ templates_tmpdir.stdout }}"