-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinit.sls
45 lines (40 loc) · 1013 Bytes
/
init.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
Apache Installation:
pkg.installed:
- name: httpd
- refresh:
/etc/httpd/conf.d/myweb.com.conf:
apache.configfile:
- config:
- VirtualHost:
this: '*:80'
ServerName:
- {{ pillar['domainname'] }}
ServerAlias:
- {{ pillar['aliasname'] }}
DocumentRoot: /var/www/html/myweb/
Starting the apache service:
service.running:
- name: httpd
- enable: True
Creating the DocumentRoot:
file.directory:
- name: /var/www/html/myweb/
- user: apache
- group: apache
- mode: 755
- makedirs: True
Deploying the Website:
file.managed:
- name: /var/www/html/myweb/index.html
- source: salt://webdeployer/files/myweb/index.html
- user: apache
- group: apache
- create: True
Adding the daily cron file to check apache updates:
file.managed:
- name: /etc/cron.daily/apache.cron
- source: salt://webdeployer/files/apache.cron
- user: root
- group: root
- create: True
- mode: 755