itamae-plugin-recipe-daddy 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/itamae/plugin/recipe/daddy/nginx/install.rb +123 -0
- data/lib/itamae/plugin/recipe/daddy/nginx/modules/nginx-rtmp-module.rb +13 -0
- data/lib/itamae/plugin/recipe/daddy/nginx/modules/passenger.rb +13 -0
- data/lib/itamae/plugin/recipe/daddy/nginx/nginx-1.13.12_sha256sum.txt +1 -0
- data/lib/itamae/plugin/recipe/daddy/nginx/nginx-1.13.5_sha256sum.txt +1 -0
- data/lib/itamae/plugin/recipe/daddy/nginx/nginx-1.13.9_sha256sum.txt +1 -0
- data/lib/itamae/plugin/recipe/daddy/nginx/nginx-1.14.0_sha256sum.txt +1 -0
- data/lib/itamae/plugin/recipe/daddy/nginx/templates/etc/nginx/conf.d/default.conf.erb +44 -0
- data/lib/itamae/plugin/recipe/daddy/nginx/templates/etc/nginx/nginx.conf.erb +11 -0
- data/lib/itamae/plugin/recipe/daddy/nginx/templates/etc/tmpfiles.d/passenger.conf.erb +1 -0
- data/lib/itamae/plugin/recipe/daddy/nginx/templates/lib/systemd/system/nginx.service.erb +15 -0
- data/lib/itamae_plugin_recipe_daddy/version.rb +19 -1
- metadata +13 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3858b7daba5155c731a7213933da0e7dc65f37523e28bbb29351f79d607da9b1
|
4
|
+
data.tar.gz: 25a7724f359586cd52347eeef09c0a8ada8dc22307c7ffd2996a69c2b4b6422f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2974f7d7dcb395fb974875701ee3b261a2d2a11c9463e57809176a9015e33f0218b256b615268390a256601157da6614e5351840fe8075d616c29fd97b20d1ef
|
7
|
+
data.tar.gz: 7027be10edbebffe03cf3d86f0109806a3a559e59aa6554f037f94f6a43c3d0aa64aa699c187a43a367b0ab1c667cae90b72b4dba5d6ed810a55ca7f09568f7b
|
data/Gemfile.lock
CHANGED
@@ -0,0 +1,123 @@
|
|
1
|
+
require 'daddy/itamae'
|
2
|
+
|
3
|
+
version = ENV['NGINX_VERSION'] || ItamaePluginRecipeDaddy::NGINX_VERSION
|
4
|
+
|
5
|
+
directory 'tmp'
|
6
|
+
|
7
|
+
# install destination
|
8
|
+
%w{
|
9
|
+
/opt/nginx
|
10
|
+
/opt/nginx/cache
|
11
|
+
/opt/nginx/shared
|
12
|
+
/opt/nginx/shared/logs
|
13
|
+
}.each do |name|
|
14
|
+
directory name do
|
15
|
+
user 'root'
|
16
|
+
owner 'root'
|
17
|
+
group 'root'
|
18
|
+
mode '755'
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
# nginx source
|
23
|
+
execute 'download nginx' do
|
24
|
+
cwd 'tmp'
|
25
|
+
command <<-EOF
|
26
|
+
wget https://nginx.org/download/nginx-#{version}.tar.gz
|
27
|
+
EOF
|
28
|
+
not_if "sha256sum -c #{::File.join(::File.dirname(__FILE__), "nginx-#{version}_sha256sum.txt")}"
|
29
|
+
end
|
30
|
+
|
31
|
+
# module sources
|
32
|
+
include_recipe 'modules/nginx-rtmp-module'
|
33
|
+
include_recipe 'modules/passenger'
|
34
|
+
|
35
|
+
# build
|
36
|
+
execute 'build nginx' do
|
37
|
+
cwd 'tmp'
|
38
|
+
command <<-EOF
|
39
|
+
rm -Rf nginx-#{version}/
|
40
|
+
tar zxf nginx-#{version}.tar.gz
|
41
|
+
pushd nginx-#{version}
|
42
|
+
sudo ./configure \
|
43
|
+
--prefix=/opt/nginx/nginx-#{version} \
|
44
|
+
--conf-path=/etc/nginx/nginx.conf \
|
45
|
+
--pid-path=/run/nginx.pid \
|
46
|
+
--with-http_ssl_module \
|
47
|
+
--add-dynamic-module=/opt/nginx-rtmp-module/v1.1.11 \
|
48
|
+
--add-dynamic-module=$(passenger-config --nginx-addon-dir)
|
49
|
+
sudo chown -R #{ENV['USER']}:#{ENV['USER']} ./
|
50
|
+
make
|
51
|
+
sudo make install
|
52
|
+
popd
|
53
|
+
EOF
|
54
|
+
not_if "test -e /opt/nginx/nginx-#{version}"
|
55
|
+
end
|
56
|
+
|
57
|
+
link 'current' do
|
58
|
+
user 'root'
|
59
|
+
cwd '/opt/nginx'
|
60
|
+
to "nginx-#{version}"
|
61
|
+
force true
|
62
|
+
end
|
63
|
+
|
64
|
+
template '/etc/nginx/nginx.conf' do
|
65
|
+
user 'root'
|
66
|
+
owner 'root'
|
67
|
+
group 'root'
|
68
|
+
mode '644'
|
69
|
+
end
|
70
|
+
|
71
|
+
%w{
|
72
|
+
/etc/nginx/conf.d
|
73
|
+
/var/run/passenger-instreg
|
74
|
+
}.each do |name|
|
75
|
+
directory name do
|
76
|
+
user 'root'
|
77
|
+
owner 'root'
|
78
|
+
group 'root'
|
79
|
+
mode '755'
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
case os_version
|
84
|
+
when /rhel-6\.(.*?)/
|
85
|
+
when /rhel-7\.(.*?)/
|
86
|
+
template '/etc/tmpfiles.d/passenger.conf' do
|
87
|
+
user 'root'
|
88
|
+
owner 'root'
|
89
|
+
group 'root'
|
90
|
+
mode '644'
|
91
|
+
variables :path => '/var/run/passenger-instreg',
|
92
|
+
:owner => 'root', :group => 'root', :mode => '0755'
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
template '/etc/nginx/conf.d/default.conf' do
|
97
|
+
user 'root'
|
98
|
+
owner 'root'
|
99
|
+
group 'root'
|
100
|
+
mode '644'
|
101
|
+
end
|
102
|
+
|
103
|
+
directory '/etc/nginx/conf.d/servers' do
|
104
|
+
user 'root'
|
105
|
+
owner 'root'
|
106
|
+
group 'root'
|
107
|
+
mode '755'
|
108
|
+
end
|
109
|
+
|
110
|
+
template '/lib/systemd/system/nginx.service' do
|
111
|
+
user 'root'
|
112
|
+
end
|
113
|
+
|
114
|
+
execute 'systemctl daemon-reload' do
|
115
|
+
user 'root'
|
116
|
+
subscribes :run, 'template[/lib/systemd/system/nginx.service]'
|
117
|
+
action :nothing
|
118
|
+
end
|
119
|
+
|
120
|
+
service 'nginx' do
|
121
|
+
user 'root'
|
122
|
+
action :enable
|
123
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
version = ENV['NGINX_RTMP_MODULE_VERSION'] || ItamaePluginRecipeDaddy::NGINX_RTMP_MODULE_VERSION
|
2
|
+
|
3
|
+
directory '/opt/nginx-rtmp-module' do
|
4
|
+
user 'root'
|
5
|
+
owner ENV['USER']
|
6
|
+
group ENV['USER']
|
7
|
+
mode '755'
|
8
|
+
end
|
9
|
+
|
10
|
+
git "/opt/nginx-rtmp-module/v#{version}" do
|
11
|
+
repository 'https://github.com/arut/nginx-rtmp-module.git'
|
12
|
+
revision "v#{version}"
|
13
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
version = ENV['PASSENGER_VERSION'] || ItamaePluginRecipeDaddy::PASSENGER_VERSION
|
2
|
+
nginx_version = ENV['NGINX_VERSION'] || ItamaePluginRecipeDaddy::NGINX_VERSION
|
3
|
+
|
4
|
+
gem_package 'passenger' do
|
5
|
+
user 'root'
|
6
|
+
version version
|
7
|
+
end
|
8
|
+
|
9
|
+
execute "rm -Rf /opt/nginx/nginx-#{nginx_version}" do
|
10
|
+
user 'root'
|
11
|
+
subscribes :run, 'gem_package[passenger]'
|
12
|
+
action :nothing
|
13
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
fb92f5602cdb8d3ab1ad47dbeca151b185d62eedb67d347bbe9d79c1438c85de nginx-1.13.12.tar.gz
|
@@ -0,0 +1 @@
|
|
1
|
+
0e75b94429b3f745377aeba3aff97da77bf2b03fcb9ff15b3bad9b038db29f2e nginx-1.13.5.tar.gz
|
@@ -0,0 +1 @@
|
|
1
|
+
5faea18857516fe68d30be39c3032bd22ed9cf85e1a6fdf32e3721d96ff7fa42 nginx-1.13.9.tar.gz
|
@@ -0,0 +1 @@
|
|
1
|
+
5d15becbf69aba1fe33f8d416d97edd95ea8919ea9ac519eff9bafebb6022cb5 nginx-1.14.0.tar.gz
|
@@ -0,0 +1,44 @@
|
|
1
|
+
http {
|
2
|
+
include mime.types;
|
3
|
+
default_type application/octet-stream;
|
4
|
+
ssl_protocols TLSv1.1 TLSv1.2;
|
5
|
+
|
6
|
+
log_format ltsv 'time:$time_local\t'
|
7
|
+
'msec:$msec\t'
|
8
|
+
'host:$remote_addr\t'
|
9
|
+
'forwardedfor:$http_x_forwarded_for\t'
|
10
|
+
'req:$request\t'
|
11
|
+
'method:$request_method\t'
|
12
|
+
'uri:$request_uri\t'
|
13
|
+
'status:$status\t'
|
14
|
+
'size:$body_bytes_sent\t'
|
15
|
+
'referer:$http_referer\t'
|
16
|
+
'ua:$http_user_agent\t'
|
17
|
+
'reqtime:$request_time\t'
|
18
|
+
'upsttime:$upstream_response_time\t'
|
19
|
+
'cache:$upstream_http_x_cache\t'
|
20
|
+
'runtime:$upstream_http_x_runtime\t'
|
21
|
+
'vhost:$host';
|
22
|
+
|
23
|
+
access_log /opt/nginx/shared/logs/access.log ltsv;
|
24
|
+
|
25
|
+
sendfile on;
|
26
|
+
#tcp_nopush on;
|
27
|
+
|
28
|
+
keepalive_timeout 65;
|
29
|
+
|
30
|
+
#gzip on;
|
31
|
+
|
32
|
+
proxy_cache_path /opt/nginx/cache levels=1:2 keys_zone=cache:512m inactive=1d max_size=60g;
|
33
|
+
|
34
|
+
passenger_root <%= `sudo passenger-config about root` %>;
|
35
|
+
passenger_instance_registry_dir /var/run/passenger-instreg;
|
36
|
+
|
37
|
+
server {
|
38
|
+
listen 80 default_server;
|
39
|
+
server_name _;
|
40
|
+
deny all;
|
41
|
+
}
|
42
|
+
|
43
|
+
include /etc/nginx/conf.d/servers/*.conf;
|
44
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
d <%= @path %> <%= @mode %> <%= @owner %> <%= @group %>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
[Unit]
|
2
|
+
Description=The NGINX HTTP and reverse proxy server
|
3
|
+
After=syslog.target network.target remote-fs.target nss-lookup.target
|
4
|
+
|
5
|
+
[Service]
|
6
|
+
Type=forking
|
7
|
+
PIDFile=/run/nginx.pid
|
8
|
+
ExecStartPre=/opt/nginx/current/sbin/nginx -t
|
9
|
+
ExecStart=/opt/nginx/current/sbin/nginx
|
10
|
+
ExecReload=/bin/kill -s HUP $MAINPID
|
11
|
+
ExecStop=/bin/kill -s QUIT $MAINPID
|
12
|
+
PrivateTmp=true
|
13
|
+
|
14
|
+
[Install]
|
15
|
+
WantedBy=multi-user.target
|
@@ -1,3 +1,21 @@
|
|
1
1
|
module ItamaePluginRecipeDaddy
|
2
|
-
VERSION = "0.1.
|
2
|
+
VERSION = "0.1.2"
|
3
|
+
|
4
|
+
NGINX_VERSION = [
|
5
|
+
NGINX_VERSION_MAJOR = '1',
|
6
|
+
NGINX_VERSION_MINOR = '14',
|
7
|
+
NGINX_VERSION_REVISION = '0'
|
8
|
+
].join('.')
|
9
|
+
|
10
|
+
NGINX_RTMP_MODULE_VERSION = [
|
11
|
+
NGINX_RTMP_MODULE_VERSION_MAJOR = '1',
|
12
|
+
NGINX_RTMP_MODULE_VERSION_MINOR = '2',
|
13
|
+
NGINX_RTMP_MODULE_VERSION_REVISION = '1'
|
14
|
+
].join('.')
|
15
|
+
|
16
|
+
PASSENGER_VERSION = [
|
17
|
+
PASSENGER_VERSION_MAJOR = '5',
|
18
|
+
PASSENGER_VERSION_MINOR = '3',
|
19
|
+
PASSENGER_VERSION_REVISION = '3'
|
20
|
+
].join('.')
|
3
21
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: itamae-plugin-recipe-daddy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ichy
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-07-
|
11
|
+
date: 2018-07-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -59,6 +59,17 @@ files:
|
|
59
59
|
- lib/itamae/plugin/recipe/daddy/mysql/install.rb
|
60
60
|
- lib/itamae/plugin/recipe/daddy/mysql/mysql_secure_installation.sh
|
61
61
|
- lib/itamae/plugin/recipe/daddy/mysql/templates/daddy.cnf.erb
|
62
|
+
- lib/itamae/plugin/recipe/daddy/nginx/install.rb
|
63
|
+
- lib/itamae/plugin/recipe/daddy/nginx/modules/nginx-rtmp-module.rb
|
64
|
+
- lib/itamae/plugin/recipe/daddy/nginx/modules/passenger.rb
|
65
|
+
- lib/itamae/plugin/recipe/daddy/nginx/nginx-1.13.12_sha256sum.txt
|
66
|
+
- lib/itamae/plugin/recipe/daddy/nginx/nginx-1.13.5_sha256sum.txt
|
67
|
+
- lib/itamae/plugin/recipe/daddy/nginx/nginx-1.13.9_sha256sum.txt
|
68
|
+
- lib/itamae/plugin/recipe/daddy/nginx/nginx-1.14.0_sha256sum.txt
|
69
|
+
- lib/itamae/plugin/recipe/daddy/nginx/templates/etc/nginx/conf.d/default.conf.erb
|
70
|
+
- lib/itamae/plugin/recipe/daddy/nginx/templates/etc/nginx/nginx.conf.erb
|
71
|
+
- lib/itamae/plugin/recipe/daddy/nginx/templates/etc/tmpfiles.d/passenger.conf.erb
|
72
|
+
- lib/itamae/plugin/recipe/daddy/nginx/templates/lib/systemd/system/nginx.service.erb
|
62
73
|
- lib/itamae/plugin/recipe/daddy/redis/install.rb
|
63
74
|
- lib/itamae_plugin_recipe_daddy/daddy.rb
|
64
75
|
- lib/itamae_plugin_recipe_daddy/version.rb
|