Ask Your Question
1

Is it ok to delete report yaml files?

asked 2014-06-11 19:02:34 -0500

JM gravatar image

updated 2014-06-12 13:10:58 -0500

ramindk gravatar image

My master keeps filling up with these .yaml files. When I run the prune rake job, they don't go away. Am I supposed to manually delete these files?

edit retag flag offensive close merge delete

4 Answers

Sort by ยป oldest newest most voted
2

answered 2014-06-11 21:04:09 -0500

ramindk gravatar image

Yes, delete them. I use this code. You may want to change the time period based on your needs.

find ~/puppet/var/reports/ -mmin +300 -type f -print0 | xargs -0 -r rm > /dev/null 2>&1
edit flag offensive delete link more
1

answered 2016-03-27 23:05:30 -0500

zsl gravatar image

If you don't need the reports anyway, just disable this feature on the puppet master. puppet config set --section master reports none

edit flag offensive delete link more
0

answered 2015-12-21 15:25:40 -0500

peelman gravatar image

I have used this module and script for a while now to manage and automate this via Puppet and Cron:

# /path/to/your/module/manifests/clean_reports.pp

class puppet_master::clean_reports {

  file { '/usr/local/bin/puppet-reports-stalker':
      source =>  'puppet:///modules/puppet_master/puppet-reports-stalker',
      mode   =>  '755',
      owner  =>  'root',
      group  =>  'root',
  }

  cron { 'puppet clean reports':
      command =>  '/usr/local/bin/puppet-reports-stalker',
      user =>  root,
      hour =>  21,
      minute =>  22,
      weekday =>  0,
      require => File["/usr/local/bin/puppet-reports-stalker"]
  }
}

puppet-reports-stalker.sh

#! /bin/sh
# puppet-reports-stalker
# vagn scott, 21-jul-2011
# https://groups.google.com/forum/?fromgroups=#!topic/puppet-users/q8vWDr3bn4Q

days="+7"       # more than 7 days old
path="/opt/puppetlabs/server/data/puppetserver/reports"

for d in `find $path -mindepth 1 -maxdepth 1 -type d`
do
         find $d -type f -name \*.yaml -mtime $days |
         sort -r |
         tail -n +2 |
         xargs -n50 /bin/rm -f
done

exit 0
edit flag offensive delete link more
0

answered 2016-03-05 10:01:13 -0500

rjc gravatar image

Or you can simply manage it by puppet itself:

node puppet_server {
    tidy { '/path/to/puppet/reports':
            age     => '30d',
            matches => "*.yaml",
            recurse => true,
            rmdirs  => false,
            type    => ctime,
    }

}

edit flag offensive delete link more

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

Stats

Asked: 2014-06-11 19:02:34 -0500

Seen: 2,666 times

Last updated: Mar 27 '16