0
我创建了一个类型和提供程序来检查程序是否已安装,如果不是,则运行msiexec。我在运行代理时的输出显示程序为'ensure = absent',但它不启动msi安装。任何人都可以看到我的代码有什么问题吗?自定义提供程序不会运行msiexec
事件查看器不显示MSI安装运行
我的自定义类型:
Puppet::Type.newtype(:custom) do
@doc = "Custom type"
ensurable
newparam(:name) do
desc "name of program."
end
newparam(:source) do
desc "The full path to the file."
end
end
我的供应商:
Puppet::Type.type(:custom).provide(:win) do
desc "."
def create
exec "msiexec.exe /i " + @resource[:source] + " /quiet"
end
def destroy
end
def exists?
begin
exec "puppet resource package " + @resource[:name]
rescue Puppet::ExecutionFailure => e
false
end
end
end
我的清单
class mod {
custom { 'AppNameHere':
ensure => present,
source => 'Q:\\app.msi',
}
}
此资源的相关代理程序调试输出是什么? –