2020-03-02 19:37:11 +00:00
|
|
|
- name: Install docker-compose
|
2020-04-26 11:25:01 +01:00
|
|
|
package:
|
2020-03-25 21:27:15 +00:00
|
|
|
name: docker-compose
|
2020-01-28 21:32:29 +00:00
|
|
|
become: true
|
2021-02-07 15:56:25 +00:00
|
|
|
when: ansible_os_family != 'Debian'
|
2020-01-28 21:32:29 +00:00
|
|
|
|
2020-05-09 20:48:46 +01:00
|
|
|
- name: Create docker group
|
2020-04-26 13:44:06 +01:00
|
|
|
group:
|
|
|
|
name: "{{ docker_user.name }}"
|
|
|
|
state: present
|
|
|
|
gid: "{{ docker_user.id }}"
|
|
|
|
become: true
|
|
|
|
|
2020-01-28 21:32:29 +00:00
|
|
|
- name: Create docker user
|
|
|
|
user:
|
|
|
|
name: "{{ docker_user.name }}"
|
|
|
|
uid: "{{ docker_user.id }}"
|
|
|
|
group: "{{ docker_user.name }}"
|
|
|
|
create_home: false
|
2020-04-26 13:44:06 +01:00
|
|
|
become: true
|
2020-01-30 13:27:10 +00:00
|
|
|
|
2020-04-02 09:05:21 +01:00
|
|
|
- name: Add user to docker user group
|
|
|
|
user:
|
2023-06-15 15:16:19 +01:00
|
|
|
name: "{{ me.user }}"
|
2020-04-02 09:05:21 +01:00
|
|
|
groups: "{{ docker_user.name }}"
|
|
|
|
append: true
|
2020-04-26 13:44:06 +01:00
|
|
|
become: true
|
2020-04-02 09:05:21 +01:00
|
|
|
|
2020-05-09 20:48:46 +01:00
|
|
|
- name: Add user to docker group
|
|
|
|
user:
|
2023-06-15 15:16:19 +01:00
|
|
|
name: "{{ me.user }}"
|
2020-05-10 19:23:41 +01:00
|
|
|
groups: docker
|
2020-05-09 20:48:46 +01:00
|
|
|
append: true
|
|
|
|
become: true
|
|
|
|
|
2020-01-30 13:27:10 +00:00
|
|
|
- name: Clean up docker containers
|
|
|
|
cron:
|
|
|
|
name: clean up docker containers
|
2022-11-20 22:52:00 +00:00
|
|
|
hour: 1
|
2021-05-30 13:55:44 +01:00
|
|
|
minute: 0
|
2020-03-30 18:23:11 +01:00
|
|
|
job: docker system prune -af --volumes
|
2020-02-02 22:20:17 +00:00
|
|
|
|
|
|
|
- name: Install util scripts
|
|
|
|
copy:
|
|
|
|
src: ./files/docker-utils
|
2023-06-17 16:00:30 +01:00
|
|
|
dest: "{{ me.home }}"
|
2023-06-15 15:16:19 +01:00
|
|
|
mode: "755"
|
|
|
|
directory_mode: "755"
|
2020-12-21 21:37:46 +00:00
|
|
|
|
|
|
|
- name: override docker service for zfs dependencies
|
2022-01-22 20:21:32 +00:00
|
|
|
include_tasks: zfs-override.yml
|
2020-12-21 21:37:46 +00:00
|
|
|
when: docker_zfs_override
|