| 1 | ---
|
|---|
| 2 |
|
|---|
| 3 | - name: Check that Apache is installed
|
|---|
| 4 | urpmi: name=apache state=installed no-recommends=yes
|
|---|
| 5 | tags: httpd
|
|---|
| 6 |
|
|---|
| 7 | - name: Configure Apache log directories
|
|---|
| 8 | file: path=/var/log/httpd/{{ item }} state=directory owner=apache group=apache mode=0755
|
|---|
| 9 | with_items:
|
|---|
| 10 | - www.mondorescue.org
|
|---|
| 11 | - www.mondorescue.com
|
|---|
| 12 | - www1.mondorescue.org
|
|---|
| 13 | - oldwww.mondorescue.org
|
|---|
| 14 | - mondorescue.hpintelco.org
|
|---|
| 15 | - www.project-builder.org
|
|---|
| 16 | - www1.project-builder.org
|
|---|
| 17 | - pusk.project-builder.org
|
|---|
| 18 | - uuwl.project-builder.org
|
|---|
| 19 | - www.dploy.org
|
|---|
| 20 | - www1.dploy.org
|
|---|
| 21 |
|
|---|
| 22 | - name: Configure Apache
|
|---|
| 23 | template: src={{ item }} dest=/etc/httpd/conf/vhosts.d/{{ item | basename }} owner=root group=root mode=0644 backup=yes
|
|---|
| 24 | with_fileglob: [ 'templates/*.conf' ]
|
|---|
| 25 | notify:
|
|---|
| 26 | - restart httpd
|
|---|
| 27 | tags: httpd
|
|---|
| 28 |
|
|---|
| 29 | - name: Configure Apache upload max
|
|---|
| 30 | lineinfile: path=/etc/httpd/conf/conf.d/fcgid.conf regexp='^[ ]*FcgidMaxRequestLen ' insertafter='[ ]*^#FcgidMaxRequestLen ' line=' FcgidMaxRequestLen 3000000'
|
|---|
| 31 | notify:
|
|---|
| 32 | - restart httpd
|
|---|
| 33 | tags: httpd
|
|---|
| 34 |
|
|---|
| 35 | - name: Setup httpd restart by cron
|
|---|
| 36 | cron: name=httpd-restart minute=43 hour=23 user=root job="/usr/bin/systemctl restart httpd" cron_file=httpd-restart state=present backup=yes
|
|---|
| 37 | tags: httpd
|
|---|
| 38 |
|
|---|
| 39 | - name: Configure Apache logrotate
|
|---|
| 40 | copy: src=files/mondorescue.logrot dest=/etc/logrotate.d/mondorescue owner=root group=root mode=0644 backup=yes
|
|---|
| 41 | tags: httpd
|
|---|
| 42 |
|
|---|
| 43 | - name: Configure Apache .ssh directory
|
|---|
| 44 | file: path=/var/www/.ssh state=directory owner=apache group=apache mode=0700
|
|---|
| 45 |
|
|---|
| 46 | - name: Configure Apache authorized_keys file
|
|---|
| 47 | file: path=/var/www/.ssh/authorized_keys owner=apache group=apache mode=0700 state=touch modification_time=preserve access_time=preserve
|
|---|
| 48 |
|
|---|
| 49 | - name: Copy public keys for pb access
|
|---|
| 50 | lineinfile: destfile=/var/www/.ssh/authorized_keys state=present line='{{ pbkey }}' mode=0600 backup=yes owner=apache group=apache
|
|---|
| 51 | tags: httpd
|
|---|
| 52 |
|
|---|
| 53 | - name: Check that Apache is running and enabled
|
|---|
| 54 | service: name=httpd state=started enabled=yes
|
|---|
| 55 | tags: httpd
|
|---|