Make grimes a docker host

This commit is contained in:
Jake Howard 2020-04-26 13:44:06 +01:00
parent 50cb5a56fc
commit 05c7690b83
Signed by: jake
GPG key ID: 57AFB45680EDD477
2 changed files with 20 additions and 1 deletions

View file

@ -11,16 +11,26 @@
roles:
- gateway
- hosts: intersect
- hosts:
- intersect
- grimes
roles:
- role: geerlingguy.docker
become: true
vars:
docker_install_compose: false # This role installs the binary directly, which is kinda nasty
docker_package: "{{ 'docker-ce' if ansible_os_family == 'Debian' else 'docker' }}"
docker_users:
- "{{ user }}"
- docker-cleanup
- hosts: intersect
roles:
- netdata
- traefik
- watchtower
- docker
- hosts: grimes
roles:
- netdata

View file

@ -3,18 +3,27 @@
name: docker-compose
become: true
- name: Ensure group "somegroup" exists
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: Clean up docker containers
cron: