summaryrefslogtreecommitdiffstats
path: root/roles/apache/tasks/main.yml
blob: d8222bb7ba5994fee723b0aba019402bc17d95ca (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
---
# install apache(httpd)
- name: install apache
  yum: name={{ item }} state=present
  with_items:
  - httpd
  - httpd-tools
  tags:
  - packages
  - apache

- name: set apache running/enabled
  service: name=httpd enabled=yes
  ignore_errors: true
  notify:
  - restart apache
  tags:
  - service
  - apache
  
# install hash randomization hotfix
- name: hotfix - copy over new httpd init script 
  copy: src="{{ files }}/hotfix/httpd/httpd.init" dest=/etc/init.d/httpd
        owner=root group=root mode=0755
  notify:
  - restart apache
  tags:
  - config
  - hotfix
  - apache

- name: hotfix - copy over new httpd sysconfig (el6)
  copy: src="{{ files }}/hotfix/httpd/httpd.sysconfig" dest=/etc/sysconfig/httpd
  when: ansible_distribution_major_version|int == 6
  notify:
  - restart apache
  tags:
  - config
  - hotfix
  - apache

- name: hotfix - copy over new httpd sysconfig (el7)
  copy: src="{{ files }}/hotfix/httpd/httpd.sysconfig" dest=/etc/sysconfig/httpd
  when: ansible_distribution_major_version|int == 7
  notify:
  - restart apache
  tags:
  - config
  - hotfix
  - apache

- name: add appserver headers.conf
  template: src="{{ files }}/httpd/headers.conf.j2" dest=/etc/httpd/conf.d/headers.conf
  notify:
  - restart apache
  tags: 
  - config
  - apache

- name: add apache_status location for collectd
  template: src="{{ files }}/httpd/apachestatus.conf" dest=/etc/httpd/conf.d/apachestatus.conf
  notify:
  - restart apache
  tags: 
  - config
  - apache
  
- name: setup logrotate to our needs
  copy: src="{{ files }}/httpd/httpd.logrotate" dest=/etc/logrotate.d/httpd
  tags:
  - config
  - apache