Skip to content

Instantly share code, notes, and snippets.

@ahpook
Last active August 29, 2015 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ahpook/52d80c597da59aebfada to your computer and use it in GitHub Desktop.
Save ahpook/52d80c597da59aebfada to your computer and use it in GitHub Desktop.
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