我在VirtualBox上安装了全新的CentOS 6.9。我安装了puppet-agent 5.4但在应用以下清单时收到错误:
augeas { "yum_exclude_test":
incl => '/etc/yum.conf',
lens => 'Yum.lns',
context => '/files/etc/yum.conf/main',
changes => "set exclude 'dog cat'"
}
我已经尝试了默认的/etc/yum.conf文件和一个空白文件。如果我更改"排除"关键是"排除"文件已正确更新,但对于"排除"关键,结果如下:
excludes=dog cat
但是,我看到了:
Debug: Augeas[yum_exclude_test](provider=augeas): sending command 'set' with params ["/files/etc/yum.conf/main/exclude", "dog cat"]
Debug: Augeas[yum_exclude_test](provider=augeas): Put failed on one or more files, output from /augeas//error:
Debug: Augeas[yum_exclude_test](provider=augeas): /augeas/files/etc/yum.conf/error = put_failed
Debug: Augeas[yum_exclude_test](provider=augeas): /augeas/files/etc/yum.conf/error/path = /files/etc/yum.conf/files/etc/yum.conf/main
Debug: Augeas[yum_exclude_test](provider=augeas): /augeas/files/etc/yum.conf/error/lens = /opt/puppetlabs/puppet/share/augeas/lenses/dist/yum.aug:43.20-.35:
Debug: Augeas[yum_exclude_test](provider=augeas): /augeas/files/etc/yum.conf/error/message = Failed to match tree under /files/etc/yum.conf/main
{ "cachedir" = "/var/cache/yum/$basearch/$releasever" }
{ "keepcache" = "0" }
{ "debuglevel" = "2" }
{ "logfile" = "/var/log/yum.log" }
{ "exactarch" = "1" }
{ "obsoletes" = "1" }
{ "gpgcheck" = "1" }
{ "plugins" = "1" }
{ "installonly_limit" = "5" }
{ "bugtracker_url" = "http://bugs.centos.org/set_project.php?project_id=19&ref=http://bugs.centos.org/bug_report_page.php?category=yum" }
{ "distroverpkg" = "centos-release" }
{ }
{ "#comment" = "This is the default, if you make this bigger yum won't see if the metadata" }
{ "#comment" = "is newer on the remote and so you'll "gain" the bandwidth of not having to" }
{ "#comment" = "download the new metadata and "pay" for it by yum not having correct" }
{ "#comment" = "information." }
{ "#comment" = "It is esp. important, to have correct metadata, for distributions like" }
{ "#comment" = "Fedora which don't keep old packages around. If you don't like this checking" }
{ "#comment" = "interupting your command line usage, it's much better to have something" }
{ "#comment" = "manually check the metadata once an hour (yum-updatesd will do this)." }
{ "#comment" = "metadata_expire=90m" }
{ }
{ "#comment" = "PUT YOUR REPOS HERE OR IN separate files named file.repo" }
{ "#comment" = "in /etc/yum.repos.d" }
{ "exclude" = "dog cat" }
with pattern
{ /baseur((l[.0-9A-Z_a-z-]|[.0-9A-Z_a-km-z-])[.0-9A-Z_a-z-]*|)|baseu([.0-9A-Z_a-qs-z-][.0-9A-Z_a-z-]*|)|base([.0-9A-Z_a-tv-z-][.0-9A-Z_a-z-]*|)|bas([.0-9A-Z_a-df-z-][.0-9A-Z_a-z-]*|)|ba([.0-9A-Z_a-rt-z-][.0-9A-Z_a-z-]*|)|exclud((e[.0-9A-Z_a-z-]|[.0-9A-Z_a-df-z-])[.0-9A-Z_a-z-]*|)|exclu([.0-9A-Z_a-ce-z-][.0-9A-Z_a-z-]*|)|excl([.0-9A-Z_a-tv-z-][.0-9A-Z_a-z-]*|)|exc([.0-9A-Z_a-km-z-][.0-9A-Z_a-z-]*|)|ex([.0-9A-Z_abd-z-][.0-9A-Z_a-z-]*|)|gpgke((y[.0-9A-Z_a-z-]|[.0-9A-Z_a-xz-])[.0-9A-Z_a-z-]*|)|gpgk([.0-9A-Z_a-df-z-][.0-9A-Z_a-z-]*|)|gpg([.0-9A-Z_a-jl-z-][.0-9A-Z_a-z-]*|)|gp([.0-9A-Z_a-fh-z-][.0-9A-Z_a-z-]*|)|(g[.0-9A-Z_a-oq-z-]|e[.0-9A-Z_a-wyz-]|b[.0-9A-Z_b-z-]|[A-Zacdfh-z][.0-9A-Z_a-z-])[.0-9A-Z_a-z-]*|g|e|b|[A-Zacdfh-z]/ = /((([^\t\n\r "#;](([^\n\r#;]+)*[^\t\n\r "#;])?)))?/ }
| { /baseur((l[.0-9A-Z_a-z-]|[.0-9A-Z_a-km-z-])[.0-9A-Z_a-z-]*|)|baseu([.0-9A-Z_a-qs-z-][.0-9A-Z_a-z-]*|)|base([.0-9A-Z_a-tv-z-][.0-9A-Z_a-z-]*|)|bas([.0-9A-Z_a-df-z-][.0-9A-Z_a-z-]*|)|ba([.0-9A-Z_a-rt-z-][.0-9A-Z_a-z-]*|)|exclud((e[.0-9A-Z_a-z-]|[.0-9A-Z_a-df-z-])[.0-9A-Z_a-z-]*|)|exclu([.0-9A-Z_a-ce-z-][.0-9A-Z_a-z-]*|)|excl([.0-9A-Z_a-tv-z-][.0-9A-Z_a-z-]*|)|exc([.0-9A-Z_a-km-z-][.0-9A-Z_a-z-]*|)|ex([.0-9A-Z_abd-z-][.0-9A-Z_a-z-]*|)|gpgke((y[.0-9A-Z_a-z-]|[.0-9A-Z_a-xz-])[.0-9A-Z_a-z-]*|)|gpgk([.0-9A-Z_a-df-z-][.0-9A-Z_a-z-]*|)|gpg([.0-9A-Z_a-jl-z-][.0-9A-Z_a-z-]*|)|gp([.0-9A-Z_a-fh-z-][.0-9A-Z_a-z-]*|)|(g[.0-9A-Z_a-oq-z-]|e[.0-9A-Z_a-wyz-]|b[.0-9A-Z_b-z-]|[A-Zacdfh-z][.0-9A-Z_a-z-])[.0-9A-Z_a-z-]*|g|e|b|[A-Zacdfh-z]/ = /([^\n\r"]*[#;]+[^\n\r"]*)/ }
| { /#comment/ = /[^\t\n\r ].*[^\t\n\r ]|[^\t\n\r ]/ }
| { })*
(the regex goes on for pages)
Debug: Augeas[yum_exclude_test](provider=augeas): Closed the augeas connection
Error: /Stage[main]/Main/Augeas[yum_exclude_test]: Could not evaluate: Saving failed, see debug
Debug: Class[Main]: Resource is being skipped, unscheduling all events
Debug: Stage[main]: Resource is being skipped, unscheduling all events
默认yum.conf:
[root@centos-test ~]# cat /etc/yum.conf
[main]
cachedir=/var/cache/yum/$basearch/$releasever
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
installonly_limit=5
bugtracker_url=http://bugs.centos.org/set_project.php?project_id=19&ref=http://bugs.centos.org/bug_report_page.php?category=yum
distroverpkg=centos-release
# This is the default, if you make this bigger yum won't see if the metadata
# is newer on the remote and so you'll "gain" the bandwidth of not having to
# download the new metadata and "pay" for it by yum not having correct
# information.
# It is esp. important, to have correct metadata, for distributions like
# Fedora which don't keep old packages around. If you don't like this checking
# interupting your command line usage, it's much better to have something
# manually check the metadata once an hour (yum-updatesd will do this).
# metadata_expire=90m
# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d
有人知道问题是什么吗?
由于