Skip to content

Instantly share code, notes, and snippets.

@ahpook ahpook/statefile.pp
Last active Aug 29, 2015

Embed
What would you like to do?
statefile problem
# problem: the 'statefile' (state.yaml) never cleans up entries
# which USED to be under management but are no longer in the catalog.
# this causes the statefile to grow without cleanup, and there could
# be a bunch of extra work puppet does on intialization that
# could be totally unneeded.
#
# to repro:
# make a bunch of directories
# for a in $(echo {a..z}) ; do mkdir -p /tmp/mydirs/$a/{a..z} ; done
# manage them recursively:
file { '/tmp/mydirs':
ensure => directory,
mode => '0600',
recurse => true,
}
# observe the statefile /opt/puppetlabs/puppet/cache/state/state.yaml
# and maybe preserve it by copying to a different filename?
# now run this resource instead
#
#
# file { '/tmp/mydirs':
# ensure => directory,
# mode => '0600',
# recurse => false,
# }
# and note the difference between the two
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.