[nginx] Drop role nginx-mailman
Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>certbot_on_virtu
							parent
							
								
									dafa3685ce
								
							
						
					
					
						commit
						ec262bd5c1
					
				| 
						 | 
					@ -20,12 +20,11 @@
 | 
				
			||||||
    nginx:
 | 
					    nginx:
 | 
				
			||||||
      ssl:
 | 
					      ssl:
 | 
				
			||||||
        cert: /etc/letsencrypt/live/crans.org/fullchain.pem
 | 
					        cert: /etc/letsencrypt/live/crans.org/fullchain.pem
 | 
				
			||||||
        key: /etc/letsencrypt/live/crans.org/privkey.pem
 | 
					        cert_key: /etc/letsencrypt/live/crans.org/privkey.pem
 | 
				
			||||||
        trusted_cert: /etc/letsencrypt/live/crans.org/chain.pem
 | 
					        trusted_cert: /etc/letsencrypt/live/crans.org/chain.pem
 | 
				
			||||||
  roles:
 | 
					  roles:
 | 
				
			||||||
    - mailman
 | 
					    - mailman
 | 
				
			||||||
    - nginx
 | 
					    - nginx
 | 
				
			||||||
    - nginx-mailman
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Deploy Mailman3
 | 
					# Deploy Mailman3
 | 
				
			||||||
- hosts: mailman.adm.crans.org
 | 
					- hosts: mailman.adm.crans.org
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,5 +0,0 @@
 | 
				
			||||||
---
 | 
					 | 
				
			||||||
- name: Reload nginx
 | 
					 | 
				
			||||||
  systemd:
 | 
					 | 
				
			||||||
    name: nginx
 | 
					 | 
				
			||||||
    state: reloaded
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,20 +0,0 @@
 | 
				
			||||||
---
 | 
					 | 
				
			||||||
- name: Copy configuration files
 | 
					 | 
				
			||||||
  template:
 | 
					 | 
				
			||||||
    src: "{{ item.src }}"
 | 
					 | 
				
			||||||
    dest: "{{ item.dest }}"
 | 
					 | 
				
			||||||
  loop:
 | 
					 | 
				
			||||||
    - src: nginx/snippets/fastcgi-mailman.conf.j2
 | 
					 | 
				
			||||||
      dest: /etc/nginx/snippets/fastcgi-mailman.conf
 | 
					 | 
				
			||||||
    - src: var/www/custom_401.html.j2
 | 
					 | 
				
			||||||
      dest: /var/www/custom_401.html
 | 
					 | 
				
			||||||
  notify: Reload nginx
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
- name: Enable mailman
 | 
					 | 
				
			||||||
  file:
 | 
					 | 
				
			||||||
    src: /etc/nginx/sites-available/mailman
 | 
					 | 
				
			||||||
    dest: /etc/nginx/sites-enabled/mailman
 | 
					 | 
				
			||||||
    state: link
 | 
					 | 
				
			||||||
    force: true
 | 
					 | 
				
			||||||
  when: not ansible_check_mode
 | 
					 | 
				
			||||||
  notify: Reload nginx
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,2 +0,0 @@
 | 
				
			||||||
{{ ansible_header | comment }}
 | 
					 | 
				
			||||||
Stop:$apr1$NXaV5H7Q$J3ora3Jo5h775Y1nm93PN1
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,94 +0,0 @@
 | 
				
			||||||
{{ ansible_header | comment }}
 | 
					 | 
				
			||||||
server {
 | 
					 | 
				
			||||||
	listen 80 default;
 | 
					 | 
				
			||||||
	listen [::]:80 default;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	server_name _;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	location / {
 | 
					 | 
				
			||||||
	    return 302 https://{{ mailman.default_host }}$request_uri;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Redirect everybody to mailing lists
 | 
					 | 
				
			||||||
server {
 | 
					 | 
				
			||||||
	listen 443 default_server ssl;
 | 
					 | 
				
			||||||
	listen [::]:443 default_server ssl;
 | 
					 | 
				
			||||||
	server_name _;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	include "/etc/nginx/snippets/options-ssl.conf";
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	location / {
 | 
					 | 
				
			||||||
		 return 302 https://{{ mailman.default_host }}$request_uri;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
server {
 | 
					 | 
				
			||||||
	listen 443 ssl http2;
 | 
					 | 
				
			||||||
	listen [::]:443 ssl http2;
 | 
					 | 
				
			||||||
	server_name {{ mailman.default_host }};
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	include "/etc/nginx/snippets/options-ssl.conf";
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	root /usr/lib/cgi-bin/mailman/;
 | 
					 | 
				
			||||||
	index index.htm index.html;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        location /error/ {
 | 
					 | 
				
			||||||
		internal;
 | 
					 | 
				
			||||||
		alias /var/www/;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	location /create {
 | 
					 | 
				
			||||||
		default_type text/html;
 | 
					 | 
				
			||||||
		alias /etc/mailman/create.html;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	location ~ ^/$ {
 | 
					 | 
				
			||||||
		return 302 https://{{ mailman.default_host }}/listinfo;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	location / {
 | 
					 | 
				
			||||||
		include "/etc/nginx/snippets/fastcgi-mailman.conf";
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        location ~ ^/listinfo {
 | 
					 | 
				
			||||||
                satisfy any;
 | 
					 | 
				
			||||||
		include "/etc/nginx/snippets/fastcgi-mailman.conf";
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		{% for net in mynetworks -%}
 | 
					 | 
				
			||||||
                allow {{ net }};
 | 
					 | 
				
			||||||
		{% endfor -%}
 | 
					 | 
				
			||||||
                deny all;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	        auth_basic {{ mailman.auth_basic }}
 | 
					 | 
				
			||||||
		auth_basic_user_file /etc/nginx/mailman_passwd;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		error_page 401 /error/custom_401.html;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        location ~ ^/admin {
 | 
					 | 
				
			||||||
                satisfy any;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		include "/etc/nginx/snippets/fastcgi-mailman.conf";
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		{% for net in mynetworks -%}
 | 
					 | 
				
			||||||
                allow {{ net }};
 | 
					 | 
				
			||||||
		{% endfor -%}
 | 
					 | 
				
			||||||
                deny all;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	        auth_basic {{ mailman.auth_basic }}
 | 
					 | 
				
			||||||
		auth_basic_user_file /etc/nginx/mailman_passwd;
 | 
					 | 
				
			||||||
		error_page 401 /error/custom_401.html;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	location /images/mailman { alias /usr/share/images/mailman;}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	location /robots.txt { alias /var/www/robots.txt;}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	location /archives {
 | 
					 | 
				
			||||||
		alias /var/lib/mailman/archives/public;
 | 
					 | 
				
			||||||
		autoindex on;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
		Loading…
	
		Reference in New Issue