-
Notifications
You must be signed in to change notification settings - Fork 0
/
webserver.sls
71 lines (65 loc) · 1.67 KB
/
webserver.sls
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
httpd: # ID Declaration
pkg: # State Declaration
- name: httpd
- installed
service.running:
- name: httpd
- require:
- pkg: httpd
/var/www/html/minionid:
file:
- directory
- name: /var/www/html/{{ grains['id'] }}.com
- makedirs: True
- user: root
- group: root
- dir_mode: 755
- file_mode: 644
- recurse:
- user
- group
- mode
- require:
- pkg: httpd
/var/www/index.html: # ID declaration
file: # state declaration
- managed # function
- source: salt://webserver/index.html # function arg
- require: # requisite declaration
- pkg: httpd # requisite refernce
/var/log/httpd/minionid:
file:
- directory
- name: /var/log/httpd/{{ grains['id'] }}.com
- makedirs: True
- user: root
- group: root
- dir_mode: 755
- file_mode: 644
- recurse:
- user
- group
- mode
- require:
- pkg: httpd
/var/www/html/minionid/index:
file:
- copy
- name: /var/www/html/{{ grains['id'] }}.com
- source: /tmp/index.html
- require:
- pkg: httpd
/etc/httpd/confd/vhost:
file:
- copy
- name: /etc/httpd/conf.d/
- source: /tmp/vhost.conf
- require:
- pkg: httpd
restart/if/vhost.conf/file/changed:
cmd.run:
- name: systemctl restart httpd.service
- unless: which httpd
- require:
- pkg: httpd
- reload_modules: True