source: main/trunk/greenstone3/src/ansible-playbooks/reverse-proxy-playbook.yml@ 38542

Last change on this file since 38542 was 38542, checked in by davidb, 6 months ago

Getting the Apache2 reverse proxy going

File size: 1.2 KB
Line 
1---
2- hosts: localhost
3 connection: local
4 become: true
5 vars_files:
6 - vars/default-core.yml
7
8 tasks:
9 - name: Upgrading Ansible to use 'aptitute' as package installation manager
10 apt: name=aptitude update_cache=yes state=latest force_apt_get=yes
11
12 - name: Install prerequisites
13 apt: name={{ item }} update_cache=yes state=latest
14 loop: [ 'python3-certbot-apache' ]
15
16 - name: Install Apache2
17 apt: name=apache2 update_cache=yes state=latest
18
19 - name: Enable Apache2 Modules
20 shell: /usr/sbin/a2enmod rewrite headers proxy proxy_http proxy_wstunnel
21
22 - name: Set up Apache virtualhost
23 template:
24 src: "files/gs3-apache.conf.j2"
25 dest: "/etc/apache2/sites-available/{{ apache2_http_conf }}"
26
27 - name: Enable new site
28 shell: /usr/sbin/a2ensite {{ apache2_http_conf }}
29 notify: Reload Apache
30
31# - name: "UFW - Allow HTTP on port {{ apache2_http_port }}"
32# ufw:
33# rule: allow
34# port: "{{ apache2_http_port }}"
35# proto: tcp
36
37 handlers:
38 - name: Reload Apache
39 service:
40 name: apache2
41 state: reloaded
42
43 - name: Restart Apache
44 service:
45 name: apache2
46 state: restarted
Note: See TracBrowser for help on using the repository browser.