From e13d4b448efd7174b1b4c8723cbc8be845470c60 Mon Sep 17 00:00:00 2001 From: clarkzjw Date: Sun, 1 Jan 2023 21:08:22 -0800 Subject: stash --- .../config/roles/debian_init/tasks/main.yaml | 72 ++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 photo.jinwei.me/config/roles/debian_init/tasks/main.yaml (limited to 'photo.jinwei.me/config/roles/debian_init/tasks') 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 @@ +- name: Disable unattended-upgrades + ansible.builtin.systemd: + name: unattended-upgrades + state: stopped + enabled: false + +- name: install packages + apt: + update_cache: true + name: + - apt-transport-https + - build-essential + - ca-certificates + - mariadb-client + - lsb-release + - python3 + - python3-dev + - python3-pip + - unzip + - gnupg + - htop + - curl + - tree + - zip + - vim + - zsh + - git + +- name: add user + user: + name: clarkzjw + shell: /usr/bin/zsh + home: "{{ user_home }}" + system: true + +- name: Add Docker GPG apt Key + apt_key: + url: https://download.docker.com/linux/debian/gpg + keyring: /etc/apt/trusted.gpg.d/docker.gpg + state: present + +- name: Add Docker Repository + apt_repository: + repo: deb [arch=amd64 signed-by=/etc/apt/trusted.gpg.d/docker.gpg] https://download.docker.com/linux/debian {{ ansible_distribution_release | lower }} stable + state: present + +- name: Update apt and install docker-ce + apt: + name: + - docker-ce + - docker-ce-cli + - containerd.io + - docker-compose-plugin + state: latest + update_cache: true + +- name: Install Docker Module for Python + pip: + name: + - docker + - docker-compose + +- name: enable docker service + systemd: + name: docker + enabled: true + daemon_reload: true + +- name: Clean unneeded packages + ansible.builtin.apt: + autoremove: true + purge: true -- cgit v1.2.3