summaryrefslogtreecommitdiff
path: root/roles/common/tasks
diff options
context:
space:
mode:
authorElizabeth Hunt <elizabeth.hunt@simponic.xyz>2024-01-03 01:03:22 -0500
committerElizabeth Hunt <elizabeth.hunt@simponic.xyz>2024-01-03 01:03:22 -0500
commit365641c4b502d2c071aa555240692d2020a407a0 (patch)
treeefaf853e105b4023fe121fc7239460ef0c147081 /roles/common/tasks
parent807637e9a4d7edf82ceb5bdcb0a24e08dfa34527 (diff)
downloadoldinfra-365641c4b502d2c071aa555240692d2020a407a0.tar.gz
oldinfra-365641c4b502d2c071aa555240692d2020a407a0.zip
add docker to common setup
Diffstat (limited to 'roles/common/tasks')
-rw-r--r--roles/common/tasks/main.yml56
1 files changed, 50 insertions, 6 deletions
diff --git a/roles/common/tasks/main.yml b/roles/common/tasks/main.yml
index 7c97505..69e9c90 100644
--- a/roles/common/tasks/main.yml
+++ b/roles/common/tasks/main.yml
@@ -1,15 +1,59 @@
---
-# apt cache
-- name: update apt cache
- ansible.builtin.apt:
+# docker
+- name: install dependencies
+ apt:
+ name:
+ - apt-transport-https
+ - ca-certificates
+ - curl
+ - gnupg-agent
+ - software-properties-common
+ state: latest
update_cache: yes
- cache_valid_time: 3600
+
+- name: docker GPG key
+ apt_key:
+ url: https://download.docker.com/linux/debian/gpg
+ state: present
+
+- name: repository docker
+ apt_repository:
+ repo: deb https://download.docker.com/linux/debian {{ ansible_distribution_release }} stable
+ state: present
+
+- name: install docker
+ apt:
+ name:
+ - docker-ce
+ - docker-ce-cli
+ - containerd.io
+ state: latest
+ update_cache: yes
+
+- name: enable docker
+ service: name=docker state=restarted enabled=yes
+
+- name: copy docker-compose@.service
+ copy:
+ src: ../files/docker-compose@.service
+ dest: /etc/systemd/system/docker-compose@.service
+ owner: root
+ group: root
+ mode: u=rw,g=r,o=r
+
+- name: ensure /etc/docker/compose exist
+ file:
+ path: /etc/docker/compose
+ state: directory
+ owner: root
+ group: root
+ mode: 0700
# SSH
- name: Copy sshd_config
copy:
- src: ../templates/sshd_config
+ src: ../files/sshd_config
dest: /etc/ssh/sshd_config
owner: root
group: root
@@ -37,7 +81,7 @@
- name: Copy jail.conf
copy:
- src: ../templates/jail.conf
+ src: ../files/jail.conf
dest: /etc/fail2ban/jail.conf
owner: root
group: root