-
Notifications
You must be signed in to change notification settings - Fork 265
/
docker.yml
executable file
·50 lines (47 loc) · 2.13 KB
/
docker.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/usr/bin/env ansible-playbook
---
#==============================================================#
# File : docker.yml
# Desc : init docker on nodes
# Ctime : 2023-02-20
# Mtime : 2024-08-07
# Path : docker.yml
# Author : Ruohang Feng ([email protected])
# License : AGPLv3
#==============================================================#
- name: DOCKER INIT
hosts: all
gather_facts: no
become: yes
vars:
#docker_enabled: false # enable docker on this node? false by default
#docker_cgroups_driver: systemd # docker cgroup fs driver: cgroupfs,systemd
#docker_registry_mirrors: [ ] # docker registry mirror list
#docker_exporter_port: 9323 # docker metrics exporter port, 9323 by default
#docker_image: [] # docker image to be pulled after bootstrap
#docker_image_cache: # docker image cache file/glob, `/tmp/docker` by default
# - /tmp/docker/*.tgz
roles:
- { role: node_id , tags: id } # get node identity (always)
- { role: docker , tags: docker ,when: docker_enabled is defined and docker_enabled|bool }
#---------------------------------------------------------------
# Usage
#---------------------------------------------------------------
# Set parameter `docker_enabled: true` on target nodes, then:
#
# ./docker.yml -l <group|host>
#
# docker images on /tmp/docker/*.tgz will be loaded automatically
# you can add registry mirror to `docker_registry_mirrors` to accelerate
#---------------------------------------------------------------
# Tasks
#---------------------------------------------------------------
# docker : setup docker on node to run containers (optional)
# - docker_install : install docker on nodes
# - docker_admin : add user to docker admin group
# - docker_config : generate docker daemon config
# - docker_launch : launch docker daemon systemd service
# - docker_register : register docker target to prometheus
# - docker_image : load docker images from /tmp/docker/*.tgz if exists
#---------------------------------------------------------------
...