mirror of
				https://github.com/iiab/iiab.git
				synced 2025-03-09 15:40:17 +00:00 
			
		
		
		
	Merge pull request #2133 from holta/softcode-uses-apache
Softcode/Tighten nginx/tasks/only_nginx.yml & nginx/tasks/uses_apache.yml
This commit is contained in:
		
						commit
						ff792d8fe0
					
				
					 2 changed files with 26 additions and 48 deletions
				
			
		| 
						 | 
					@ -1,15 +1,14 @@
 | 
				
			||||||
 | 
					# The ~100 lines of code below is near-identical to what's in tasks/enable.yml
 | 
				
			||||||
 | 
					# for these 6 playbooks.  Any way we can consolidate / reduce duplication?
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: Remove symlink /etc/apache2/sites-enabled/awstats.conf
 | 
					- name: Remove symlink /etc/apache2/sites-enabled/awstats.conf
 | 
				
			||||||
  file:
 | 
					  command: a2dissite awstats.conf
 | 
				
			||||||
    path: /etc/apache2/sites-enabled/awstats.conf
 | 
					 | 
				
			||||||
    state: absent
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: Install /etc/nginx/conf.d/awstats-nginx.conf from template, if awstats_enabled
 | 
					- name: Install /etc/nginx/conf.d/awstats-nginx.conf from template, if awstats_enabled
 | 
				
			||||||
  template:
 | 
					  template:
 | 
				
			||||||
    src: roles/awstats/templates/awstats-nginx.conf
 | 
					    src: roles/awstats/templates/awstats-nginx.conf
 | 
				
			||||||
    dest: /etc/nginx/conf.d/awstats-nginx.conf
 | 
					    dest: /etc/nginx/conf.d/awstats-nginx.conf
 | 
				
			||||||
    # owner: root
 | 
					 | 
				
			||||||
    # group: root
 | 
					 | 
				
			||||||
    # mode: '0644'
 | 
					 | 
				
			||||||
  when: awstats_enabled | bool
 | 
					  when: awstats_enabled | bool
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: Remove NGINX support for AWStats, if not awstats_enabled
 | 
					- name: Remove NGINX support for AWStats, if not awstats_enabled
 | 
				
			||||||
| 
						 | 
					@ -20,17 +19,12 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: Remove symlink /etc/apache2/sites-enabled/calibre-web.conf
 | 
					- name: Remove symlink /etc/apache2/sites-enabled/calibre-web.conf
 | 
				
			||||||
  file:
 | 
					  command: a2dissite calibre-web.conf
 | 
				
			||||||
    path: /etc/apache2/sites-enabled/calibre-web.conf
 | 
					 | 
				
			||||||
    state: absent
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: Install /etc/nginx/conf.d/calibre-web-nginx.conf from template, if calibreweb_enabled
 | 
					- name: Install /etc/nginx/conf.d/calibre-web-nginx.conf from template, if calibreweb_enabled
 | 
				
			||||||
  template:
 | 
					  template:
 | 
				
			||||||
    src: roles/calibre-web/templates/calibre-web-nginx.conf.j2
 | 
					    src: roles/calibre-web/templates/calibre-web-nginx.conf.j2
 | 
				
			||||||
    dest: /etc/nginx/conf.d/calibre-web-nginx.conf
 | 
					    dest: /etc/nginx/conf.d/calibre-web-nginx.conf
 | 
				
			||||||
    # owner: root
 | 
					 | 
				
			||||||
    # group: root
 | 
					 | 
				
			||||||
    # mode: '0644'
 | 
					 | 
				
			||||||
  when: calibreweb_enabled | bool
 | 
					  when: calibreweb_enabled | bool
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: Remove NGINX support for Calibre-Web, if not calibreweb_enabled
 | 
					- name: Remove NGINX support for Calibre-Web, if not calibreweb_enabled
 | 
				
			||||||
| 
						 | 
					@ -41,17 +35,12 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: Remove symlink /etc/apache2/sites-enabled/gitea.conf
 | 
					- name: Remove symlink /etc/apache2/sites-enabled/gitea.conf
 | 
				
			||||||
  file:
 | 
					  command: a2dissite gitea.conf
 | 
				
			||||||
    path: /etc/apache2/sites-enabled/gitea.conf
 | 
					 | 
				
			||||||
    state: absent
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: Install /etc/nginx/conf.d/gitea-nginx.conf from template, if gitea_enabled
 | 
					- name: Install /etc/nginx/conf.d/gitea-nginx.conf from template, if gitea_enabled
 | 
				
			||||||
  template:
 | 
					  template:
 | 
				
			||||||
    src: roles/gitea/templates/gitea-nginx.conf.j2
 | 
					    src: roles/gitea/templates/gitea-nginx.conf.j2
 | 
				
			||||||
    dest: /etc/nginx/conf.d/gitea-nginx.conf
 | 
					    dest: /etc/nginx/conf.d/gitea-nginx.conf
 | 
				
			||||||
    # owner: root
 | 
					 | 
				
			||||||
    # group: root
 | 
					 | 
				
			||||||
    # mode: '0644'
 | 
					 | 
				
			||||||
  when: gitea_enabled | bool
 | 
					  when: gitea_enabled | bool
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: Remove NGINX support for Gitea, if not gitea_enabled
 | 
					- name: Remove NGINX support for Gitea, if not gitea_enabled
 | 
				
			||||||
| 
						 | 
					@ -62,17 +51,12 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: Remove symlink /etc/apache2/sites-enabled/kiwix.conf
 | 
					- name: Remove symlink /etc/apache2/sites-enabled/kiwix.conf
 | 
				
			||||||
  file:
 | 
					  command: a2dissite kiwix.conf
 | 
				
			||||||
    path: /etc/apache2/sites-enabled/kiwix.conf
 | 
					 | 
				
			||||||
    state: absent
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: Install /etc/nginx/conf.d/kiwix-nginx.conf from template, if kiwix_enabled
 | 
					- name: Install /etc/nginx/conf.d/kiwix-nginx.conf from template, if kiwix_enabled
 | 
				
			||||||
  template:
 | 
					  template:
 | 
				
			||||||
    src: roles/kiwix/templates/kiwix-nginx.conf
 | 
					    src: roles/kiwix/templates/kiwix-nginx.conf
 | 
				
			||||||
    dest: /etc/nginx/conf.d/kiwix-nginx.conf
 | 
					    dest: /etc/nginx/conf.d/kiwix-nginx.conf
 | 
				
			||||||
    # owner: root
 | 
					 | 
				
			||||||
    # group: root
 | 
					 | 
				
			||||||
    # mode: '0644'
 | 
					 | 
				
			||||||
  when: kiwix_enabled | bool
 | 
					  when: kiwix_enabled | bool
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: Remove NGINX support for Kiwix, if not kiwix_enabled
 | 
					- name: Remove NGINX support for Kiwix, if not kiwix_enabled
 | 
				
			||||||
| 
						 | 
					@ -83,17 +67,12 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: Remove symlink /etc/apache2/sites-enabled/kolibri.conf
 | 
					- name: Remove symlink /etc/apache2/sites-enabled/kolibri.conf
 | 
				
			||||||
  file:
 | 
					  command: a2dissite kolibri.conf
 | 
				
			||||||
    path: /etc/apache2/sites-enabled/kolibri.conf
 | 
					 | 
				
			||||||
    state: absent
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: Install /etc/nginx/conf.d/kolibri-nginx.conf from template, if kolibri_enabled
 | 
					- name: Install /etc/nginx/conf.d/kolibri-nginx.conf from template, if kolibri_enabled
 | 
				
			||||||
  template:
 | 
					  template:
 | 
				
			||||||
    src: roles/kolibri/templates/kolibri-nginx.conf.j2
 | 
					    src: roles/kolibri/templates/kolibri-nginx.conf.j2
 | 
				
			||||||
    dest: /etc/nginx/conf.d/kolibri-nginx.conf
 | 
					    dest: /etc/nginx/conf.d/kolibri-nginx.conf
 | 
				
			||||||
    # owner: root
 | 
					 | 
				
			||||||
    # group: root
 | 
					 | 
				
			||||||
    # mode: '0644'
 | 
					 | 
				
			||||||
  when: kolibri_enabled | bool
 | 
					  when: kolibri_enabled | bool
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: Remove NGINX support for Kolibri, if not kolibri_enabled
 | 
					- name: Remove NGINX support for Kolibri, if not kolibri_enabled
 | 
				
			||||||
| 
						 | 
					@ -104,17 +83,12 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: Remove symlink /etc/apache2/sites-enabled/sugarizer.conf
 | 
					- name: Remove symlink /etc/apache2/sites-enabled/sugarizer.conf
 | 
				
			||||||
  file:
 | 
					  command: a2dissite sugarizer.conf
 | 
				
			||||||
    path: /etc/apache2/sites-enabled/sugarizer.conf
 | 
					 | 
				
			||||||
    state: absent
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: Install /etc/nginx/conf.d/sugarizer-nginx.conf from template, if sugarizer_enabled
 | 
					- name: Install /etc/nginx/conf.d/sugarizer-nginx.conf from template, if sugarizer_enabled
 | 
				
			||||||
  template:
 | 
					  template:
 | 
				
			||||||
    src: roles/sugarizer/templates/sugarizer-nginx.conf
 | 
					    src: roles/sugarizer/templates/sugarizer-nginx.conf
 | 
				
			||||||
    dest: /etc/nginx/conf.d/sugarizer-nginx.conf
 | 
					    dest: /etc/nginx/conf.d/sugarizer-nginx.conf
 | 
				
			||||||
    # owner: root
 | 
					 | 
				
			||||||
    # group: root
 | 
					 | 
				
			||||||
    # mode: '0644'
 | 
					 | 
				
			||||||
  when: sugarizer_enabled | bool
 | 
					  when: sugarizer_enabled | bool
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: Remove NGINX support for Sugarizer, if not sugarizer_enabled
 | 
					- name: Remove NGINX support for Sugarizer, if not sugarizer_enabled
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,37 +1,41 @@
 | 
				
			||||||
- name: Install /etc/nginx/conf.d/dokuwiki-nginx.conf from template, if dokuwiki_enabled
 | 
					# The ~40 lines of code below are near-identical to what's in tasks/enable.yml
 | 
				
			||||||
 | 
					# for these 6 playbooks.  Any way PR #2131 etc can help reduce duplication?
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- name: Install {{ nginx_config_dir }}/dokuwiki-nginx.conf from template, if dokuwiki_enabled
 | 
				
			||||||
  template:
 | 
					  template:
 | 
				
			||||||
    src: dokuwiki-nginx.conf
 | 
					    src: dokuwiki-nginx.conf
 | 
				
			||||||
    dest: /etc/nginx/conf.d/dokuwiki-nginx.conf
 | 
					    dest: {{ nginx_config_dir }}/dokuwiki-nginx.conf    # /etc/nginx/conf.d
 | 
				
			||||||
  when: dokuwiki_enabled | bool
 | 
					  when: dokuwiki_enabled | bool
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: Install /etc/nginx/conf.d/elgg-nginx.conf from template, if elgg_enabled
 | 
					- name: Install {{ nginx_config_dir }}/elgg-nginx.conf from template, if elgg_enabled
 | 
				
			||||||
  template:
 | 
					  template:
 | 
				
			||||||
    src: elgg-nginx.conf
 | 
					    src: elgg-nginx.conf
 | 
				
			||||||
    dest: /etc/nginx/conf.d/elgg-nginx.conf
 | 
					    dest: {{ nginx_config_dir }}/elgg-nginx.conf    # /etc/nginx/conf.d
 | 
				
			||||||
  when: elgg_enabled | bool
 | 
					  when: elgg_enabled | bool
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: Install /etc/nginx/conf.d/lokole-nginx.conf from template, if lokole_enabled
 | 
					- name: Install {{ nginx_config_dir }}/lokole-nginx.conf from template, if lokole_enabled
 | 
				
			||||||
  template:
 | 
					  template:
 | 
				
			||||||
    src: lokole-nginx.conf.j2
 | 
					    src: lokole-nginx.conf.j2
 | 
				
			||||||
    dest: /etc/nginx/conf.d/lokole-nginx.conf
 | 
					    dest: {{ nginx_config_dir }}/lokole-nginx.conf    # /etc/nginx/conf.d
 | 
				
			||||||
  when: lokole_enabled | bool
 | 
					  when: lokole_enabled | bool
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: Install /etc/nginx/conf.d/moodle-nginx.conf from template, if moodle_enabled
 | 
					- name: Install {{ nginx_config_dir }}/moodle-nginx.conf from template, if moodle_enabled
 | 
				
			||||||
  template:
 | 
					  template:
 | 
				
			||||||
    src: moodle-nginx.conf.j2
 | 
					    src: moodle-nginx.conf.j2
 | 
				
			||||||
    dest: /etc/nginx/conf.d/moodle-nginx.conf
 | 
					    dest: {{ nginx_config_dir }}/moodle-nginx.conf    # /etc/nginx/conf.d
 | 
				
			||||||
  when: moodle_enabled | bool
 | 
					  when: moodle_enabled | bool
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: Install /etc/nginx/conf.d/nextcloud-nginx.conf from template, if nextcloud_enabled
 | 
					- name: Install {{ nginx_config_dir }}/nextcloud-nginx.conf from template, if nextcloud_enabled
 | 
				
			||||||
  template:
 | 
					  template:
 | 
				
			||||||
    src: nextcloud-nginx.conf
 | 
					    src: nextcloud-nginx.conf
 | 
				
			||||||
    dest: /etc/nginx/conf.d/nextcloud-nginx.conf
 | 
					    dest: {{ nginx_config_dir }}/nextcloud-nginx.conf    # /etc/nginx/conf.d
 | 
				
			||||||
  when: nextcloud_enabled | bool
 | 
					  when: nextcloud_enabled | bool
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: Install /etc/nginx/conf.d/nodered-nginx.conf from template, if nodered_enabled
 | 
					- name: Install {{ nginx_config_dir }}/nodered-nginx.conf from template, if nodered_enabled
 | 
				
			||||||
  template:
 | 
					  template:
 | 
				
			||||||
    src: nodered-nginx.conf.j2
 | 
					    src: nodered-nginx.conf.j2
 | 
				
			||||||
    dest: /etc/nginx/conf.d/nodered-nginx.conf
 | 
					    dest: {{ nginx_config_dir }}/nodered-nginx.conf    # /etc/nginx/conf.d
 | 
				
			||||||
    # mode: '0666'
 | 
					    # mode: '0666'
 | 
				
			||||||
  when: nodered_enabled | bool
 | 
					  when: nodered_enabled | bool
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue