mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
tuck the alternate path creation into conditional block
This commit is contained in:
parent
38bead2f4e
commit
a7d179bb30
1 changed files with 18 additions and 14 deletions
|
@ -38,17 +38,6 @@
|
||||||
# append: yes
|
# append: yes
|
||||||
|
|
||||||
|
|
||||||
- name: Insure alternate nginx path is present
|
|
||||||
file:
|
|
||||||
path: "{{ item }}"
|
|
||||||
state: directory
|
|
||||||
with_items:
|
|
||||||
- "{{ nginx_conf_dir }}"
|
|
||||||
- "{{ nginx_dir }}/modules-available"
|
|
||||||
- "{{ nginx_dir }}/modules-enabled"
|
|
||||||
- "{{ nginx_dir }}/sites-available"
|
|
||||||
- "{{ nginx_dir }}/sites-enabled"
|
|
||||||
|
|
||||||
- name: Remove NGINX default config /etc/nginx/sites-enabled/default
|
- name: Remove NGINX default config /etc/nginx/sites-enabled/default
|
||||||
file:
|
file:
|
||||||
path: /etc/nginx/sites-enabled/default
|
path: /etc/nginx/sites-enabled/default
|
||||||
|
@ -68,6 +57,21 @@
|
||||||
|
|
||||||
# start block
|
# start block
|
||||||
- block:
|
- block:
|
||||||
|
- name: Insure alternate nginx path is present
|
||||||
|
file:
|
||||||
|
path: "{{ item }}"
|
||||||
|
state: directory
|
||||||
|
with_items:
|
||||||
|
- "{{ nginx_conf_dir }}"
|
||||||
|
- "{{ nginx_dir }}/sites-available"
|
||||||
|
- "{{ nginx_dir }}/sites-enabled"
|
||||||
|
|
||||||
|
- name: Link {{ nginx_dir }}/modules-enabled
|
||||||
|
file:
|
||||||
|
src: /etc/nginx/modules-enabled
|
||||||
|
path: "{{ nginx_dir }}/modules-enabled"
|
||||||
|
state: link
|
||||||
|
|
||||||
- name: Grab stock unit file
|
- name: Grab stock unit file
|
||||||
copy:
|
copy:
|
||||||
force: yes
|
force: yes
|
||||||
|
@ -75,7 +79,7 @@
|
||||||
dest: /etc/systemd/system/iiab-nginx.service
|
dest: /etc/systemd/system/iiab-nginx.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/nginx.service
|
command: sed -i 's|/usr/sbin/nginx|/usr/sbin/nginx -c {{ nginx_dir }}/nginx.conf|' /etc/systemd/system/iiab-nginx.service
|
||||||
# lineinfile:
|
# lineinfile:
|
||||||
# path: /etc/systemd/system/nginx.service
|
# path: /etc/systemd/system/nginx.service
|
||||||
# state: present
|
# state: present
|
||||||
|
@ -85,14 +89,14 @@
|
||||||
# - { regexp: '^ExecStartPre=/usr/sbin/nginx' , line: 'ExecStartPre=/usr/sbin/nginx -c {{ nginx_dir }}/nginx.conf' }
|
# - { regexp: '^ExecStartPre=/usr/sbin/nginx' , line: 'ExecStartPre=/usr/sbin/nginx -c {{ nginx_dir }}/nginx.conf' }
|
||||||
# - { regexp: '^ExecStart=/usr/sbin/nginx', line: 'ExecStart=/usr/sbin/nginx -c {{ nginx_dir }}/nginx.conf' }
|
# - { 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' }
|
# - { regexp: '^ExecReload=/usr/sbin/nginx', line: 'ExecReload=/usr/sbin/nginx -c {{ nginx_dir }}/nginx.conf' }
|
||||||
|
|
||||||
- name: start iiab-nginx on port {{ nginx_port }}
|
- name: start iiab-nginx on port {{ nginx_port }}
|
||||||
systemd:
|
systemd:
|
||||||
daemon_reload: yes
|
daemon_reload: yes
|
||||||
name: iiab-nginx.service
|
name: iiab-nginx.service
|
||||||
state: restarted
|
state: restarted
|
||||||
|
|
||||||
# end block
|
# end block
|
||||||
when: is_guest or nginx_dir != "/etc/nginx"
|
when: nginx_port|int != 80 or nginx_dir != "/etc/nginx"
|
||||||
|
|
||||||
- debug:
|
- debug:
|
||||||
msg: roles/nginx/tasks/homepage.yml will run LATER (invoked by roles/www_options/tasks/main.yml) SO THAT NGINX CAN REDIRECT http://box TO http://box{{ iiab_home_url }} (based on var iiab_home_url)
|
msg: roles/nginx/tasks/homepage.yml will run LATER (invoked by roles/www_options/tasks/main.yml) SO THAT NGINX CAN REDIRECT http://box TO http://box{{ iiab_home_url }} (based on var iiab_home_url)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue