-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker.yml
39 lines (36 loc) · 941 Bytes
/
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
---
- hosts: dockers
pre_tasks:
- name: update repositories cache
become: yes
apt:
update_cache: yes
collections:
- community.docker
roles:
- install_docker
tasks:
- name: make sure we got pip
become: yes
apt:
name: pip
state: present
- name: install docker sdk
pip:
name: docker
- name: make sure docker is running
service:
name: docker
state: started
- name: deploy docker images
block:
- name: deploy docker-telegram-notifier
community.docker.docker_container:
name: telegram-notifier
image: lorcas/docker-telegram-notifier
env:
TELEGRAM_NOTIFIER_BOT_TOKEN: "{{ docker_alerts_token }}"
TELEGRAM_NOTIFIER_CHAT_ID: "{{ docker_alerts_channel }}"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
restart_policy: "unless-stopped"