On 14.02.2013 13:59, Tiago Cruz wrote:
Hello Danny, nice explanation, thank you!!!

I agree with you, this is really a "new" file everytime. So let's try
another example:

    exec { "authconfig":
                 command => "authconfig-tui --ldapserver=ldap://ldap.com
    --ldapbasedn=dc=bla,dc=com --enableshadow --enablemd5 --enableldap
    --enableldapauth --disableldaptls --enablelocauthorize --kickstart",
                 path    => "/usr/bin/:/bin/:/usr/sbin",
    onlyif => "fgrep ldap.com /etc/ldap.conf",
             }


The idea is the same: Just do the configuration if was needed, but when
I look the report, I got:


      Log

Level   Message Source  File    Line    Time
|notice|        |executed successfully|
|/Stage[main]/Base::Ldap/Exec[authconfig]/returns|
|/etc/puppet/modules/base/manifests/ldap.pp|    |36|    |2013-02-14 10:38 BRST|
|notice|        |Finished catalog run in 7.56 seconds|  |Puppet|        ||      
||
|2013-02-14 10:38 BRST|


What can I do to workaround this? :D

The message means that the authconfig-tui command is run *every time* puppet runs. This does not seem to be your intention. I guess, you should write "unless => [ldap is configured]" instead of "onlyif => [ldap is configured]"


Best Regards, David



Thanks!!


Em quinta-feira, 14 de fevereiro de 2013 10h30min45s UTC-2,
d.o...@cri-service.nl escreveu:

    You are creating a 'new' file every time(well new content), so in
    essence, it is true that the configuration has changed.

    To avoid this, you should make your command smarter and make sure it
    only runs when changes are in the crontab. There is no need to make
    a backup of something that has not changed.

    It would probably be even better to just manage the file itself in
    puppet, giving you complete control over it, and not needing a
    backup anymore.

    Also, creating backups by using puppet is not really good practise.
    Puppet is good at setting up a configuration, and should be about
    resources coming to a defined state, not about being a job scheduler.

    In short, there is no 'normal' way around abnormal use of Puppet ;)
    But of course workarounds are possible.

    //Danny.



--
You received this message because you are subscribed to the Google
Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.



--
You received this message because you are subscribed to the Google Groups "Puppet 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to