]> arthur.barton.de Git - AnsibleRoles.git/blob - roles/piwik/tasks/main.yml
Apt module: Update "state=installed" to "state=present"
[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=present
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=present
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: remove README.md.gz, to make self-check happy
87   tags:
88     - piwik
89   file: >
90     state=absent
91     path=/usr/share/doc/piwik/README.md.gz
92
93 - name: install Apache VHost configuration for Piwik
94   tags:
95     - piwik
96     - apache
97   template: >
98     dest=/etc/apache2/sites-available/piwik.conf
99     group=root
100     mode=0644
101     owner=root
102     src=apache2_piwik_vhost.conf.j2
103   notify:
104     - reload "apache2" (graceful)
105
106 - name: enable Apache VHost configuration for Piwik
107   tags:
108     - piwik
109     - apache
110   file: >
111     dest=/etc/apache2/sites-enabled/piwik.conf
112     group=root
113     owner=root
114     src=/etc/apache2/sites-available/piwik.conf
115     state=link
116   notify:
117     - reload "apache2" (graceful)
118
119 - name: install Piwik PHP configuration
120   tags:
121     - php
122     - piwik
123   template: >
124     dest=/etc/php5/apache2/conf.d/99-piwik.ini
125     group=root
126     mode=0644
127     owner=root
128     src=php_piwik.ini.j2
129   notify:
130     - restart "apache2"