From 9cd6777a7cc8dd541360c1387e8092a08230fba3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Jonas=20S=C3=A4mann?= Date: Sat, 20 Jun 2020 22:12:05 +0200 Subject: [PATCH] Mitigate lint E204 in roles nginx, web-gw and web-svc --- roles/nginx/tasks/main.yml | 8 +++++++- roles/web-gw/tasks/main.yml | 8 +++++++- roles/web-svc/tasks/websvc.yml | 8 +++++++- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/roles/nginx/tasks/main.yml b/roles/nginx/tasks/main.yml index 0ed5cbd..91a6425 100644 --- a/roles/nginx/tasks/main.yml +++ b/roles/nginx/tasks/main.yml @@ -8,7 +8,13 @@ when: nginx_ssl - name: Ensure certificates are available - command: openssl req -x509 -nodes -newkey rsa:2048 -keyout /etc/nginx/ssl/{{ ansible_fqdn }}.key -out /etc/nginx/ssl/{{ ansible_fqdn }}.crt -days 730 -subj "/CN={{ ansible_fqdn }}" creates=/etc/nginx/ssl/{{ ansible_fqdn }}.crt + command: + cmd: > + openssl req -x509 -nodes -newkey rsa:2048 + -keyout /etc/nginx/ssl/{{ ansible_fqdn }}.key + -out /etc/nginx/ssl/{{ ansible_fqdn }}.crt + -days 730 -subj "/CN={{ ansible_fqdn }}" + creates: /etc/nginx/ssl/{{ ansible_fqdn }}.crt when: nginx_ssl notify: Restart nginx diff --git a/roles/web-gw/tasks/main.yml b/roles/web-gw/tasks/main.yml index 1eace25..fe734a8 100644 --- a/roles/web-gw/tasks/main.yml +++ b/roles/web-gw/tasks/main.yml @@ -1,7 +1,13 @@ --- - name: Ensure certificates are available - command: openssl req -x509 -nodes -newkey rsa:2048 -keyout /etc/nginx/ssl/{{ ansible_fqdn }}.key -out /etc/nginx/ssl/{{ ansible_fqdn }}.crt -days 730 -subj "/CN={{ ansible_fqdn }}" creates=/etc/nginx/ssl/{{ ansible_fqdn }}.crt + command: + cmd: > + openssl req -x509 -nodes -newkey rsa:2048 + -keyout /etc/nginx/ssl/{{ ansible_fqdn }}.key + -out /etc/nginx/ssl/{{ ansible_fqdn }}.crt + -days 730 -subj "/CN={{ ansible_fqdn }}" + creates: /etc/nginx/ssl/{{ ansible_fqdn }}.crt notify: Restart nginx - name: Create web content directory diff --git a/roles/web-svc/tasks/websvc.yml b/roles/web-svc/tasks/websvc.yml index a82d68a..0b5d488 100644 --- a/roles/web-svc/tasks/websvc.yml +++ b/roles/web-svc/tasks/websvc.yml @@ -1,7 +1,13 @@ --- - name: Ensure certificates are available - command: openssl req -x509 -nodes -newkey rsa:2048 -keyout /etc/nginx/ssl/{{ domain }}.key -out /etc/nginx/ssl/{{ domain }}.crt -days 730 -subj "/CN={{ domain }}" creates=/etc/nginx/ssl/{{ domain }}.crt + command: + cmd: > + openssl req -x509 -nodes -newkey rsa:2048 + -keyout /etc/nginx/ssl/{{ domain }}.key + -out /etc/nginx/ssl/{{ domain }}.crt + -days 730 -subj "/CN={{ domain }}" + creates: /etc/nginx/ssl/{{ domain }}.crt notify: Restart nginx - name: Configure certificate manager