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:
parent
5c8bb3c06f
commit
15f0f87d13
24 changed files with 29 additions and 24 deletions
|
@ -30,7 +30,7 @@
|
||||||
|
|
||||||
- name: Restart 'nginx' systemd service
|
- name: Restart 'nginx' systemd service
|
||||||
systemd:
|
systemd:
|
||||||
name: nginx
|
name: "{{ systemd_unit_name }}"
|
||||||
state: restarted
|
state: restarted
|
||||||
when: nginx_enabled
|
when: nginx_enabled
|
||||||
|
|
||||||
|
|
|
@ -12,5 +12,5 @@
|
||||||
|
|
||||||
- name: Restart 'nginx' systemd service
|
- name: Restart 'nginx' systemd service
|
||||||
systemd:
|
systemd:
|
||||||
name: nginx
|
name: "{{ systemd_unit_name }}"
|
||||||
state: restarted
|
state: restarted
|
||||||
|
|
|
@ -12,5 +12,5 @@
|
||||||
|
|
||||||
- name: Restart 'nginx' systemd service
|
- name: Restart 'nginx' systemd service
|
||||||
systemd:
|
systemd:
|
||||||
name: nginx
|
name: "{{ systemd_unit_name }}"
|
||||||
state: restarted
|
state: restarted
|
||||||
|
|
|
@ -31,5 +31,5 @@
|
||||||
|
|
||||||
- name: Restart 'nginx' systemd service
|
- name: Restart 'nginx' systemd service
|
||||||
systemd:
|
systemd:
|
||||||
name: nginx
|
name: "{{ systemd_unit_name }}"
|
||||||
state: restarted
|
state: restarted
|
||||||
|
|
|
@ -12,5 +12,5 @@
|
||||||
|
|
||||||
- name: Restart 'nginx' systemd service
|
- name: Restart 'nginx' systemd service
|
||||||
systemd:
|
systemd:
|
||||||
name: nginx
|
name: "{{ systemd_unit_name }}"
|
||||||
state: restarted
|
state: restarted
|
||||||
|
|
|
@ -28,5 +28,5 @@
|
||||||
|
|
||||||
- name: Restart 'nginx' systemd service
|
- name: Restart 'nginx' systemd service
|
||||||
systemd:
|
systemd:
|
||||||
name: nginx
|
name: "{{ systemd_unit_name }}"
|
||||||
state: restarted
|
state: restarted
|
||||||
|
|
|
@ -28,5 +28,5 @@
|
||||||
|
|
||||||
- name: Restart 'nginx' systemd service
|
- name: Restart 'nginx' systemd service
|
||||||
systemd:
|
systemd:
|
||||||
name: nginx
|
name: "{{ systemd_unit_name }}"
|
||||||
state: restarted
|
state: restarted
|
||||||
|
|
|
@ -29,5 +29,5 @@
|
||||||
|
|
||||||
- name: Restart 'nginx' systemd service
|
- name: Restart 'nginx' systemd service
|
||||||
systemd:
|
systemd:
|
||||||
name: nginx
|
name: "{{ systemd_unit_name }}"
|
||||||
state: restarted
|
state: restarted
|
||||||
|
|
|
@ -12,5 +12,5 @@
|
||||||
|
|
||||||
- name: Restart 'nginx' systemd service
|
- name: Restart 'nginx' systemd service
|
||||||
systemd:
|
systemd:
|
||||||
name: nginx
|
name: "{{ systemd_unit_name }}"
|
||||||
state: restarted
|
state: restarted
|
||||||
|
|
|
@ -28,5 +28,5 @@
|
||||||
|
|
||||||
- name: Restart 'nginx' systemd service
|
- name: Restart 'nginx' systemd service
|
||||||
systemd:
|
systemd:
|
||||||
name: nginx
|
name: "{{ systemd_unit_name }}"
|
||||||
state: restarted
|
state: restarted
|
||||||
|
|
|
@ -12,5 +12,5 @@
|
||||||
|
|
||||||
- name: Restart 'nginx' systemd service
|
- name: Restart 'nginx' systemd service
|
||||||
systemd:
|
systemd:
|
||||||
name: nginx
|
name: "{{ systemd_unit_name }}"
|
||||||
state: restarted
|
state: restarted
|
||||||
|
|
|
@ -12,5 +12,5 @@
|
||||||
|
|
||||||
- name: Restart 'nginx' systemd service
|
- name: Restart 'nginx' systemd service
|
||||||
systemd:
|
systemd:
|
||||||
name: nginx
|
name: "{{ systemd_unit_name }}"
|
||||||
state: restarted
|
state: restarted
|
||||||
|
|
|
@ -27,5 +27,5 @@
|
||||||
|
|
||||||
- name: Restart 'nginx' systemd service
|
- name: Restart 'nginx' systemd service
|
||||||
systemd:
|
systemd:
|
||||||
name: nginx
|
name: "{{ systemd_unit_name }}"
|
||||||
state: restarted
|
state: restarted
|
||||||
|
|
|
@ -28,5 +28,5 @@
|
||||||
|
|
||||||
- name: Restart 'nginx' systemd service
|
- name: Restart 'nginx' systemd service
|
||||||
systemd:
|
systemd:
|
||||||
name: nginx
|
name: "{{ systemd_unit_name }}"
|
||||||
state: restarted
|
state: restarted
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
|
|
||||||
- name: Enable & (Re)Start 'nginx' systemd service, if nginx_enabled
|
- name: Enable & (Re)Start 'nginx' systemd service, if nginx_enabled
|
||||||
systemd:
|
systemd:
|
||||||
name: nginx
|
name: "{{ systemd_unit_name }}"
|
||||||
daemon_reload: yes
|
daemon_reload: yes
|
||||||
enabled: yes
|
enabled: yes
|
||||||
state: restarted
|
state: restarted
|
||||||
|
@ -42,7 +42,7 @@
|
||||||
|
|
||||||
- name: Disable & Stop 'nginx' systemd service, if not nginx_enabled
|
- name: Disable & Stop 'nginx' systemd service, if not nginx_enabled
|
||||||
systemd:
|
systemd:
|
||||||
name: nginx
|
name: "{{ systemd_unit_name }}"
|
||||||
enabled: no
|
enabled: no
|
||||||
state: stopped
|
state: stopped
|
||||||
when: not nginx_enabled
|
when: not nginx_enabled
|
||||||
|
|
|
@ -73,11 +73,15 @@
|
||||||
- uwsgi_params
|
- uwsgi_params
|
||||||
- win-utf
|
- 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
|
- name: Grab stock unit file
|
||||||
copy:
|
copy:
|
||||||
force: yes
|
force: yes
|
||||||
src: /lib/systemd/system/nginx.service
|
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
|
- 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/iiab-nginx.service
|
||||||
|
|
|
@ -28,5 +28,5 @@
|
||||||
|
|
||||||
- name: Restart 'nginx' systemd service
|
- name: Restart 'nginx' systemd service
|
||||||
systemd:
|
systemd:
|
||||||
name: nginx
|
name: "{{ systemd_unit_name }}"
|
||||||
state: restarted
|
state: restarted
|
||||||
|
|
|
@ -12,5 +12,5 @@
|
||||||
|
|
||||||
- name: Reload 'nginx' systemd service
|
- name: Reload 'nginx' systemd service
|
||||||
systemd:
|
systemd:
|
||||||
name: nginx
|
name: "{{ systemd_unit_name }}"
|
||||||
state: reloaded
|
state: reloaded
|
||||||
|
|
|
@ -98,7 +98,7 @@
|
||||||
|
|
||||||
- name: Restart 'nginx' systemd service
|
- name: Restart 'nginx' systemd service
|
||||||
systemd:
|
systemd:
|
||||||
name: nginx
|
name: "{{ systemd_unit_name }}"
|
||||||
state: restarted
|
state: restarted
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -28,5 +28,5 @@
|
||||||
|
|
||||||
- name: Restart 'nginx' systemd service
|
- name: Restart 'nginx' systemd service
|
||||||
systemd:
|
systemd:
|
||||||
name: nginx
|
name: "{{ systemd_unit_name }}"
|
||||||
state: restarted
|
state: restarted
|
||||||
|
|
|
@ -30,5 +30,5 @@
|
||||||
|
|
||||||
- name: Restart 'nginx' systemd service
|
- name: Restart 'nginx' systemd service
|
||||||
systemd:
|
systemd:
|
||||||
name: nginx
|
name: "{{ systemd_unit_name }}"
|
||||||
state: restarted
|
state: restarted
|
||||||
|
|
|
@ -12,5 +12,5 @@
|
||||||
|
|
||||||
- name: Restart 'nginx' systemd service
|
- name: Restart 'nginx' systemd service
|
||||||
systemd:
|
systemd:
|
||||||
name: nginx
|
name: "{{ systemd_unit_name }}"
|
||||||
state: restarted
|
state: restarted
|
||||||
|
|
|
@ -167,7 +167,7 @@
|
||||||
|
|
||||||
- name: (Re)Start 'nginx' systemd service, if nginx_enabled
|
- name: (Re)Start 'nginx' systemd service, if nginx_enabled
|
||||||
systemd:
|
systemd:
|
||||||
name: nginx
|
name: "{{ systemd_unit_name }}"
|
||||||
state: restarted
|
state: restarted
|
||||||
when: nginx_enabled
|
when: nginx_enabled
|
||||||
|
|
||||||
|
|
|
@ -283,6 +283,7 @@ nginx_interface: 0.0.0.0
|
||||||
nginx_dir: /etc/nginx
|
nginx_dir: /etc/nginx
|
||||||
nginx_conf_dir: "{{ nginx_dir }}/conf.d"
|
nginx_conf_dir: "{{ nginx_dir }}/conf.d"
|
||||||
nginx_log_dir: /var/log/nginx
|
nginx_log_dir: /var/log/nginx
|
||||||
|
systemd_unit_name: nginx
|
||||||
# SEE BELOW: nginx_high_php_limits, apache_allow_sudo
|
# SEE BELOW: nginx_high_php_limits, apache_allow_sudo
|
||||||
|
|
||||||
# roles/www_base runs here (mandatory)
|
# roles/www_base runs here (mandatory)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue