看代码,有几个问题。
一是您在 Travis 中使用的环境变量没有设置 Puppet 版本。您需要将该代码添加到您的spec_helper_acceptance.rb
:
hosts.each do |host|
install_puppet_on(host,
:puppet => ENV['PUPPET_VERSION'] || '4.3.2',
)
end
现在它仍在安装 Puppet 3.8(默认最新)
有关在 Travis 中实际导致问题的原因的更多信息,我分叉了您的存储库并进行了构建,其中启用了烧杯的调试和跟踪选项:
result = apply_manifest(pp, :trace => true, :debug => true)
由此,查看 Travis 构建,git clone exec 存在问题:
Debug: Exec[clone-repo](provider=posix): Executing 'git clone https://github.com/fiuba/alfred.git /var/www/alfred'
Debug: Executing 'git clone https://github.com/fiuba/alfred.git /var/www/alfred'
Notice: /Stage[main]/Alfred::App/Exec[clone-repo]/returns: fatal: Could not change back to '/root': Permission denied
Error: git clone https://github.com/fiuba/alfred.git /var/www/alfred returned 128 instead of one of [0]
您可以通过使用该vcsrepo
模块来解决此问题,该模块以更幂等的方式执行 git 克隆:
vcsrepo { '/var/www/alfred':
ensure => present,
source => 'https://github.com/fiuba/alfred.git',
provider => git,
user => 'deployer',
}
还有一些其他修复,我正在对您的模块进行一些修复以修复它们,并且会在您查看和合并后在 Stack Overflow 答案中添加一个摘要,因为有些是使用几种不同方法的重要重构。