]> arthur.barton.de Git - AnsibleRoles.git/blob - roles/piwik/tasks/main.yml
apache2: Add 'reload "apache2" (graceful)' handler
[AnsibleRoles.git] / roles / piwik / tasks / main.yml
1 ---
2 # tasks file for piwik
3
4 - name: install "apt-transport-https" and "ca-certificates"
5   tags:
6     - docker
7     - packages
8   apt: >
9     name={{ item }}
10     state=installed
11   with_items:
12     - apt-transport-https
13     - ca-certificates
14   when: piwik_apt_repository.startswith("https://")
15
16 - name: install Piwik repository GnuPG key
17   tags:
18     - piwik
19     - packages
20   copy: >
21     dest=/etc/apt/trusted.gpg.d/
22     group=root
23     mode=0644
24     owner=root
25     src=piwik.gpg
26   notify:
27     - update APT repositories
28
29 - name: install Piwik repository configuration
30   tags:
31     - piwik
32     - packages
33   template: >
34     dest=/etc/apt/sources.list.d/piwik.list
35     group=root
36     mode=0644
37     owner=root
38     src=piwik.list.j2
39   notify:
40     - update APT repositories
41
42 - meta: flush_handlers
43   tags:
44     - piwik
45     - packages
46
47 - name: install "piwik"
48   tags:
49     - piwik
50     - packages
51   apt: >
52     name=piwik
53     state=installed
54
55 - name: install Piwik configuration
56   tags:
57     - piwik
58   template: >
59     dest=/etc/piwik/config.ini.php
60     force=no
61     group=www-data
62     mode=0664
63     owner=root
64     src=config.ini.php.j2
65
66 - name: install Piwik "htaccess" configuration
67   tags:
68     - piwik
69   copy: >
70     dest=/etc/piwik/.htaccess
71     force=no
72     group=www-data
73     mode=0664
74     owner=root
75     src=htaccess
76
77 - name: make JavaScript tracker writable
78   tags:
79     - piwik
80   file: >
81     group=www-data
82     mode=0664
83     owner=root
84     path=/usr/share/piwik/piwik.js
85
86 - name: install Apache VHost configuration for Piwik
87   tags:
88     - piwik
89     - apache
90   template: >
91     dest=/etc/apache2/sites-available/piwik.conf
92     group=root
93     mode=0644
94     owner=root
95     src=apache2_piwik_vhost.conf.j2
96   notify:
97     - reload "apache2" (graceful)
98
99 - name: enable Apache VHost configuration for Piwik
100   tags:
101     - piwik
102     - apache
103   file: >
104     dest=/etc/apache2/sites-enabled/piwik.conf
105     group=root
106     owner=root
107     src=/etc/apache2/sites-available/piwik.conf
108     state=link
109   notify:
110     - reload "apache2" (graceful)
111
112 - name: install Piwik PHP configuration
113   tags:
114     - php
115     - piwik
116   template: >
117     dest=/etc/php5/apache2/conf.d/99-piwik.ini
118     group=root
119     mode=0644
120     owner=root
121     src=php_piwik.ini.j2
122   notify:
123     - restart "apache2"