about summary refs log tree commit diff
path: root/ansible/roles/docker
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--ansible/roles/docker-compose/tasks/main.yaml6
-rw-r--r--ansible/roles/docker/tasks/main.yml22
2 files changed, 28 insertions, 0 deletions
diff --git a/ansible/roles/docker-compose/tasks/main.yaml b/ansible/roles/docker-compose/tasks/main.yaml
new file mode 100644
index 0000000..6386f2d
--- /dev/null
+++ b/ansible/roles/docker-compose/tasks/main.yaml
@@ -0,0 +1,6 @@
+---
+- name: Install Docker Compose
+  get_url:
+    url: https://github.com/docker/compose/releases/download/1.29.2/docker-compose-`uname -s`-`uname -m`
+    dest: /usr/local/bin/docker-compose
+    mode: '0755'
diff --git a/ansible/roles/docker/tasks/main.yml b/ansible/roles/docker/tasks/main.yml
new file mode 100644
index 0000000..38ad4dd
--- /dev/null
+++ b/ansible/roles/docker/tasks/main.yml
@@ -0,0 +1,22 @@
+---
+- name: Add Docker GPG key
+  apt_key:
+    url: https://download.docker.com/linux/ubuntu/gpg
+    state: present
+
+- name: Add Docker repository
+  apt_repository:
+    repo: deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable
+    state: present
+
+- name: Install Docker
+  apt:
+    name: docker-ce
+    state: present
+    update_cache: yes
+
+- name: Start and enable Docker service
+  systemd:
+    name: docker
+    state: started
+    enabled: true