aboutsummaryrefslogtreecommitdiffstats
path: root/ansible/roles/web/tasks/main.yml
blob: 3f80319d5c12c886cf602a483d2ea98e7447108b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
- name: Install front-packages
  apt:
      name: [
          'libcapture-tiny-perl',
          'libcommon-sense-perl',
          'libdata-dumper-simple-perl',
          'libdbd-pg-perl',
          'libdbi-perl',
          'libdigest-perl',
          'libgd-perl',
          'libgeo-ip-perl',
          'libhtml-parser-perl',
          'libhtml-template-perl',
          'libjson-perl',
          'libjson-xs-perl',
          'libnetaddr-ip-perl',
          'libnet-cidr-perl',
          'libnet-ip-perl',
          'libnet-oping-perl',
          'libnet-rawip-perl',
          'libsnmp-perl',
          'libsocket6-perl',
          'libsocket-perl',
          'libswitch-perl',
          'libtimedate-perl',
          'perl',
          'perl-base',
          'perl-modules',
          'libfreezethaw-perl',
          'apache2',
          'libxml2-dev',
          'build-essential',
          'cpanminus',
          'apt-transport-https',
          'python3-netaddr',
          'python3-flask']
      state: present

- name: Install InfluxDB module
  cpanm:
    name: AnyEvent::InfluxDB

- name: Make apache listen on port 8080
  lineinfile: dest=/etc/apache2/ports.conf regexp="^Listen 80" line="Listen 8080" state=present
  notify: restart apache

- apache2_module:
    state: present
    name: cgid
  notify: restart apache

- name: Enable gondul-config
  copy:
      dest: /etc/apache2/sites-enabled/gondul.conf
      src: apache-virtualhost.conf
  notify: restart apache

- command: a2dissite 000-default
  ignore_errors: true
  notify: restart apache

- name: Add packagecloud.io Varnish apt key.
  apt_key:
    url: https://packagecloud.io/varnishcache/varnish63/gpgkey
    state: present

- name: Add packagecloud.io Varnish apt repository.
  apt_repository:
    repo: "deb https://packagecloud.io/varnishcache/varnish63/{{ ansible_distribution | lower }}/ {{ ansible_distribution_release }} main"
    state: present

- name: Ensure Varnish is installed.
  apt:
    name: "varnish"
    state: present

- name: Ensure folder varnish.service.d exists
  file: path=/etc/systemd/system/varnish.service.d/ state=directory mode=0755

- name: Change varnish service.d
  copy:
      dest: /etc/systemd/system/varnish.service.d/customexec.conf
      src: varnish.service
  notify:
    - reload systemd

- name: Copy varnish-acl config
  copy:
      dest: /etc/varnish/auth.vcl
      src: auth.vcl
  notify: restart varnish

- name: Copy varnish config
  copy:
      dest: /etc/varnish/default.vcl
      src: varnish.vcl
  notify: restart varnish

- name: add systemd service file for gondul-template
  copy:
    dest: /etc/systemd/system/gondul-template.service
    src: gondul-template.service
  notify: restart gondul-template