-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathweb.yaml
More file actions
57 lines (39 loc) · 1.16 KB
/
web.yaml
File metadata and controls
57 lines (39 loc) · 1.16 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
---
- hosts: webservers
sudo: yes
vars:
http_port: 80
doc_dir: /ansible/
doc_root: /var/www/html/ansible/
max_clients: 5
ansible_python_interpreter: python
vars_prompt:
- name: username
prompt: What is your name?
tasks:
- name: Ensure libselinux-python installed
yum: name=libselinux-python state=present
- name: Ensure Apache installed
yum: name=httpd state=present
when: ansible_os_family == "RedHat"
- name: Creates directoy
file: path=/var/www/html/ansible state=directory
- name: Ensure Apache installed
yum: name=httpd state=present
when: ansible_os_family == "RedHat"
- name: Ensure Apache is running
service: name=httpd enabled=yes state=started
- name: Deploy configuration File
template: src=templates/httpd.j2 dest=/etc/httpd/conf/httpd.conf
notify:
- Restart Apache
- name: Copy Site Files
template: src=templates/index.j2 dest={{doc_root}}/index.html mode=0644
handlers:
- name: Restart Apache
service: name=httpd state=restarted
- hosts: webservers
sudo: yes
tasks:
- name: Stop IPTABLES Now!!
service: name=iptables state=stopped