main.yaml 676 B

123456789101112131415161718192021222324252627
  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 priviledged
  7. shell: oc 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"