-
Notifications
You must be signed in to change notification settings - Fork 11
/
apache.yml
41 lines (40 loc) · 819 Bytes
/
apache.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
---
- hosts: webservers
become: True
vars_files:
- ./vars/vars.yml
tasks:
- debug:
msg: "{{apache_port}}"
- name: Install apache server
yum:
name: httpd
state: present
tags:
- install
- name: configure httpd port
template:
src: ./templates/httpd.conf.j2
dest: /etc/httpd/conf/httpd.conf
notify:
- Restart Apache
tags:
- configure
- name: Start and enable apache
service:
name: httpd
state: started
enabled: True
tags:
- start
- name: Deploy web application
copy:
src: index.html
dest: /var/www/html/
tags:
- deploy
handlers:
- name: Restart Apache
service:
name: httpd
state: restarted