2
0
Files
SIB_Exercices/17.1_variable/myapache/tasks/main.yml

39 lines
710 B
YAML

---
# tasks file for myapache
- name: install apache
yum:
name: httpd
state: latest
- name: conf httpd
notify: reload httpd
template:
src: vhost.conf.jj
dest: /etc/httpd/conf.d/vhost_{{ servername }}.conf
mode: 0640
owner: root
group: apache
- name: activate apache
service:
name: httpd
enabled: yes
- name: open firewall port
firewalld:
service: http
permanent: yes
immediate: yes
state: enabled
ignore_errors: yes
notify: reload firewalld
- name: create documentroot
file:
name: "{{ documentroot }}"
state: directory
- name: create index file
copy:
src: index.html
dest: "{{ documentroot }}/index.html"
mode: 0644