mirror of
				https://github.com/kevinveenbirkenbach/computer-playbook.git
				synced 2025-10-31 10:19:09 +00:00 
			
		
		
		
	Refactored native-
This commit is contained in:
		
							
								
								
									
										2
									
								
								roles/https-redirect/meta/main.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								roles/https-redirect/meta/main.yml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,2 @@ | ||||
| dependencies: | ||||
| - https-server | ||||
							
								
								
									
										5
									
								
								roles/https-redirect/readme.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								roles/https-redirect/readme.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,5 @@ | ||||
| # native https-redirect | ||||
|  | ||||
| ## see | ||||
| - https://stackoverflow.com/questions/6045020/how-to-redirect-to-a-different-domain-using-nginx | ||||
| - https://docs.ansible.com/ansible/latest/user_guide/playbooks_loops.html | ||||
							
								
								
									
										12
									
								
								roles/https-redirect/tasks/main.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								roles/https-redirect/tasks/main.yml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,12 @@ | ||||
| --- | ||||
| - name: recieve redirect source certificates | ||||
|   command: certbot certonly --agree-tos --email {{administrator_email}} --non-interactive --webroot -w /var/lib/letsencrypt/ -d {{item.source}} | ||||
|   loop: "{{domain_mappings}}" | ||||
|  | ||||
| - name: configure nginx redirect configurations | ||||
|   vars: | ||||
|     domain: "{{item.source}}" | ||||
|     target_domain: "{{item.target}}" | ||||
|   template: src=redirect.domain.nginx.conf.j2 dest=/etc/nginx/conf.d/{{ domain }}.conf | ||||
|   loop: "{{domain_mappings}}" | ||||
|   notify: restart nginx | ||||
| @@ -0,0 +1,5 @@ | ||||
| server { | ||||
|   server_name {{domain}}; | ||||
|   {% include 'roles/letsencrypt/templates/ssl_header.j2' %} | ||||
|   return 301 https://{{target_domain}}$request_uri; | ||||
| } | ||||
		Reference in New Issue
	
	Block a user