2
0
Files
SIB_Exercices/10_premier_playbook/apache.yml
2020-05-05 22:52:52 +02:00

47 lines
857 B
YAML

---
- name: install apache via ansible playbook
hosts: all
handlers:
- name: restart apache
service:
name: httpd
state: restarted
tasks:
- name: install apache
yum:
name: httpd
state: present
- name: conf httpd
template:
src: vhost.conf
dest: /etc/httpd/conf.d/vhost.conf
mode: 0640
owner: root
group: apache
notify: restart apache
- name: activate apache
service:
name: httpd
enabled: yes
state: started
- name: open firewall port
firewalld:
service: http
permanent: yes
immediate: yes
state: enabled
- name: create documentroot
file:
name: /var/www/html/orsys.fr
state: directory
- name: copy index file
copy:
src: index.html
dest: /var/www/html/orsys.fr/index.html
mode: 0644