aboutsummaryrefslogtreecommitdiffstats
path: root/ansible/roles/web/tasks/main.yml
blob: dce3f4cdca03957e755ab07598dd458377f554f1 (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
- name: Install front-packages
  apt:
      name: "{{ item }}"
      state: present
  with_items:
        - 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

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

- name: Add packagecloud.io Varnish apt repository.
  apt_repository:
    repo: "deb https://packagecloud.io/varnishcache/varnish5/{{ 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 config
  copy:
      dest: /etc/varnish/default.vcl
      src: varnish.vcl
  notify: restart varnish

- 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

- cpanm:
    name: AnyEvent::InfluxDB