From 0bfab81d3571de41a8a4de3146f38738b43c4183 Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Fri, 10 Dec 2021 19:14:26 -0600 Subject: [PATCH] split the pid files2 --- roles/nginx/tasks/install.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/roles/nginx/tasks/install.yml b/roles/nginx/tasks/install.yml index c174390ba..6e71a133c 100644 --- a/roles/nginx/tasks/install.yml +++ b/roles/nginx/tasks/install.yml @@ -80,7 +80,7 @@ dest: /etc/systemd/system/{{ systemd_unit_name }}.service - name: shove {{ nginx_dir }}/nginx.conf into unit file - command: sed -i 's|/usr/sbin/nginx|/usr/sbin/nginx -c {{ nginx_dir }}/nginx.conf|' /etc/systemd/system/{{ systemd_unit_name }}.service + command: sed -i 's|/usr/sbin/nginx|/usr/sbin/nginx -c {{ nginx_dir }}/nginx.conf|g' /etc/systemd/system/{{ systemd_unit_name }}.service # lineinfile: # path: /etc/systemd/system/nginx.service # state: present @@ -91,8 +91,8 @@ # - { regexp: '^ExecStart=/usr/sbin/nginx', line: 'ExecStart=/usr/sbin/nginx -c {{ nginx_dir }}/nginx.conf' } # - { regexp: '^ExecReload=/usr/sbin/nginx', line: 'ExecReload=/usr/sbin/nginx -c {{ nginx_dir }}/nginx.conf' } - - name: Alter PIDFile= to match {{ systemd_unit_name }} in unit file. - command: sed -i 's|PIDFile=/run/nginx.pid|PIDFile=/run/{{ systemd_unit_name }}.pid|' /etc/systemd/system/{{ systemd_unit_name }}.service + - name: Alter /run/nginx.pid to be /run/{{ systemd_unit_name }}.pid in unit file. + command: sed -i 's|/run/nginx.pid|/run/{{ systemd_unit_name }}.pid|g' /etc/systemd/system/{{ systemd_unit_name }}.service # end block when: systemd_unit_name != "nginx" or nginx_dir != "/etc/nginx"