From 9639c0d0255accd419ea8e41618fdf9f61660ebf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Mati=C4=87?= Date: Mon, 2 Oct 2023 20:17:03 +0200 Subject: [PATCH] about to break everything --- ansible/deploy.yml | 5 ++++- ansible/roles/web_servers/tasks/main.yml | 15 ++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/ansible/deploy.yml b/ansible/deploy.yml index 9142f20..3f7ef97 100644 --- a/ansible/deploy.yml +++ b/ansible/deploy.yml @@ -19,4 +19,7 @@ restart: yes ports: - "80:3000" - - "443:3000" \ No newline at end of file + - "443:3000" + mounts: + - source: /etc/letsencrypt/ + target: /etc/letsencrypt/ \ No newline at end of file diff --git a/ansible/roles/web_servers/tasks/main.yml b/ansible/roles/web_servers/tasks/main.yml index 27c2368..72ececd 100644 --- a/ansible/roles/web_servers/tasks/main.yml +++ b/ansible/roles/web_servers/tasks/main.yml @@ -12,8 +12,17 @@ state: started enabled: yes -- name: create a certs directory if it doesn't exist +- name: create a letsencrypt directory if it doesn't exist ansible.builtin.file: - path: /home/ansible/certs + path: /etc/letsencrypt/ state: directory - mode: '0755' \ No newline at end of file + mode: '0755' + +- name: copy lentsencrypt files from host to remote + ansible.builtin.copy: + src: /etc/letsencrypt/ + dest: /etc/letsencrypt/ + owner: root + group: root + mode: '0644' +