Make grimes
a docker host
This commit is contained in:
parent
50cb5a56fc
commit
05c7690b83
2 changed files with 20 additions and 1 deletions
|
@ -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
|
||||||
|
|
|
@ -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:
|
||||||
|
|
Loading…
Reference in a new issue