initial commit
This commit is contained in:
38
apache.yml
Normal file
38
apache.yml
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
---
|
||||||
|
- name: install apache via ansible playbook
|
||||||
|
hosts: test
|
||||||
|
user: ansible
|
||||||
|
become: true
|
||||||
|
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
|
||||||
|
firewalld:
|
||||||
|
service: http
|
||||||
|
permanent: yes
|
||||||
|
immediate: yes
|
||||||
|
state: enabled
|
||||||
|
ignore_errors: yes
|
||||||
|
- name: create documentroot
|
||||||
|
file:
|
||||||
|
name: /var/www/html/orsys.fr
|
||||||
|
state: directory
|
||||||
|
- name: create index file
|
||||||
|
copy:
|
||||||
|
src: index.html
|
||||||
|
dest: /var/www/html/orsys.fr/index.html
|
||||||
|
mode: 0644
|
||||||
Reference in New Issue
Block a user