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: roles:
- gateway - gateway
- hosts: intersect - hosts:
- intersect
- grimes
roles: roles:
- role: geerlingguy.docker - role: geerlingguy.docker
become: true become: true
vars: vars:
docker_install_compose: false # This role installs the binary directly, which is kinda nasty 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: docker_users:
- "{{ user }}" - "{{ user }}"
- docker-cleanup - docker-cleanup
- hosts: intersect
roles:
- netdata - netdata
- traefik - traefik
- watchtower - watchtower
- docker - docker
- hosts: grimes
roles:
- netdata

View file

@ -3,18 +3,27 @@
name: docker-compose name: docker-compose
become: true become: true
- name: Ensure group "somegroup" exists
group:
name: "{{ docker_user.name }}"
state: present
gid: "{{ docker_user.id }}"
become: true
- name: Create docker user - name: Create docker user
user: user:
name: "{{ docker_user.name }}" name: "{{ docker_user.name }}"
uid: "{{ docker_user.id }}" uid: "{{ docker_user.id }}"
group: "{{ docker_user.name }}" group: "{{ docker_user.name }}"
create_home: false create_home: false
become: true
- name: Add user to docker user group - name: Add user to docker user group
user: user:
name: "{{ user }}" name: "{{ user }}"
groups: "{{ docker_user.name }}" groups: "{{ docker_user.name }}"
append: true append: true
become: true
- name: Clean up docker containers - name: Clean up docker containers
cron: cron: