From 0328de96b690cafb467ec96830e9dfa1c358aa2a Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Mon, 27 Nov 2023 04:58:40 +0700 Subject: [PATCH] add reload and cronjob --- roles/setup_install_nginx/tasks/main.yaml | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/roles/setup_install_nginx/tasks/main.yaml b/roles/setup_install_nginx/tasks/main.yaml index eb33341..061d94e 100644 --- a/roles/setup_install_nginx/tasks/main.yaml +++ b/roles/setup_install_nginx/tasks/main.yaml @@ -35,6 +35,18 @@ changed_when: "'Congratulations' in certbot_result.stdout" no_log: True +- name: Reload nginx service + ansible.builtin.service: + name: nginx + state: reloaded + +- name: Set up Certbot DNS auto-renewal cron job + ansible.builtin.cron: + name: "Certbot DNS Renewal and Reload Nginx" + job: "certbot renew --quiet && systemctl reload nginx" + special_time: daily + user: root + - name: Ensure NGINX configuration directories exist ansible.builtin.file: path: "/etc/nginx/{{ item }}" @@ -99,7 +111,7 @@ state: link notify: Reload nginx -- name: Include loadbalancer tasks for endpoints - ansible.builtin.import_tasks: loadbalancer.yaml - when: default_node_type == 'endpoint' +# - name: Include loadbalancer tasks for endpoints +# ansible.builtin.import_tasks: loadbalancer.yaml +# when: default_node_type == 'endpoint' ...