69 lines
1.4 KiB
YAML
69 lines
1.4 KiB
YAML
---
|
|
- name: install apache
|
|
yum:
|
|
name:
|
|
- httpd
|
|
- mod_ssl
|
|
state: installed
|
|
|
|
- name: config for stagiaire's site
|
|
template:
|
|
src: httpd/stage.conf.j2
|
|
dest: /etc/httpd/conf.d/stage.conf
|
|
notify: restart_httpd
|
|
|
|
- name: set right to home path for apache
|
|
file:
|
|
path: "/home/{{ item.key }}"
|
|
group: apache
|
|
mode: 0750
|
|
with_dict: "{{ stagiaires }}"
|
|
|
|
- name: create root apache directory
|
|
file:
|
|
path: /home/www/
|
|
state: directory
|
|
owner: apache
|
|
group: apache
|
|
|
|
- name: create folder in /var
|
|
file:
|
|
path: "{{ item }}"
|
|
state: directory
|
|
with_items:
|
|
- /var/www
|
|
- /var/www/html
|
|
- /var/www/html/intranet
|
|
|
|
- name: copy index.php
|
|
template:
|
|
src: httpd/index.php.j2
|
|
dest: "/var/www/html/intranet/index.php"
|
|
|
|
- name: copy file for default page
|
|
copy:
|
|
src: "httpd/{{ item }}"
|
|
dest: "/var/www/html/intranet/{{ item }}"
|
|
owner: apache
|
|
group: apache
|
|
with_items:
|
|
- vdg.css
|
|
- wlogo.gif
|
|
- logo_26.png
|
|
|
|
- name: config for sites www"
|
|
copy:
|
|
src: "httpd/{{ item }}"
|
|
dest: "/etc/httpd/conf.d/{{ item }}"
|
|
with_items:
|
|
- http-www.conf
|
|
- https-www.conf
|
|
- ssl.conf
|
|
|
|
- name: start and enable the httpd service
|
|
systemd_service:
|
|
state: started
|
|
name: httpd
|
|
enabled: true
|
|
|