Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/ansible_monitoring.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ jobs:
echo "[web_servers]" > infrastructure/ansible/inventory.ini
echo "deltronfr.mooo.com" >> infrastructure/ansible/inventory.ini

- name: Load env vars for the playbook
run: |
cd infrastructure/ansible
echo "${{ secrets.ANS_VARS }}" > group_vars/all.yaml

- name: Run Ansible playbook
run: |
cd infrastructure/ansible
Expand Down
14 changes: 13 additions & 1 deletion infrastructure/ansible/playbook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,19 @@
apt:
pkg:
- certbot
state: latest
state:

- name: Check if SSL Certificate exists
stat:
path: /etc/letsencrypt/live/deltronfr.mooo.com/fullchain.pem
register: ssl_cert

- name: Request SSL Certificate
command: certbot certonly --standalone -d deltronfr.mooo.com -d www.deltronfr.mooo.com -d db.deltronfr.mooo.com --non-interactive --agree-tos --email {{ env_vars.EMAIL }}
when:
- ssl_cert.stat.exists == False
register: certbot_result
changed_when: certbot_result.rc == 0

- name: Make monitoring directory
file:
Expand Down