infrastructure/ansible/roles/docker_cleanup/tasks/main.yml
Jake Howard d5a7a61171
All checks were successful
/ terraform (push) Successful in 38s
/ ansible (push) Successful in 1m30s
Remove unnecessary use of become from some roles
This should make execution much faster
2024-09-09 17:09:03 +01:00

56 lines
1.2 KiB
YAML

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