forked from shaderecker/ansible-pihole
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.yaml
70 lines (60 loc) · 1.72 KB
/
main.yaml
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
- name: Install dependencies
apt:
force_apt_get: yes
name:
- ca-certificates
- software-properties-common
- curl
- gnupg
# free-form (string) arguments, all arguments on one line
- name: define Keyring File
ansible.builtin.command: install -m 0755 -d /etc/apt/keyrings
become: true
- name: curl gpg Key
ansible.builtin.command: curl -fsSL https://download.docker.com/linux/raspbian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
- name: changmod of File
ansible.builtin.command: chmod a+r /etc/apt/keyrings/docker.gpg
become: true
- name: Set up Dockers APT repository
ansible.builtin.command: echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/raspbian $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
become: true
- name: Update apt packages
apt:
force_apt_get: yes
autoclean: yes
autoremove: yes
update_cache: yes
upgrade: dist
- name: Install Docker
apt:
force_apt_get: yes
name:
- docker-ce
- docker-ce-cli
- containerd.io
- docker-buildx-plugin
- docker-compose-plugin
- python3-setuptools
- python3-pip
install_recommends: no
- name: Install Docker SDK for python
pip:
name: docker
executable: pip3
- name: Add user to docker group
user:
name: "{{ ansible_user }}"
append: yes
groups: docker
- name: Enable Docker IPv6
copy:
dest: /etc/docker/daemon.json
mode: 0600
content: |
{
"ipv6": true,
"fixed-cidr-v6": "2001:db8:1::/64"
}
notify: Restart Docker
- name: Flush handlers
meta: flush_handlers