salt icon indicating copy to clipboard operation
salt copied to clipboard

Fix gitfs update method

Open smithjm opened this issue 13 years ago • 7 comments

When using gitfs in production as a backend for states (and someday pillars), it would be very useful to not need to restart the master daemon every time a new commit is made to the git repository.

Right now one has to

  1. rm -rf /var/cache/salt/master/gitfs/*
  2. restart the master daemon

instead a command like "salt '*' master.gitrefresh" would be very handy. Even better, in addition a refresh interval (e.g. every 5 minutes) as a configurable option would be hugely helpful, particularly in dynamic environments where state updates may happen several times a day, via git commits.

smithjm avatar Oct 30 '13 13:10 smithjm

Even better would be git commits triggering a refresh (e.g. a git hook that calls the salt API to trigger a pull when a change is committed), but really, just being able to configure pulls to occur every n minutes, and a salt command to trigger an immediate pull/refresh, would be enough.

smithjm avatar Oct 30 '13 13:10 smithjm

This is actually supposed to be happening already (the periodic refresh, I mean), and I think the default is once every minute. However, there's a bug with gitfs's update method, it seems. Once we fix that, then fileserver.update should do exactly what you want, and periodic refresh will resume.

basepi avatar Oct 30 '13 17:10 basepi

I could have sworn this was a duplicate, but I can't find an open issue, so I guess we'll use this one!

basepi avatar Oct 30 '13 18:10 basepi

@basepi and @smithjm I just tested the fileserver.update runner against a gitfs installation and it did properly pick up the new states and make them available to the minions.

@smithjm What version are you testing against? There's been a fair amount of movement in the gitfs code in the past few weeks. Could you post a --versions-report please? Thanks!

cachedout avatar Oct 30 '13 21:10 cachedout

I have also confirmed that updates are working for me, now that I'm on 0.17.1. I've been testing so many configs I'm not sure which version I was on when it didn't appear to be working...either 0.16.3, 0.16.4 or 0.17.0, but as of 0.17.1 I am getting gitfs updates every minute as advertised, confirmed by both state changes and grain changes.

smithjm avatar Oct 31 '13 17:10 smithjm

Sorry, meanto to include versions report in case it is useful, despite the fact that gitfs is now working.

[root@vm-salt ~]# salt --versions-report Salt: 0.17.1 Python: 2.7.5 (default, Oct 8 2013, 12:19:40) Jinja2: 2.6 M2Crypto: 0.21.1 msgpack-python: 0.1.13 msgpack-pure: Not Installed pycrypto: 2.6 PyYAML: 3.10 PyZMQ: 13.0.0 ZMQ: 3.2.4

smithjm avatar Oct 31 '13 17:10 smithjm

@smithjm Thanks for following up and letting us know that things are working now. Very much appreciated!

cachedout avatar Oct 31 '13 19:10 cachedout