Module: Itamae::Plugin::Recipe::Openresty
- Defined in:
- lib/itamae/plugin/recipe/openresty.rb,
lib/itamae/plugin/recipe/openresty/version.rb
Constant Summary collapse
- DEFAULT_VERSION =
'1.7.4.1'.freeze
- DEFAULT_PACKAGES =
{ ubuntu: [ 'perl', 'make', 'wget', 'libreadline-dev', 'libssl-dev', 'libpcre3-dev', 'libncurses5-dev', ], centos: [ 'make', 'wget', 'readline-devel', 'openssl-devel', 'pcre-devel,' ] }.freeze
- DEFAULT_CONFIGURE_FLAGS =
{ 'prefix' => '/opt', 'with-lua51' => nil, 'with-luajit' => nil, 'with-pcre-jit' => nil, 'with-http_gzip_static_module' => nil, 'user' => 'nginx', 'group' => 'nginx', }.freeze
- DEFAULT_INIT_SCRIPT_PATH =
'/etc/init.d/openresty'
- BUILD_WORKING_DIR =
'/tmp/openresty'
- VERSION =
"0.0.1"
Class Method Summary collapse
- .extract_configure_flags(options) ⇒ Object
- .extract_init_script_options(node) ⇒ Object
- .extract_metadata(node) ⇒ Object
- .sbin_path(node) ⇒ Object
Class Method Details
.extract_configure_flags(options) ⇒ Object
55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/itamae/plugin/recipe/openresty.rb', line 55 def self.extract_configure_flags() if .nil? = DEFAULT_CONFIGURE_FLAGS.dup end .map do |key, value| if value.nil? "--#{key}" else "--#{key}=#{value}" end end end |
.extract_init_script_options(node) ⇒ Object
69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/itamae/plugin/recipe/openresty.rb', line 69 def self.(node) raw = node['openresty'] || {} configure_flags = raw['configure_flags'] || DEFAULT_CONFIGURE_FLAGS { prefix: configure_flags['configure_flags'] || DEFAULT_CONFIGURE_FLAGS['prefix'], sbin_path: self.sbin_path(node), config_path: configure_flags['config-path'] || DEFAULT_CONFIGURE_FLAGS['prefix'] + '/nginx/conf/nginx.conf', pid_path: configure_flags['pid-path'] || DEFAULT_CONFIGURE_FLAGS['prefix'] + '/nginx/logs/nginx.pid', init_script_path: raw['init_script_path'] || DEFAULT_INIT_SCRIPT_PATH } end |
.extract_metadata(node) ⇒ Object
42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/itamae/plugin/recipe/openresty.rb', line 42 def self.(node) raw = node['openresty'] || {} = {} [:version] = raw['version'] || DEFAULT_VERSION [:archive_url] = raw['archive_url'] || "http://openresty.org/download/ngx_openresty-#{[:version]}.tar.gz" [:work_dir] = raw['work_dir'] || BUILD_WORKING_DIR [:configure_flags] = self.extract_configure_flags(raw['configure_flags']) [:install_depends_package] = raw['install_depends_package'] || true end |
.sbin_path(node) ⇒ Object
81 82 83 84 85 |
# File 'lib/itamae/plugin/recipe/openresty.rb', line 81 def self.sbin_path(node) raw = node['openresty'] || {} configure_flags = raw['configure_flags'] || DEFAULT_CONFIGURE_FLAGS configure_flags['sbin-path'] || DEFAULT_CONFIGURE_FLAGS['prefix'] + '/nginx/sbin/nginx' end |