简体   繁体   中英

How to add install option to package in Puppet manifest

For the last two days I tried to install just two modules for Nginx on a Debian 7 x64 virtual machine, created with Vagrant . For now I have this manifest:

package { 'nginx':
  ensure => 'present',
  install_options => [ '--with-http_secure_link_module', '--with-http_image_filter_module' ],
}

include '::apt'

apt::source { 'nginx':
  location   => "http://nginx.org/packages/debian",
  repos      => 'nginx',
  key        => '7BD9BF62',
  key_source => 'http://nginx.org/keys/nginx_signing.key',
  before     => Package['nginx'],
}

#import 'nodes/*.pp'

After I run vagrant provision , I get into VM through ssh with vagrant ssh , and this is what I see:

vagrant@packer-virtualbox-iso:~$ sudo nginx -V

nginx version: nginx/1.6.2
built by gcc 4.7.2 (Debian 4.7.2-5) 
TLS SNI support enabled
configure arguments: 
--prefix=/etc/nginx 
--sbin-path=/usr/sbin/nginx 
--conf-path=/etc/nginx/nginx.conf
--error-log-path=/var/log/nginx/error.log  
--http-log-path=/var/log/nginx/access.log
--pid-path=/var/run/nginx.pid  
--lock-path=/var/run/nginx.lock  
--http-client-body-temp-path=/var/cache/nginx/client_temp  
--http-proxy-temp-path=/var/cache/nginx/proxy_temp  
--http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp  
--http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp  
--http-scgi-temp-path=/var/cache/nginx/scgi_temp  
--user=nginx
--group=nginx
--with-http_ssl_module
--with-http_realip_module  
--with-http_addition_module
--with-http_sub_module
--with-http_dav_module  
--with-http_flv_module
--with-http_mp4_module
--with-http_gunzip_module  
--with-http_gzip_static_module
--with-http_random_index_module  
--with-http_secure_link_module
--with-http_stub_status_module  
--with-http_auth_request_module
--with-mail
--with-mail_ssl_module
--with-file-aio
--with-http_spdy_module
--with-cc-opt='-g -O2 -fstack-protector
--param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2' 
--with-ld-opt='-Wl,-z,relro -Wl,--as-needed'
--with-ipv6**

image_filter module had not installed, but secure_link is ok ( I think it's ok because it was installed by default).

So what am I doing wrong?

As Felix mentioned, the package resource in Puppet is not for compiling packages, it's for managing installing and uninstalling packages.

If you want to compile an nginx Debian package specific options or additions, I recommend using fpm-cookery . There's an example nginx recipe that might be useful for you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM