diff --git a/roles/nginx/tasks/install.yml b/roles/nginx/tasks/install.yml index 1ae4e37ba..b6625a98c 100644 --- a/roles/nginx/tasks/install.yml +++ b/roles/nginx/tasks/install.yml @@ -73,18 +73,14 @@ - uwsgi_params - win-utf - - name: Alter systemd_unit_name to be iiab-nginx.service from nginx.service - set_fact: - systemd_unit_name: iiab-nginx - - name: Grab stock unit file copy: force: yes src: /lib/systemd/system/nginx.service - dest: /etc/systemd/system/"{{ systemd_unit_name }}".service + 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/iiab-nginx.service + command: sed -i 's|/usr/sbin/nginx|/usr/sbin/nginx -c {{ nginx_dir }}/nginx.conf|' /etc/systemd/system/{{ systemd_unit_name }}.service # lineinfile: # path: /etc/systemd/system/nginx.service # state: present @@ -96,7 +92,7 @@ # - { regexp: '^ExecReload=/usr/sbin/nginx', line: 'ExecReload=/usr/sbin/nginx -c {{ nginx_dir }}/nginx.conf' } # end block - when: nginx_port|int != 80 or nginx_dir != "/etc/nginx" + when: systemd_unit_name != "nginx" or nginx_dir != "/etc/nginx" - name: 'Install 3 (of 5) files from template: /etc/nginx/server.conf, /etc/nginx/nginx.conf, /etc/nginx/mime.types' template: