From 719fc9359825b568e876dc683a7059dd87f249cc Mon Sep 17 00:00:00 2001 From: phil Date: Sun, 19 Mar 2023 00:47:20 +0100 Subject: [PATCH] Create dhparams only for gateways or standalone servers Fix lint warnings --- tasks/configure.yml | 9 +++++---- tasks/fail2ban.yml | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/tasks/configure.yml b/tasks/configure.yml index 2686eca..29d3ba5 100644 --- a/tasks/configure.yml +++ b/tasks/configure.yml @@ -3,6 +3,7 @@ community.crypto.openssl_dhparam: path: "{{ dhparam_path }}" size: "{{ dhparam_size | default(4096) }}" + when: nginx_type == 'gateway' or nginx_type == 'standalone' - name: "Configuration | Get bad user agents" ansible.builtin.shell: "curl {{ bad_user_agents_url }}" @@ -12,14 +13,14 @@ ansible.builtin.template: src: nginx.conf.j2 dest: /etc/nginx/nginx.conf - mode: 0644 + mode: "0644" notify: reload nginx - name: "Configuration | Copy configuration snippets" ansible.builtin.copy: src: "{{ item }}" dest: "/etc/nginx/snippets/{{ item }}" - mode: 0644 + mode: "0644" loop: - add_headers.conf - letsencrypt.conf @@ -29,7 +30,7 @@ ansible.builtin.template: src: "{{ item }}.j2" dest: "/etc/nginx/conf.d/{{ item }}" - mode: 0644 + mode: "0644" loop: - bad_clients.conf - bad_bots.conf @@ -42,6 +43,6 @@ ansible.builtin.copy: src: request_limits.conf dest: /etc/nginx/conf.d/ - mode: 0644 + mode: "0644" notify: reload nginx when: nginx_type == 'gateway' or nginx_type == 'standalone' diff --git a/tasks/fail2ban.yml b/tasks/fail2ban.yml index 74ecb18..d35cf2c 100644 --- a/tasks/fail2ban.yml +++ b/tasks/fail2ban.yml @@ -3,7 +3,7 @@ ansible.builtin.copy: src: "fail2ban/{{ item }}" dest: "/etc/fail2ban/{{ item }}" - mode: 0644 + mode: "0644" notify: reload fail2ban loop: - "filter.d/nginx-req-limit.conf"