mirror of
				https://github.com/iiab/iiab.git
				synced 2025-03-09 15:40:17 +00:00 
			
		
		
		
	kolibri - softcode nginx_config_dir, add disable logic
This commit is contained in:
		
							parent
							
								
									61b5800c19
								
							
						
					
					
						commit
						b31c2035a6
					
				
					 1 changed files with 16 additions and 14 deletions
				
			
		| 
						 | 
				
			
			@ -3,11 +3,7 @@
 | 
			
		|||
    name: kolibri
 | 
			
		||||
    state: started
 | 
			
		||||
    enabled: yes
 | 
			
		||||
  when: kolibri_enabled | bool
 | 
			
		||||
 | 
			
		||||
- name: Enable http://box{{ kolibri_url }} with Apache (a2ensite) if kolibri_enabled    # i.e. http://box/kolibri
 | 
			
		||||
  command: a2ensite kolibri.conf
 | 
			
		||||
  when: kolibri_enabled | bool and not nginx_enabled | bool
 | 
			
		||||
  when: kolibri_enabled
 | 
			
		||||
 | 
			
		||||
- name: Disable & Stop 'kolibri' systemd service if not kolibri_enabled
 | 
			
		||||
  systemd:
 | 
			
		||||
| 
						 | 
				
			
			@ -16,11 +12,15 @@
 | 
			
		|||
    state: stopped
 | 
			
		||||
  when: not kolibri_enabled
 | 
			
		||||
 | 
			
		||||
- name: Enable http://box{{ kolibri_url }} with Apache (a2ensite) if kolibri_enabled    # i.e. http://box/kolibri
 | 
			
		||||
  command: a2ensite kolibri.conf
 | 
			
		||||
  when: kolibri_enabled and not nginx_enabled
 | 
			
		||||
 | 
			
		||||
- name: Disable http://box{{ kolibri_url }} with Apache (a2dissite) if not kolibri_enabled
 | 
			
		||||
  command: a2dissite kolibri.conf
 | 
			
		||||
  when: not kolibri_enabled or nginx_enabled | bool
 | 
			
		||||
  when: not kolibri_enabled or nginx_enabled
 | 
			
		||||
 | 
			
		||||
- name: Supply /etc/nginx/conf.d/kolibri-nginx.conf when nginx_enabled
 | 
			
		||||
- name: Supply {{ nginx_config_dir }}/kolibri-nginx.conf when nginx_enabled
 | 
			
		||||
  template:
 | 
			
		||||
    src: "{{ item.src }}"
 | 
			
		||||
    dest: "{{ item.dest }}"
 | 
			
		||||
| 
						 | 
				
			
			@ -28,24 +28,26 @@
 | 
			
		|||
    owner: root
 | 
			
		||||
    group: root
 | 
			
		||||
  with_items:
 | 
			
		||||
    - { src: 'kolibri-nginx.conf.j2', dest: '/etc/nginx/conf.d/kolibri-nginx.conf', mode: '0644' }
 | 
			
		||||
  when: kolibri_enabled | bool and nginx_enabled | bool
 | 
			
		||||
    - { src: 'kolibri-nginx.conf.j2', dest: '{{ nginx_config_dir }}/kolibri-nginx.conf', mode: '0644' }
 | 
			
		||||
  when: kolibri_enabled and nginx_enabled
 | 
			
		||||
 | 
			
		||||
- name: Disable http://box{{ kolibri_url }} with Apache (a2dissite) if not kolibri_enabled
 | 
			
		||||
  command: a2dissite kolibri.conf
 | 
			
		||||
  when: not kolibri_enabled or nginx_enabled | bool
 | 
			
		||||
- name: Remove {{ nginx_config_dir }}/kolibri-nginx.conf when not nginx_enabled
 | 
			
		||||
  file:
 | 
			
		||||
    path: "{{ nginx_config_dir }}/kolibri-nginx.conf"
 | 
			
		||||
    state: absent
 | 
			
		||||
  when: not kolibri_enabled and nginx_enabled
 | 
			
		||||
 | 
			
		||||
- name: Restart Apache service ({{ apache_service }})    # e.g. apache2
 | 
			
		||||
  systemd:
 | 
			
		||||
    name: "{{ apache_service }}"
 | 
			
		||||
    state: restarted
 | 
			
		||||
  when: not nginx_enabled | bool
 | 
			
		||||
  when: not nginx_enabled
 | 
			
		||||
 | 
			
		||||
- name: Restart nginx service
 | 
			
		||||
  systemd:
 | 
			
		||||
    name: nginx
 | 
			
		||||
    state: restarted
 | 
			
		||||
  when: nginx_enabled | bool
 | 
			
		||||
  when: nginx_enabled
 | 
			
		||||
 | 
			
		||||
- name: Add 'kolibri' variable values to {{ iiab_ini_file }}    # /etc/iiab/iiab.ini
 | 
			
		||||
  ini_file:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue