Issue #2106 has been updated by [email protected].
Are you running this as root? I tested this on both the last released in fedora
and the latest from trunk on both 0.4.0 augeas as well as the tarball for
augeas 0.4.0. I am seeing it work in all cases. Here is my output:
<pre>
[bkear...@localhost Desktop]$ sudo su -
[r...@localhost ~]# rm /etc/logrotate.d/sympa
rm: remove regular file `/etc/logrotate.d/sympa'? y
[r...@localhost ~]# puppet -d test.pp
debug: Creating default schedules
debug: //Augeas[logrotate_sympa]: Changing returns
debug: //Augeas[logrotate_sympa]: 1 change(s)
debug: Augeas[logrotate_sympa](provider=augeas): Opening augeas with root /,
lens path , flags 0
debug: Augeas[logrotate_sympa](provider=augeas): sending command 'set' with
params ["/files/etc/logrotate.d/sympa/rule/file", "/var/log/sympa/*.log"]
debug: Augeas[logrotate_sympa](provider=augeas): sending command 'set' with
params ["/files/etc/logrotate.d/sympa/rule/rotate", "3"]
debug: Augeas[logrotate_sympa](provider=augeas): sending command 'set' with
params ["/files/etc/logrotate.d/sympa/rule/schedule", "weekly"]
debug: Augeas[logrotate_sympa](provider=augeas): sending command 'set' with
params ["/files/etc/logrotate.d/sympa/rule/compress", "compress"]
debug: Augeas[logrotate_sympa](provider=augeas): sending command 'set' with
params ["/files/etc/logrotate.d/sympa/rule/missingok", "missingok"]
debug: Augeas[logrotate_sympa](provider=augeas): sending command 'set' with
params ["/files/etc/logrotate.d/sympa/rule/ifempty", "notifempty"]
debug: Augeas[logrotate_sympa](provider=augeas): sending command 'set' with
params ["/files/etc/logrotate.d/sympa/rule/copytruncate", "copytruncate"]
notice: //Augeas[logrotate_sympa]/returns: executed successfully
debug: Finishing transaction -605827478 with 1 changes
[r...@localhost ~]# cat /etc/logrotate.d/sympa
/var/log/sympa/*.log {
rotate 3
weekly
compress
missingok
notifempty
copytruncate
}
[r...@localhost ~]# cat test.pp
augeas {
"logrotate_sympa":
context => "/files/etc/logrotate.d/sympa/rule",
changes => [ "set file /var/log/sympa/*.log", "set rotate 3",
"set schedule weekly",
"set compress compress", "set missingok missingok",
"set ifempty notifempty",
"set copytruncate copytruncate" ]
}
[r...@localhost ~]#
</pre>
----------------------------------------
Bug #2106: augeas provider is not applying
http://projects.reductivelabs.com/issues/2106
Author: micah
Status: Accepted
Priority: High
Assigned to: [email protected]
Category: unknown
Target version:
Complexity: Unknown
Affected version: 0.24.8
Keywords:
I've got an augeas puppet definition for a new logrotate snippet, there
currently is no /etc/logrotate.d/sympa, but I wish to create one with augeas.
This works fine with augtool, however, puppet isn't applying it, nor am I
seeing any info about why not. This is using puppet 0.24.8rc1.
The puppet chunk is:
<pre>
augeas {
"logrotate_sympa":
context => "/files/etc/logrotate.d/sympa/rule",
changes => [ "set file /var/log/sympa/*.log", "set rotate 3",
"set schedule weekly",
"set compress compress", "set missingok missingok",
"set ifempty notifempty",
"set copytruncate copytruncate" ]
}
</pre>
Running puppet with debug tells me:
<pre>
debug: Augeas[logrotate_sympa](provider=augeas): Opening augeas with
root /, lens path , flags 0
debug: Augeas[logrotate_sympa](provider=augeas): Augeas version 0.4.0 is
installed
debug: Augeas[logrotate_sympa](provider=augeas): Will attempt to save and only
run if files changed
debug: Augeas[logrotate_sympa](provider=augeas): sending command 'set'
with params ["/files/etc/logrotate.d/sympa/rule/file", "/var/log/sympa/*.log"]
debug: Augeas[logrotate_sympa](provider=augeas): sending command 'set'
with params ["/files/etc/logrotate.d/sympa/rule/rotate", "3"]
debug: Augeas[logrotate_sympa](provider=augeas): sending command 'set'
with params ["/files/etc/logrotate.d/sympa/rule/schedule", "weekly"]
debug: Augeas[logrotate_sympa](provider=augeas): sending command 'set'
with params ["/files/etc/logrotate.d/sympa/rule/compress", "compress"]
debug: Augeas[logrotate_sympa](provider=augeas): sending command 'set'
with params ["/files/etc/logrotate.d/sympa/rule/missingok", "missingok"]
debug: Augeas[logrotate_sympa](provider=augeas): sending command 'set'
with params ["/files/etc/logrotate.d/sympa/rule/ifempty", "notifempty"]
debug: Augeas[logrotate_sympa](provider=augeas): sending command 'set'
with params ["/files/etc/logrotate.d/sympa/rule/copytruncate",
"copytruncate"]
debug: Augeas[logrotate_sympa](provider=augeas): Skipping becuase no
files were changed
</pre>
> (1) Is the provider able to make simple changes to existing files (like
> add an alias for localhost in /etc/hosts ?
I try and add an alias for localhost in /etc/hosts, I did the following:
<pre>
augeas { "host foo":
context => "/files/etc/hosts",
changes => "set 1/alias foo";
}
</pre>
I tried it without the context as well:
<pre>
augeas { "host foo":
changes => "set /files/etc/hosts/1/alias foo";
}
</pre>
Both of these resulted in no change, and this debug:
<pre>
debug: Augeas[host foo](provider=augeas): Opening augeas with root /,
lens path , flags 0
debug: Augeas[host foo](provider=augeas): Augeas version 0.4.0 is
installed
debug: Augeas[host foo](provider=augeas): Will attempt to save and only
run if files changed
debug: Augeas[host foo](provider=augeas): sending command 'set' with
params ["/files/etc/hosts/1/alias", "foo"]
debug: Augeas[host foo](provider=augeas): Skipping becuase no files were
changed
debug: Augeas[host foo](provider=augeas): Closed the augeas connection
</pre>
It looks right, but it doesn't seem to change anything. Using augtool, I
can make this change:
<pre>
augtool> set /files/etc/hosts/1/alias foo
augtool> save
augtool> quit
# cat /etc/hosts
127.0.0.1 localhost foo
</pre>
> (2) make sure that /etc/logrotate.d exists and is writable. Augeas will
> _not_ create missing directories, but it should create new files without
> problems, assuming the user that is running Augeas is allowed to create
> the file - watch out for SELinux. For puppet, the effective user is
This is fine.
> (3) Try the equivalent of your Augeas resource in augtool (you can write
> augtool commands into a file and then run them with 'augtool <
> commands.txt', I recommend doing that in a fake root in which you copy
> the relevant files from /etc - use the -r option for augtool to point it
> to that fake root. That should tell us if the problem is with the
> provider or Augeas itself.
This works fine:
<pre>
# ls /etc/logrotate.d/sympa
ls: /etc/logrotate.d/sympa: No such file or directory
# augtool
augtool> set /files/etc/logrotate.d/sympa/rule/file /var/log/sympa/*.log
augtool> save
augtool> quit
# cat /etc/logrotate.d/sympa
/var/log/sympa/*.log {
</pre>
----------------------------------------
You have received this notification because you have either subscribed to it,
or are involved in it.
To change your notification preferences, please click here:
http://reductivelabs.com/redmine/my/account
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Puppet Bugs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/puppet-bugs?hl=en
-~----------~----~----~----~------~----~------~--~---