Ask Your Question

augeas does not see a directory

asked 2015-10-19 01:56:14 -0500

nobody gravatar image

Hi there! I have installed nut on my servers and i want change configs for all servers. So i tell to my puppet - do it!

    case $fqdn {

 /my-serv1/: {

        case $operatingsystem {
            centos: {
                $nut_path = '/files/etc/ups/upsmon.conf'
            default: {
                $nut_path = '/files/etc/nut/upsmon.conf'

        augeas { "upsmon":
              context => "$nut_path",
              onlyif => "match upsmon.conf/*[.=~regexp('MY_UPS_DNS_NAME')] size == 0",
              changes => [
                "rm MONITOR[.]",
                "set MONITOR[1]/system/upsname MY_UPS_NAME",
                "set MONITOR[1]/system/hostname MY_UPS_DNS_NAME",
                "set MONITOR[1]/powervalue 1",
                "set MONITOR[1]/username MY_UPS_USER",
                "set MONITOR[1]/password MY_UPS_PASS",
                "set MONITOR[1]/type slave",
                "set MONITOR[2]/system/upsname MY_UPS_NAME2",
                "set MONITOR[2]/system/hostname MY_UPS_DNS_NAME2",
                "set MONITOR[2]/powervalue 1",
                "set MONITOR[2]/username MY_UPS_USER",
                "set MONITOR[2]/password MY_UPS_PASS",
                "set MONITOR[2]/type slave",
              notify  => Service["nut-service"]

        service { "nut-service":
            name => $operatingsystem ? {
                Centos => "ups",
                Gentoo => "upsmon",
                default => "nut-client",
            require => Augeas["upsmon"],
            enable => true,
            ensure => running,

And this work just for Debian, but for Centos & Gentoo - this does not work. I run "puppet agent --debug --no-daemonize --onetime" and did not see any errors. But i think this is all because augeas does not see a directory /etc/nut in centos & gentoo

augtool> ls /files/etc/n
networks/       nsswitch.conf/  ntp.conf/

Why? And how i can fix it?

edit retag flag offensive close merge delete


which augtool /usr/bin/augtool rpm -qf /usr/bin/augtool augeas-1.4.0-2.el7.x86_64 you should be able to load the augtool from rpm to test. Here is the one i have for RHEL7

Kevin T gravatar imageKevin T ( 2017-01-09 06:51:49 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2015-10-19 14:39:35 -0500

GregLarkin gravatar image

In your Puppet code, you specify the config file path as "/etc/ups/upsmon.conf" on CentOS. When you use augtool on CentOS, did you check /etc/ups instead of /etc/nut?

edit flag offensive delete link more


Unfortunately, i don't know where i could get augtool in centos, but on gentoo augtool does not see /etc/ups or /etc/nut (Real path). In debian, as i sad earlier, this is all works correct - strange... augtool> ls /files/etc/nut/ nut.conf/ upsd.conf/ upsd.users/ upsmon.conf/

nobody gravatar imagenobody ( 2015-10-19 21:40:47 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2015-10-19 01:51:32 -0500

Seen: 102 times

Last updated: Oct 19 '15