feat(role,pb,inv): new role for updating certificates on web-servers
This commit is contained in:
@@ -39,3 +39,11 @@ all:
|
||||
ansible_become_password: "{{ ansible_become_passwd }}"
|
||||
services_to_run:
|
||||
- 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 }}"
|
||||
|
||||
@@ -20,3 +20,14 @@
|
||||
- ../roles/update_configs
|
||||
# Make sure that the services that are supposed to run are running
|
||||
- ../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
|
||||
|
||||
@@ -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' }}"
|
||||
Reference in New Issue
Block a user