initial commit
This commit is contained in:
43
10_premier_playbook/apache.yml
Normal file
43
10_premier_playbook/apache.yml
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
---
|
||||||
|
- name: install apache via ansible playbook
|
||||||
|
hosts: test
|
||||||
|
become: false
|
||||||
|
user: root
|
||||||
|
tasks:
|
||||||
|
- name: install apache
|
||||||
|
yum:
|
||||||
|
name: httpd
|
||||||
|
state: latest
|
||||||
|
|
||||||
|
- 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: restarted
|
||||||
|
|
||||||
|
- name: open firewall port
|
||||||
|
tags: dev
|
||||||
|
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
|
||||||
1
10_premier_playbook/index.html
Normal file
1
10_premier_playbook/index.html
Normal file
@@ -0,0 +1 @@
|
|||||||
|
test
|
||||||
17
10_premier_playbook/vhost.conf
Normal file
17
10_premier_playbook/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