aboutsummaryrefslogtreecommitdiffstats
path: root/nms/ansible/playbook.yml
blob: c6f558c996eb87c158ce64cf46b514df7f92157b (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
---
- hosts: nms-front
  become: false
  tasks:
  # Some of these are probably redundant, but kept around because it works
  # and they aren't too bad.
  - name: Misc packages
    apt: name={{ item }} state=present
    with_items:
    - wget
    - vim
    - man
    - build-essential
    - net-tools
    - bash-completion
    - git-core
    - autoconf
    - netcat
    - libwww-perl
    - libmicrohttpd-dev
    - libcurl4-gnutls-dev
    - libedit-dev
    - libpcre3-dev
    - libncurses5-dev
    - python-demjson
    - python-docutils
    - libtool
    - locales
    - screen
    - openssh-server	
    - libcapture-tiny-perl
    - libcgi-pm-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
    - libimage-magick-perl
    - libimage-magick-q16-perl
    - libjson-perl
    - libjson-xs-perl
    - libnetaddr-ip-perl
    - libnet-cidr-perl
    - libnet-ip-perl
    - libnet-openssh-perl
    - libnet-oping-perl
    - libnet-rawip-perl
    - libnet-telnet-cisco-perl
    - libnet-telnet-perl
    - libsnmp-perl
    - libsocket6-perl
    - libsocket-perl
    - libswitch-perl
    - libtimedate-perl
    - perl
    - perl-base
    - perl-modules
    - varnish
    - libfreezethaw-perl		
    - apache2

  # Note the update!
  # 
  # The idea here is that you run this playbook repeatedly on whatever
  # "production" site is in use instead of manually logging in and doing
  # changes.
  - name: tgmanage repo
    git: repo=https://github.com/tech-server/tgmanage.git dest=/srv/tgmanage update=true accept_hostkey=yes track_submodules=no

  - name: Enable CGI
    apache2_module: state=present name=cgid

  - name: Remove default apache site
    file: path=/etc/apache2/sites-enabled/000-default.conf  state=absent

  - name: Add NMS site config
    file: src=/srv/tgmanage/web/etc/apache2/nms.tg16.gathering.org.conf dest=/etc/apache2/sites-enabled/nms.tg16.gathering.org.conf state=link

  - name: "Apache: Don't listen on 80"
    lineinfile: line="Listen 80" state=absent dest=/etc/apache2/ports.conf

  - name: "Apache: DO listen on 8080"
    lineinfile: line="Listen 8080" state=present dest=/etc/apache2/ports.conf

  - name: "Varnish: Set up VCL"
    file: path=/etc/varnish/default.vcl src=/srv/tgmanage/web/etc/varnish/nms.vcl state=link force=true

  - name: "Varnish: Remove default systemd config"
    lineinfile: line="ExecStart=/usr/sbin/varnishd -a :6081 -T localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m" state=absent dest=/lib/systemd/system/varnish.service

  - name: "Varnish: Add sensible systemd config"
    lineinfile: line="ExecStart=/usr/sbin/varnishd -f /etc/varnish/default.vcl -s malloc,256m" state=present dest=/lib/systemd/system/varnish.service insertafter="Service"