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

soft-code service unit name

grep -rlZ 'name: nginx' . | xargs -0 sed -i 's/name: nginx/name: {{ systemd_unit_name }}/g'
This commit is contained in:
Jerry Vonau 2021-12-08 20:21:54 -06:00
parent 5c8bb3c06f
commit 15f0f87d13
24 changed files with 29 additions and 24 deletions

View file

@ -30,7 +30,7 @@
- name: Restart 'nginx' systemd service
systemd:
name: nginx
name: "{{ systemd_unit_name }}"
state: restarted
when: nginx_enabled

View file

@ -12,5 +12,5 @@
- name: Restart 'nginx' systemd service
systemd:
name: nginx
name: "{{ systemd_unit_name }}"
state: restarted

View file

@ -12,5 +12,5 @@
- name: Restart 'nginx' systemd service
systemd:
name: nginx
name: "{{ systemd_unit_name }}"
state: restarted

View file

@ -31,5 +31,5 @@
- name: Restart 'nginx' systemd service
systemd:
name: nginx
name: "{{ systemd_unit_name }}"
state: restarted

View file

@ -12,5 +12,5 @@
- name: Restart 'nginx' systemd service
systemd:
name: nginx
name: "{{ systemd_unit_name }}"
state: restarted

View file

@ -28,5 +28,5 @@
- name: Restart 'nginx' systemd service
systemd:
name: nginx
name: "{{ systemd_unit_name }}"
state: restarted

View file

@ -28,5 +28,5 @@
- name: Restart 'nginx' systemd service
systemd:
name: nginx
name: "{{ systemd_unit_name }}"
state: restarted

View file

@ -29,5 +29,5 @@
- name: Restart 'nginx' systemd service
systemd:
name: nginx
name: "{{ systemd_unit_name }}"
state: restarted

View file

@ -12,5 +12,5 @@
- name: Restart 'nginx' systemd service
systemd:
name: nginx
name: "{{ systemd_unit_name }}"
state: restarted

View file

@ -28,5 +28,5 @@
- name: Restart 'nginx' systemd service
systemd:
name: nginx
name: "{{ systemd_unit_name }}"
state: restarted

View file

@ -12,5 +12,5 @@
- name: Restart 'nginx' systemd service
systemd:
name: nginx
name: "{{ systemd_unit_name }}"
state: restarted

View file

@ -12,5 +12,5 @@
- name: Restart 'nginx' systemd service
systemd:
name: nginx
name: "{{ systemd_unit_name }}"
state: restarted

View file

@ -27,5 +27,5 @@
- name: Restart 'nginx' systemd service
systemd:
name: nginx
name: "{{ systemd_unit_name }}"
state: restarted

View file

@ -28,5 +28,5 @@
- name: Restart 'nginx' systemd service
systemd:
name: nginx
name: "{{ systemd_unit_name }}"
state: restarted

View file

@ -27,7 +27,7 @@
- name: Enable & (Re)Start 'nginx' systemd service, if nginx_enabled
systemd:
name: nginx
name: "{{ systemd_unit_name }}"
daemon_reload: yes
enabled: yes
state: restarted
@ -42,7 +42,7 @@
- name: Disable & Stop 'nginx' systemd service, if not nginx_enabled
systemd:
name: nginx
name: "{{ systemd_unit_name }}"
enabled: no
state: stopped
when: not nginx_enabled

View file

@ -73,11 +73,15 @@
- 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/iiab-nginx.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

View file

@ -28,5 +28,5 @@
- name: Restart 'nginx' systemd service
systemd:
name: nginx
name: "{{ systemd_unit_name }}"
state: restarted

View file

@ -12,5 +12,5 @@
- name: Reload 'nginx' systemd service
systemd:
name: nginx
name: "{{ systemd_unit_name }}"
state: reloaded

View file

@ -98,7 +98,7 @@
- name: Restart 'nginx' systemd service
systemd:
name: nginx
name: "{{ systemd_unit_name }}"
state: restarted

View file

@ -28,5 +28,5 @@
- name: Restart 'nginx' systemd service
systemd:
name: nginx
name: "{{ systemd_unit_name }}"
state: restarted

View file

@ -30,5 +30,5 @@
- name: Restart 'nginx' systemd service
systemd:
name: nginx
name: "{{ systemd_unit_name }}"
state: restarted

View file

@ -12,5 +12,5 @@
- name: Restart 'nginx' systemd service
systemd:
name: nginx
name: "{{ systemd_unit_name }}"
state: restarted

View file

@ -167,7 +167,7 @@
- name: (Re)Start 'nginx' systemd service, if nginx_enabled
systemd:
name: nginx
name: "{{ systemd_unit_name }}"
state: restarted
when: nginx_enabled

View file

@ -283,6 +283,7 @@ nginx_interface: 0.0.0.0
nginx_dir: /etc/nginx
nginx_conf_dir: "{{ nginx_dir }}/conf.d"
nginx_log_dir: /var/log/nginx
systemd_unit_name: nginx
# SEE BELOW: nginx_high_php_limits, apache_allow_sudo
# roles/www_base runs here (mandatory)