rajout apache.yml

This commit is contained in:
2021-03-16 21:54:21 +01:00
parent 20b3b4caa1
commit 2dd9eb923a

42
apache.yml Normal file
View File

@@ -0,0 +1,42 @@
---
- name: install apache via ansible playbook
hosts: centos
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
- name: activate apache
service:
name: httpd
enabled: yes
state: started
- name: open firewall port
firewalld:
service: http
permanent: yes
immediate: yes
state: enabled
ignore_errors: true
- name: create documentroot
file:
name: /var/www/html/example.org/
state: directory
- name: copy index file
template:
src: index.txt
dest: /var/www/html/example.org/index.html
mode: 0644