initial commit
This commit is contained in:
61
apache.yml
Normal file
61
apache.yml
Normal file
@@ -0,0 +1,61 @@
|
||||
---
|
||||
- name: install apache via ansible playbook
|
||||
hosts: test
|
||||
user: ansible
|
||||
become: true
|
||||
handlers:
|
||||
- name: reload httpd
|
||||
service:
|
||||
name: httpd
|
||||
state: reloaded
|
||||
|
||||
- name: reload firewalld
|
||||
service:
|
||||
name: firewalld
|
||||
state: reloaded
|
||||
|
||||
tasks:
|
||||
- name: install apache
|
||||
tags: httpd
|
||||
yum:
|
||||
name: httpd
|
||||
state: latest
|
||||
|
||||
- name: conf httpd
|
||||
tags: httpd
|
||||
notify: reload httpd
|
||||
template:
|
||||
src: vhost.conf
|
||||
dest: /etc/httpd/conf.d/vhost.conf
|
||||
mode: 0640
|
||||
owner: root
|
||||
group: apache
|
||||
|
||||
- name: activate apache
|
||||
tags: httpd
|
||||
service:
|
||||
name: httpd
|
||||
enabled: yes
|
||||
|
||||
- name: open firewall port
|
||||
tags: [firewall,httpd]
|
||||
firewalld:
|
||||
service: http
|
||||
permanent: yes
|
||||
immediate: yes
|
||||
state: enabled
|
||||
ignore_errors: yes
|
||||
notify: reload firewalld
|
||||
|
||||
- name: create documentroot
|
||||
tags: httpd
|
||||
file:
|
||||
name: /var/www/html/orsys.fr
|
||||
state: directory
|
||||
|
||||
- name: create index file
|
||||
tags: httpd
|
||||
copy:
|
||||
src: index.html
|
||||
dest: /var/www/html/orsys.fr/index.html
|
||||
mode: 0644
|
||||
1
index.html
Normal file
1
index.html
Normal file
@@ -0,0 +1 @@
|
||||
test
|
||||
17
vhost.conf
Normal file
17
vhost.conf
Normal file
@@ -0,0 +1,17 @@
|
||||
<VirtualHost *:80>
|
||||
ServerName orsys.fr
|
||||
ServerAlias www.orsys.fr
|
||||
ServerAlias 100.0.0.100
|
||||
DocumentRoot /var/www/html/orsys.fr/
|
||||
CustomLog /var/log/httpd/orsys.fr_access.log combined
|
||||
ErrorLog /var/log/httpd/orsys.fr_error.log
|
||||
<Directory />
|
||||
Options none
|
||||
Allowoverride none
|
||||
Require all denied
|
||||
</Directory>
|
||||
|
||||
<Directory /var/www/html/orsys.fr>
|
||||
Require all granted
|
||||
</Directory>
|
||||
</VirtualHost>
|
||||
Reference in New Issue
Block a user