This commit is contained in:
2021-05-06 17:09:54 +02:00
parent 58cf32df4b
commit ef0d236d19

View File

@@ -1,62 +0,0 @@
---
- 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
tags: apache
tasks:
- name: install apache
yum:
name: httpd
state: latest
- name: conf httpd
notify: reload 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
- name: open firewall port
tags: firewall
firewalld:
service: http
permanent: yes
immediate: yes
state: enabled
ignore_errors: yes
notify: reload firewalld
- name: create documentroot
tags:
- docroot
file:
name: /var/www/html/orsys.fr
state: directory
- name: create index file
tags:
- docroot
copy:
src: index.html
dest: /var/www/html/orsys.fr/index.html
mode: 0644