forked from devopscloudsre/abc.com
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapache.rb
More file actions
41 lines (34 loc) · 829 Bytes
/
apache.rb
File metadata and controls
41 lines (34 loc) · 829 Bytes
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
#Install apache - package
package 'Install Apache' do
case node[:platform]
when 'redhat', 'centos'
package_name 'httpd'
when 'ubuntu', 'debian'
package_name 'apache2'
end
end
#Create a New Doc root - /var/www/html/abc.com - directory
directory '/var/www/html/abc.com' do
owner 'root'
group 'root'
mode '0755'
action :create
recursive true
end
#copy the code from git dev branch to New Doc root - git
git '/var/www/html/abc.com' do
repository 'https://github.com/mailrahulsre/abc.com.git'
revision 'dev'
action :sync
end
#change httpd.conf
remote_file '/etc/httpd/conf/httpd.conf' do
source 'file:///var/www/html/abc.com/httpd.conf'
mode '0755'
owner 'root'
group 'root'
end
#restart and Enable the apache - service
service 'httpd' do
action [ :enable, :start, :reload ]
end