1 |
--- |
2 |
|
3 |
# Install apache |
4 |
|
5 |
- name: install httpd |
6 |
yum: name={{item}} state=present |
7 |
with_items: "{{ httpd_packages }}" |
8 |
|
9 |
# configure |
10 |
|
11 |
- name: httpd config file present |
12 |
template: |
13 |
src: ssl.conf.j2 |
14 |
dest: /etc/httpd/conf.d/ssl.conf |
15 |
owner: root |
16 |
group: root |
17 |
mode: 0644 |
18 |
backup: yes |
19 |
notify: restart httpd |
20 |
|
21 |
- name: httpoxy config present |
22 |
file: |
23 |
path: /etc/httpd/conf.d/00-httpoxy.conf |
24 |
owner: root |
25 |
group: root |
26 |
mode: 0644 |
27 |
backup: yes |
28 |
notify: restart httpd |
29 |
|
30 |
# replace welcome page |
31 |
|
32 |
- name: replace apache welcome page |
33 |
stat: |
34 |
path: "{{ httpd_web_root }}/index.html" |
35 |
ignore_errors: yes |
36 |
register: index_page |
37 |
|
38 |
- name: create index page |
39 |
file: |
40 |
path: "{{ httpd_web_root }}/index.html" |
41 |
owner: root |
42 |
group: root |
43 |
mode: 0644 |
44 |
state: touch |
45 |
when: index_page.stat.exists == false |
46 |
|
47 |
# publish last CRL to web root with cron |
48 |
|
49 |
- name: copy cronjob to sbin |
50 |
template: |
51 |
src: crl_publish.sh.j2 |
52 |
dest: /usr/local/sbin/crl_publish.sh |
53 |
owner: root |
54 |
group: root |
55 |
mode: 0744 |
56 |
|
57 |
- name: add cron job to run crl_publish script |
58 |
cron: |
59 |
name: "publish crl" |
60 |
user: root |
61 |
job: "/usr/local/sbin/crl_publish.sh" |