我继承了一堆Puppet脚本,我正在更新它们。我的一个脚本是安装Python。我想将其安装到C:/bin/Python34
。但是,每次我运行Puppet脚本时,它都会安装到C:/Python34
。如果我手动运行安装程序,我会看到这是默认的安装位置,所以看起来我没有正确覆盖我脚本中的目录。
我的代码如下:
class python( $installer = 'python-3.4.2.msi' )
{
package
{
'Python3':
ensure => 'installed',
source => "\\\\myApp.server\\Python\\${installer}",
install_options => { 'INSTALLDIR' => 'C:\bin\Python34' },
}
}
不幸的是,在运行脚本时运行--debug
选项时似乎没有出现错误:
Debug: Prefetching windows resources for package
Debug: Executing 'msiexec.exe /qn /norestart /i \\myApp.server\Python\python-3.4.2.msi INSTALLDIR=C:\bin\Python34'
Notice: /Stage[main]/Python/Package[Python3]/ensure: created
Debug: /Package[Python3]: The container Class[Python] will propagate my refresh event
Debug: Class[Python]: The container Stage[main] will propagate my refresh event
Debug: Finishing transaction 53869152
Debug: Storing state
Debug: Stored state in 0.01 seconds
Notice: Finished catalog run in 39.22 seconds
Debug: Using settings: adding file resource 'rrddir': 'File[C:/ProgramData/PuppetLabs/puppet/var/rrd]{:path=>"C:/ProgramData/PuppetLabs/puppet/var/rrd", :mode=>"750", :ensure=>:directory, :loglevel=>:debug, :links=>:follow, :backup=>false}'
Debug: Finishing transaction 48943728
Debug: Received report to process from bgtmnwl-659gxw1.peroot.com
Debug: Processing report from bgtmnwl-659gxw1.peroot.com with processor Puppet::Reports::Store
此代码似乎适用于其他软件,但不适用于Python。我以管理员身份运行命令提示符。
Python的安装程序有什么不同吗?为什么Puppet不能为Python 3设置安装目录?
答案 0 :(得分:2)
Puppet使用Area area = new Area(poly1);
area.intersect(new Area(poly2));
return area.isEmpty();
安装python。要设置安装目录,请提供msiexec
而不是TARGETDIR
。请点击此链接以获取更多explanation。