infrastructure/ansible/roles/docker_cleanup/tasks/main.yml
Jake Howard 2af9f8529d
All checks were successful
/ terraform (push) Successful in 46s
/ ansible (push) Successful in 1m53s
Fix new ansible-lint errors
Quite a few changes here, hopefully they work!
2023-06-15 15:16:19 +01:00

52 lines
1.1 KiB
YAML

- name: Install docker-compose
package:
name: docker-compose
become: true
when: ansible_os_family != 'Debian'
- name: Create docker group
group:
name: "{{ docker_user.name }}"
state: present
gid: "{{ docker_user.id }}"
become: true
- name: Create docker user
user:
name: "{{ docker_user.name }}"
uid: "{{ docker_user.id }}"
group: "{{ docker_user.name }}"
create_home: false
become: true
- name: Add user to docker user group
user:
name: "{{ me.user }}"
groups: "{{ docker_user.name }}"
append: true
become: true
- name: Add user to docker group
user:
name: "{{ me.user }}"
groups: docker
append: true
become: true
- name: Clean up docker containers
cron:
name: clean up docker containers
hour: 1
minute: 0
job: docker system prune -af --volumes
- name: Install util scripts
copy:
src: ./files/docker-utils
dest: "{{ home }}"
mode: "755"
directory_mode: "755"
- name: override docker service for zfs dependencies
include_tasks: zfs-override.yml
when: docker_zfs_override