feat(role,pb,inv): new role for updating certificates on web-servers

This commit is contained in:
2026-09-14 09:58:47 +04:00
parent 07b33028d1
commit 49bd2f630b
3 changed files with 39 additions and 0 deletions
+8
View File
@@ -39,3 +39,11 @@ all:
ansible_become_password: "{{ ansible_become_passwd }}" ansible_become_password: "{{ ansible_become_passwd }}"
services_to_run: services_to_run:
- coder_ai - coder_ai
web-servers:
hosts:
cert-proxy:
ansible_host: 192.168.0.47
ansible_become_password: "{{ ansible_become_passwd }}"
monitoring:
ansible_host: 192.168.0.49
ansible_become_password: "{{ ansible_become_passwd }}"
+11
View File
@@ -20,3 +20,14 @@
- ../roles/update_configs - ../roles/update_configs
# Make sure that the services that are supposed to run are running # Make sure that the services that are supposed to run are running
- ../roles/check_services - ../roles/check_services
- name: Ensure all web-servers have fresh TLS certificates
hosts: web-servers
remote_user: ansible
vars_files:
../inventory/group_vars/all/secrets.yaml
roles:
# Pull certificates from cert_proxy and distribute them among the servers
- ../roles/update_certificates
+20
View File
@@ -0,0 +1,20 @@
---
- name: Fetch all certificates from cert-proxy
ansible.builtin.fetch:
src: /tmp/letsencrypt
dest: /tmp
when: "{{ inventory_hostname == 'cert-proxy' }}"
- name: Push loki.vmn.su certificate to the target
ansible.builtin.copy:
src: /tmp/letsencrypt/live/loki.vmn.su/fullchain.pem
dest: /etc/nginx/certs/loki_fullchain.pem
local_follow: true
when: "{{ inventory_hostname == 'monitoring' }}"
- name: Push loki.vmn.su key to the target
ansible.builtin.copy:
src: /tmp/letsencrypt/live/loki.vmn.su/privkey.pem
dest: /etc/nginx/certs/loki_privkey.pem
local_follow: true
when: "{{ inventory_hostname == 'monitoring' }}"