aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'photo.jinwei.me/config/roles/debian_init/tasks')
-rw-r--r--photo.jinwei.me/config/roles/debian_init/tasks/main.yaml72
1 files changed, 72 insertions, 0 deletions
diff --git a/photo.jinwei.me/config/roles/debian_init/tasks/main.yaml b/photo.jinwei.me/config/roles/debian_init/tasks/main.yaml
new file mode 100644
index 0000000..19b0ed8
--- /dev/null
+++ b/photo.jinwei.me/config/roles/debian_init/tasks/main.yaml
@@ -0,0 +1,72 @@
1- name: Disable unattended-upgrades
2 ansible.builtin.systemd:
3 name: unattended-upgrades
4 state: stopped
5 enabled: false
6
7- name: install packages
8 apt:
9 update_cache: true
10 name:
11 - apt-transport-https
12 - build-essential
13 - ca-certificates
14 - mariadb-client
15 - lsb-release
16 - python3
17 - python3-dev
18 - python3-pip
19 - unzip
20 - gnupg
21 - htop
22 - curl
23 - tree
24 - zip
25 - vim
26 - zsh
27 - git
28
29- name: add user
30 user:
31 name: clarkzjw
32 shell: /usr/bin/zsh
33 home: "{{ user_home }}"
34 system: true
35
36- name: Add Docker GPG apt Key
37 apt_key:
38 url: https://download.docker.com/linux/debian/gpg
39 keyring: /etc/apt/trusted.gpg.d/docker.gpg
40 state: present
41
42- name: Add Docker Repository
43 apt_repository:
44 repo: deb [arch=amd64 signed-by=/etc/apt/trusted.gpg.d/docker.gpg] https://download.docker.com/linux/debian {{ ansible_distribution_release | lower }} stable
45 state: present
46
47- name: Update apt and install docker-ce
48 apt:
49 name:
50 - docker-ce
51 - docker-ce-cli
52 - containerd.io
53 - docker-compose-plugin
54 state: latest
55 update_cache: true
56
57- name: Install Docker Module for Python
58 pip:
59 name:
60 - docker
61 - docker-compose
62
63- name: enable docker service
64 systemd:
65 name: docker
66 enabled: true
67 daemon_reload: true
68
69- name: Clean unneeded packages
70 ansible.builtin.apt:
71 autoremove: true
72 purge: true
Powered by cgit v1.2.3 (git 2.41.0)