Last active
August 29, 2015 14:19
-
-
Save ahpook/52d80c597da59aebfada to your computer and use it in GitHub Desktop.
statefile problem
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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