34 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			YAML
		
	
	
			
		
		
	
	
			34 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			YAML
		
	
	
| ---
 | |
| # This playbook deploys the nginx as reverse prox.
 | |
| 
 | |
| - name: Nginx for Odoo
 | |
|   hosts: tzaustria
 | |
|   become: yes
 | |
|   # deactivate gather_facts when python is not installed on server
 | |
|   # gather_facts: false
 | |
|   # pre_tasks:
 | |
|   #  - raw: which python || apt-get update
 | |
|   #  - raw: (which python && which aptitude) || apt-get install -y python python-apt aptitude
 | |
|   #  - setup: # aka gather_facts
 | |
|   vars_prompt:
 | |
|     - name: "activate_https"
 | |
|       prompt: "HTTPS aktivieren (y/n)?"
 | |
|   roles:
 | |
|     - role: nginx
 | |
|       server_name: erp.tzaustria.info
 | |
|       nginx_http_params:
 | |
|         - sendfile on
 | |
|         - access_log /var/log/nginx/access.log
 | |
|       nginx_sites:
 | |
|          odoo_test:
 | |
|            server_name: "{{ server_name }}"
 | |
|            template: odoo_test.conf.j2
 | |
|       nginx_configs:
 | |
|          proxy:
 | |
|             - proxy_set_header X-Real-IP  $remote_addr
 | |
|             - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for
 | |
| 
 | |
|     - role: ssl-cert
 | |
|       ssl_certs_privkey_path: '/etc/nginx/ssl/odoo_test.key'
 | |
|       ssl_certs_cert_path: '/etc/nginx/ssl/odoo_test.crt'
 | |
|       when: activate_https == 'y' |