diff options
author | clarkzjw <[email protected]> | 2022-12-10 01:04:49 -0800 |
---|---|---|
committer | clarkzjw <[email protected]> | 2022-12-10 01:04:49 -0800 |
commit | 027b7bd2633bf57e1c49b29329ad61a039a97869 (patch) | |
tree | 4282b6beb76de9898b997138a5531dbaec1e3cff /jinwei.me/config/roles/debian_init/tasks/main.yaml | |
parent | cb5f8087f8c69c920f87fd5c219906f0796d6938 (diff) | |
download | jinwei.me-027b7bd2633bf57e1c49b29329ad61a039a97869.tar.gz |
ansible: add debian init
Diffstat (limited to 'jinwei.me/config/roles/debian_init/tasks/main.yaml')
-rw-r--r-- | jinwei.me/config/roles/debian_init/tasks/main.yaml | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/jinwei.me/config/roles/debian_init/tasks/main.yaml b/jinwei.me/config/roles/debian_init/tasks/main.yaml new file mode 100644 index 0000000..48e8380 --- /dev/null +++ b/jinwei.me/config/roles/debian_init/tasks/main.yaml | |||
@@ -0,0 +1,62 @@ | |||
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 | name: | ||
10 | - apt-transport-https | ||
11 | - build-essential | ||
12 | - ca-certificates | ||
13 | - mariadb-client | ||
14 | - lsb-release | ||
15 | - unzip | ||
16 | - gnupg | ||
17 | - htop | ||
18 | - curl | ||
19 | - zip | ||
20 | - vim | ||
21 | - zsh | ||
22 | - git | ||
23 | update_cache: true | ||
24 | |||
25 | - name: add user | ||
26 | user: | ||
27 | name: clarkzjw | ||
28 | shell: /usr/bin/zsh | ||
29 | home: "{{ user_home }}" | ||
30 | system: true | ||
31 | |||
32 | - name: Add Docker GPG apt Key | ||
33 | apt_key: | ||
34 | url: https://download.docker.com/linux/debian/gpg | ||
35 | keyring: /etc/apt/trusted.gpg.d/docker.gpg | ||
36 | state: present | ||
37 | |||
38 | - name: Add Docker Repository | ||
39 | apt_repository: | ||
40 | repo: deb [arch=amd64 signed-by=/etc/apt/trusted.gpg.d/docker.gpg] https://download.docker.com/linux/debian {{ ansible_distribution_release | lower }} stable | ||
41 | state: present | ||
42 | |||
43 | - name: Update apt and install docker-ce | ||
44 | apt: | ||
45 | name: | ||
46 | - docker-ce | ||
47 | - docker-ce-cli | ||
48 | - containerd.io | ||
49 | - docker-compose-plugin | ||
50 | state: latest | ||
51 | update_cache: true | ||
52 | |||
53 | - name: enable docker service | ||
54 | systemd: | ||
55 | name: docker | ||
56 | enabled: true | ||
57 | daemon_reload: true | ||
58 | |||
59 | - name: Clean unneeded packages | ||
60 | ansible.builtin.apt: | ||
61 | autoremove: true | ||
62 | purge: true | ||