2015-10-21 10:56:45 +00:00
|
|
|
# install repositories for nginx
|
2019-06-11 22:24:35 +00:00
|
|
|
case node["platform"]
|
|
|
|
when "ubuntu"
|
2015-10-21 10:56:45 +00:00
|
|
|
# if ubuntu, install
|
2019-06-11 22:24:35 +00:00
|
|
|
apt_repository "nginx-php" do
|
|
|
|
uri "ppa:nginx/stable"
|
|
|
|
distribution node["lsb"]["codename"]
|
2015-10-21 10:56:45 +00:00
|
|
|
end
|
2019-06-11 22:24:35 +00:00
|
|
|
when "centos"
|
2015-10-21 10:56:45 +00:00
|
|
|
# add repo for Centos 7
|
2019-06-11 22:24:35 +00:00
|
|
|
yum_repository "nginx" do
|
|
|
|
description "Nginx Repo"
|
|
|
|
baseurl "http://nginx.org/packages/centos/7/x86_64"
|
|
|
|
gpgkey "http://nginx.org/keys/nginx_signing.key"
|
2015-10-21 10:56:45 +00:00
|
|
|
action :create
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
# install nginx package
|
2019-06-11 22:24:35 +00:00
|
|
|
package "nginx"
|
2015-10-21 10:56:45 +00:00
|
|
|
|
|
|
|
# start the service
|
2019-06-11 22:24:35 +00:00
|
|
|
service "nginx" do
|
2015-10-21 10:56:45 +00:00
|
|
|
action :start
|
|
|
|
end
|