added docker/dotfiles/fixed stuff
This commit is contained in:
@@ -1,10 +1,55 @@
|
||||
---
|
||||
- name: Enable Docker systemd unit
|
||||
service:
|
||||
enabled: yes
|
||||
name: docker
|
||||
- name: Update apt package index
|
||||
apt:
|
||||
update_cache: yes
|
||||
|
||||
- name: Start Docker systemd unit
|
||||
service:
|
||||
state: started
|
||||
name: docker
|
||||
- name: Install required system packages
|
||||
apt:
|
||||
name:
|
||||
- ca-certificates
|
||||
- curl
|
||||
- gnupg
|
||||
- gnupg2
|
||||
state: present
|
||||
|
||||
- name: Create /etc/apt/keyrings directory
|
||||
file:
|
||||
path: /etc/apt/keyrings
|
||||
state: directory
|
||||
mode: '0755'
|
||||
|
||||
- name: Download Docker's official GPG key
|
||||
get_url:
|
||||
url: https://download.docker.com/linux/debian/gpg
|
||||
dest: /tmp/docker.gpg
|
||||
|
||||
- name: Install Docker's official GPG key
|
||||
shell: gpg --dearmor -o /etc/apt/keyrings/docker.gpg /tmp/docker.gpg
|
||||
|
||||
- name: Get the architecture
|
||||
command: dpkg --print-architecture
|
||||
register: dpkg_architecture
|
||||
changed_when: False
|
||||
|
||||
- name: Set up the stable Docker repository
|
||||
copy:
|
||||
content: |
|
||||
deb [arch={{ dpkg_architecture.stdout }} signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian {{ ansible_distribution_release }} stable
|
||||
dest: /etc/apt/sources.list.d/docker.list
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0644'
|
||||
|
||||
- name: Update apt package index
|
||||
apt:
|
||||
update_cache: yes
|
||||
|
||||
- name: Install Docker CE and associated components
|
||||
apt:
|
||||
name:
|
||||
- docker-ce
|
||||
- docker-ce-cli
|
||||
- containerd.io
|
||||
- docker-buildx-plugin
|
||||
- docker-compose-plugin
|
||||
state: present
|
||||
|
||||
Reference in New Issue
Block a user