Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-4230

File resources with ensure=>absent do not have hashes logged after being filebucketed

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Normal
    • Resolution: Won't Do
    • PUP 3.7.4
    • None
    • None
    • None

    Description

      When a file resource with ensure => absent is also set to backup to a filebucket, it gets bucketed before being removed but the hash is not recorded in the log. For example, if this code is on the master:

      filebucket { 'main':
        server => $settings::certname,
        path => false,
      }
      file { '/root/removeme':
        ensure => absent,
        backup => 'main',
      }
      

      This is what the log shows normally:

      [root@puppet-eli ~]# touch removeme
      [root@puppet-eli ~]# puppet agent --no-daemonize --onetime --logdest console
      Notice: /Stage[main]/Profile::Base/File[/root/removeme]/ensure: removed
      Notice: Finished catalog run in 2.70 seconds
      

      By contrast, here's what the verbose log shows:

      [root@puppet-eli ~]# touch removeme
      [root@puppet-eli ~]# puppet agent --no-daemonize --onetime --logdest console --verbose
      Info: Retrieving pluginfacts
      Info: Retrieving plugin
      Info: Loading facts
      Info: Caching catalog for puppet-eli.localdomain
      Info: Applying configuration version '1426540724'
      Info: Computing checksum on file /root/removeme
      Info: /Stage[main]/Profile::Base/File[/root/removeme]: Filebucketed /root/removeme to main with sum d41d8cd98f00b204e9800998ecf8427e
      Notice: /Stage[main]/Profile::Base/File[/root/removeme]/ensure: removed
      Notice: Finished catalog run in 3.03 seconds
      

      Having the hash available would be useful. The line:

      Notice: /Stage[main]/Profile::Base/File[/root/removeme]/ensure: removed
      

      should instead say something like:

      Notice: /Stage[main]/Profile::Base/File[/root/removeme]/ensure: removed file with content '{md5}d41d8cd98f00b204e9800998ecf8427e'
      

      QA Risk Analysis

      Probability Low (not a common use case?)
      Impact Low (a logged hash is a debugging aid, not critical data)
      Risk Level Low
      Test Level spec

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              eyoung@certifydatasystems.com Eli Young
              Kurt Wall Kurt Wall
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support