Ask Your Question

Implement locking on master while updating modules directory?

asked 2015-08-31 10:25:39 -0600

cybersamurai gravatar image

I am extremely new to puppet so my apologies in advance, as this question likely shows my lack of understanding...

I recently came across this post regarding Puppet integration with version control:

My question is the following: When making updates to module files (either through svn update/git pull as shown in the link above, or scp/rsync, or manually updating them in a text editor), is there a way to implement critical-region/mutex style locking on the modules directory such that you can guarantee that the puppet agents won't receive a partial/incomplete configuration while the update/copy is in progress on the puppet master?

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted

answered 2015-09-01 08:25:31 -0600

cprice404 gravatar image

Spoiler alert: we (Puppet Labs) may have some info to announce before too long that relates to this question :)

edit flag offensive delete link more

answered 2015-09-01 06:22:39 -0600

updated 2015-09-01 06:29:22 -0600

nice question .. I've never seen that as an issue before, however one way that I've implemented this is on master to have clients pointing at say production branch - then when releasing a new prod branch we do the pull/checkout -- however within the branch we use a specific tag - we don't change the tag until the main branch has been merged, I believe this would prevent the scenario your discussing?

edit flag offensive delete link more


Thanks for the reply! It does prevent PART of the scenario - which is the case where you make a mistake or forget to check-in a file, etc - making it such that the clients don't see the updates until the branch has been tagged (and hopefully verified prior to tagging).

cybersamurai gravatar imagecybersamurai ( 2015-09-01 08:37:13 -0600 )edit

Say you tagged your branch, and in order to update to your new tag, 30 files would need to be updated. Say halfway through you update, a client polls the master - you could potentially have a scenario where a module could be built with a mix of updated and out-of-date files.

cybersamurai gravatar imagecybersamurai ( 2015-09-01 08:38:41 -0600 )edit

This was the initial motivation behind the question. I don’t know the actual likelihood, but it certainly seems possible under this concurrency model.

cybersamurai gravatar imagecybersamurai ( 2015-09-01 08:40:40 -0600 )edit

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


Asked: 2015-08-31 10:25:39 -0600

Seen: 58 times

Last updated: Sep 01 '15