augtool/augeas doesn't work in f17?

174 views
Skip to first unread message

Bret Wortman

unread,
Dec 7, 2012, 6:56:27 AM12/7/12
to puppet...@googlegroups.com
I've installed the augeas rpm (0.10.0-3.fc17.x86_64) to troubleshoot a problem I was having with augeas and ensuring a line existed in /etc/cron.allow. I think something's up because neither the augeas within my manifest nor the augtool are accomplishing much of anything:

# augtool print /files/etc/hosts/
# augtool ls /files/etc/hosts/
#

Even in interactive mode, I get nothing out of augtool! What should I look at to see why this is failing? Syslog doesn't show anything illustrative, nor did puppet agent -t --debug.

Raphink

unread,
Dec 10, 2012, 7:55:41 AM12/10/12
to puppet...@googlegroups.com

Hi Bret,

Check if there is a parse error in /augeas//error with

    print /augeas//error
 

Cheers,

Raphaël

Dominic Cleal

unread,
Dec 10, 2012, 8:34:17 AM12/10/12
to puppet...@googlegroups.com
On 07/12/12 11:56, Bret Wortman wrote:
> Even in interactive mode, I get nothing out of augtool! What should I
> look at to see why this is failing? Syslog doesn't show anything
> illustrative, nor did puppet agent -t --debug.

The lack of errors from the augeas resource type should be much improved
now if you're able to use Puppet 3.

I've added debug if there are parsing errors (which will print output
equivalent to Rapha�l's augtool suggestion) and warnings if you're using
context/incl parameters and it finds an error on a file you're trying to
modify.

--
Dominic Cleal
Red Hat Engineering

Bret Wortman

unread,
Dec 10, 2012, 1:51:46 PM12/10/12
to puppet...@googlegroups.com, dcl...@redhat.com
On Monday, December 10, 2012 8:34:17 AM UTC-5, Dominic Cleal wrote:
On 07/12/12 11:56, Bret Wortman wrote:
> Even in interactive mode, I get nothing out of augtool! What should I
> look at to see why this is failing? Syslog doesn't show anything
> illustrative, nor did puppet agent -t --debug.

The lack of errors from the augeas resource type should be much improved
now if you're able to use Puppet 3.

I am using Puppet 3 -- 3.0.1-1, to be precise. In response to Raphael's suggestion, I'm able to find some errors and can work through those.

Where should these be printing to from Puppet?


I've added debug if there are parsing errors (which will print output
equivalent to Rapha�l's augtool suggestion) and warnings if you're using

Bret Wortman

unread,
Dec 10, 2012, 1:59:08 PM12/10/12
to puppet...@googlegroups.com, dcl...@redhat.com
On Monday, December 10, 2012 1:51:46 PM UTC-5, Bret Wortman wrote:
On Monday, December 10, 2012 8:34:17 AM UTC-5, Dominic Cleal wrote:
On 07/12/12 11:56, Bret Wortman wrote:
> Even in interactive mode, I get nothing out of augtool! What should I
> look at to see why this is failing? Syslog doesn't show anything
> illustrative, nor did puppet agent -t --debug.

The lack of errors from the augeas resource type should be much improved
now if you're able to use Puppet 3.

I am using Puppet 3 -- 3.0.1-1, to be precise. In response to Raphael's suggestion, I'm able to find some errors and can work through those.

I spoke too soon. The specific file I'm trying to work with is /etc/cron.allow. When I try to parse it:

augtool> ls /files/etc/cron.allow
augtool> print /augeas//error
/augesa/files/etc/hosts/error = "parse_failed"
/augeas/files/etc/hosts/error/pos = "18473"
/augeas/files/etc/hosts/error/line = "273"
/augeas/files/etc/hosts/error/char = "0"
/augeas/files/etc/hsots/error/lens = "/usr/share/augeas/lenses/dist/hosts.aug:23.12-.42:"
/augeas/files/etc/hsots/error/message = "Iterated lens matched less than it should"

It doesn't look like the error is getting updated, or am I misunderstanding something?

Dominic Cleal

unread,
Dec 10, 2012, 2:12:34 PM12/10/12
to Bret Wortman, puppet...@googlegroups.com
On 10/12/12 18:59, Bret Wortman wrote:
> On Monday, December 10, 2012 1:51:46 PM UTC-5, Bret Wortman wrote:
>
> On Monday, December 10, 2012 8:34:17 AM UTC-5, Dominic Cleal wrote:
>
> On 07/12/12 11:56, Bret Wortman wrote:
> > Even in interactive mode, I get nothing out of augtool! What
> should I
> > look at to see why this is failing? Syslog doesn't show anything
> > illustrative, nor did puppet agent -t --debug.
>
> The lack of errors from the augeas resource type should be much
> improved
> now if you're able to use Puppet 3.
>
>
> I am using Puppet 3 -- 3.0.1-1, to be precise. In response to
> Raphael's suggestion, I'm able to find some errors and can work
> through those.
>
>
> I spoke too soon. The specific file I'm trying to work with is
> /etc/cron.allow. When I try to parse it:

Ah ok, cron.allow doesn't have a lens in Augeas 0.10.0, it's something
that's only been added recently. This is why it won't even show up as a
parse error.

What you could try is taking the lens from git:
http://git.fedorahosted.org/cgit/augeas.git/tree/lenses/simplelines.aug

Either store it in /usr/share/augeas/lenses/, or add it to a module at
<modulename>/lib/augeas/lenses/ and it will pluginsync to the client[1].
If you put it in the former directory, you should be able to do an "ls"
from augtool.

> augtool> ls /files/etc/cron.allow
> augtool> print /augeas//error
> /augesa/files/etc/hosts/error = "parse_failed"
> /augeas/files/etc/hosts/error/pos = "18473"
> /augeas/files/etc/hosts/error/line = "273"
> /augeas/files/etc/hosts/error/char = "0"
> /augeas/files/etc/hsots/error/lens =
> "/usr/share/augeas/lenses/dist/hosts.aug:23.12-.42:"
> /augeas/files/etc/hsots/error/message = "Iterated lens matched less than
> it should"
>
> It doesn't look like the error is getting updated, or am I
> misunderstanding something?

When you run augtool, it parses all the files (in their default
locations) that it knows about. So that's just reporting it has a parse
error with your /etc/hosts file on line 273 (!!), which is going to be
unrelated to cron.allow. As above, because 0.10.0 doesn't have support
for cron.allow, nothing appears when you do an "ls" for that file.

> Where should these be printing to from Puppet?

It would be printing in the debug logs, but it would probably only print
the /etc/hosts error since that's the only one that occurred.


[1]http://docs.puppetlabs.com/guides/plugins_in_modules.html#details
Reply all
Reply to author
Forward
0 new messages