solution
This commit is contained in:
42
apache.yml
42
apache.yml
@@ -1,42 +1,18 @@
|
||||
---
|
||||
- name: install apache via ansible playbook
|
||||
hosts: centos
|
||||
hosts: cibles
|
||||
|
||||
tasks:
|
||||
- name: install apache
|
||||
yum:
|
||||
name: httpd
|
||||
state: present
|
||||
- name: import OS Specific variables
|
||||
include_vars: "{{ ansible_distribution | lower }}.yml"
|
||||
|
||||
- name: conf httpd
|
||||
template:
|
||||
src: vhost.conf
|
||||
dest: /etc/httpd/conf.d/vhost.conf
|
||||
mode: 0640
|
||||
owner: root
|
||||
group: apache
|
||||
- name: install apache
|
||||
package:
|
||||
name: "{{ apache_package_name }}"
|
||||
state: present
|
||||
|
||||
- name: activate apache
|
||||
service:
|
||||
name: httpd
|
||||
name: "{{ apache_service_name }}"
|
||||
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
|
||||
state: started
|
||||
Reference in New Issue
Block a user