infrastructure/ansible/roles/docker_cleanup/tasks/main.yml
Jake Howard 24d11deeae
Update ansible-lint
Required a lot of renaming :(
2020-09-26 17:53:47 +01:00

46 lines
933 B
YAML

- name: Install docker-compose
package:
name: docker-compose
become: true
- 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: "{{ user }}"
groups: "{{ docker_user.name }}"
append: true
become: true
- name: Add user to docker group
user:
name: "{{ user }}"
groups: docker
append: true
become: true
- name: Clean up docker containers
cron:
name: clean up docker containers
special_time: weekly
job: docker system prune -af --volumes
- name: Install util scripts
copy:
src: ./files/docker-utils
dest: "{{ home }}"
mode: 0755
directory_mode: 0755