简体   繁体   English

如何在Puppet清单中的软件包中添加安装选项

[英]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 . 在过去的两天内,我尝试在由Vagrant创建的Debian 7 x64虚拟机上仅为Nginx安装两个模块。 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 provision ,我使用vagrant ssh通过ssh进入VM,这是我看到的内容:

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). image_filter模块尚未安装,但是secure_link可以(我认为可以,因为默认情况下已安装)。

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. 正如Felix提到的,Puppet中的package资源不是用于编译软件包,而是用于管理安装和卸载软件包。

If you want to compile an nginx Debian package specific options or additions, I recommend using fpm-cookery . 如果要编译特定于nginx Debian软件包的选项或添加项,建议使用fpm-cookery There's an example nginx recipe that might be useful for you. 有一个示例nginx配方可能对您有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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