1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-03-09 15:40:17 +00:00

let the enduser name the service

This commit is contained in:
Jerry Vonau 2021-12-09 08:48:50 -06:00
parent f783caf5dd
commit 8936d019d1

View file

@ -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: