问题:当我第一次运行 puppet 来配置 box 时,我会遇到依赖失败错误,并且带有这些错误 ( apache-solr-dataimporthandler-3.6.1.jar
) 的文件不会复制到它们的目标位置。但是,第二次进行配置时,不再存在依赖错误,并且所有文件似乎都已正确复制。
如何在不重新配置的情况下解决依赖错误?为什么会这样?
显现
file { '/var/lib/tomcat6/webapps/solr.war':
ensure => present,
owner => root,
group => root,
mode => 644,
source => 'puppet:///modules/solr/apache-solr-3.6.1.war',
notify => Service['tomcat'],
}
file { '/usr/share/solr':
ensure => present,
source => 'puppet:///modules/solr/solr',
recurse => true,
require => File['/var/lib/tomcat6/webapps/solr.war'],
notify => Service['tomcat'],
}
file { '/var/lib/tomcat6/webapps/solr/WEB-INF/web.xml':
ensure => present,
owner => root,
group => root,
mode => 644,
source => 'puppet:///modules/solr/web.xml',
require => [ File['/var/lib/tomcat6/webapps/solr.war'], File['/usr/share/solr'] ],
}
file { '/var/lib/tomcat6/webapps/solr/WEB-INF/lib/apache-solr-dataimporthandler-3.6.1.jar':
ensure => present,
owner => root,
group => root,
mode => 644,
source => 'puppet:///modules/solr/apache-solr-dataimporthandler-3.6.1.jar',
require => File['/var/lib/tomcat6/webapps/solr.war'],
notify => Service['tomcat'],
}
错误
←[0;36mnotice: /Stage[main]/Solr/File[/var/lib/tomcat6/webapps/solr.war]/ensure: defined content as'{md5}ae7997a401f9d223b097f8a88259689e'←[0m
←[1;35merr: /Stage[main]/Solr/File[/var/lib/tomcat6/webapps/solr/WEB-INF/lib/apache-solr-dataimporthandler-3.6.1.jar]/ensure: change from absent to file failed: Could not set 'file on ensure: No such file or directory - /var/lib/tomcat6/webapps/solr/WEB-INF/lib/apache-solr-dataimporthandler-3.6.1.jar.puppettmp_4049 at /tmp/vagrant-puppet/modules-0/solr/manifests/init.pp:37←[0m
←[0;36mnotice: /Stage[main]/Solr/File[/usr/share/solr]/ensure: created←[0m
...
...
...
←[0;36mnotice: /Stage[main]/Tomcat/Service[tomcat]: Dependency File[/var/lib/tomcat6/webapps/solr/WEB-INF/lib/apache-solr-dataimporthandler-3.6.1.jar] has failures: true←[0m
←[0;33mwarning: /Stage[main]/Tomcat/Service[tomcat]: Skipping because of failed dependencies←[0m
←[0;36mnotice: /Stage[main]/Tomcat/Service[tomcat]: Triggered 'refresh' from 6 events←[0m
←[0;36mnotice: /Stage[main]/Solr/File[/var/lib/tomcat6/webapps/solr/WEB-INF/web.xml]/content: content changed '{md5}1b3a494d9ddefb9bef08caa5146cfd32' to '{md5}f3b9d07f7585ef8008f2bcf0407596f2'←[0m
←[0;36mnotice: /Stage[main]/Solr/File[/var/lib/tomcat6/webapps/solr/WEB-INF/web.xml]/owner: owner changed 'tomcat6' to 'root'←[0m
←[0;36mnotice: /Stage[main]/Solr/File[/var/lib/tomcat6/webapps/solr/WEB-INF/web.xml]/group: group changed 'tomcat6' to 'root'←[0m
←[0;36mnotice: Finished catalog run in 18.90 seconds←[0m
目录结构