Keep configuration in sync from master

136 views
Skip to first unread message

Juan Asensio Sánchez

unread,
Sep 18, 2013, 2:58:17 AM9/18/13
to salt-...@googlegroups.com
Hi

Hoy can I make the master appli a 'state.highstate' periodically? Just to test, I have put this in the master config file:

file_roots:
  base:
    - /srv/salt

schedule:
  overstate:
    function: state.over
    minutes: 30

This is /srv/salt/top.sls:

base:
  '*':
    - touch_test

And this is /srv/salt/touch_test/init.sls

date > /tmp/salt_run.txt:
  cmd.run

So, if I am rigth, as in the documentation (http://docs.saltstack.com/topics/jobs/schedule.html), every 30 minutes the /tmp/salt_run.txt should be updated. But not. It is done just if I run "salt '*' state.highstate'. I want to emulate the behaviour of Puppet. What am I doing wrong?

Regards and thanks in advance.

Ethan Erchinger

unread,
Sep 18, 2013, 11:06:56 AM9/18/13
to salt-...@googlegroups.com
Try changing your schedule to use state.hightstate, instead of state.over.  Another method is to use a cron state which sets up a '*/30 * * * * salt-call state.highstate', I recommend redirecting output to a file or /dev/null as you'll get lots of email from cron otherwise.

Juan Asensio Sánchez

unread,
Sep 18, 2013, 12:30:35 PM9/18/13
to salt-...@googlegroups.com
Hi again

I have changed state.over to state.highstate (in the master), but nothing happens (restarted salt-master). Is this a bug? Or am I confused? While, I will use the cron trick.

Regards.


2013/9/18 Ethan Erchinger <eth...@erchinger.org>

--
You received this message because you are subscribed to the Google Groups "Salt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Juan Asensio Sánchez

unread,
Sep 18, 2013, 12:37:18 PM9/18/13
to salt-...@googlegroups.com
I just realized that salt-call is a command only available on the minions, but I want to fire the sync from the master, not from every client, just simulating a "salt '*' state.highstate". I don't want to do this in the minion to prevent someone modify the minion configuration and disable the conf sync (yes I know he can even uninstall the minion, but in that case, I would know it because the master gave me an error). Any idea?


2013/9/18 Juan Asensio Sánchez <oke...@gmail.com>

Ethan Erchinger

unread,
Sep 19, 2013, 11:34:53 AM9/19/13
to salt-...@googlegroups.com
Yea, it might be a bug.  The scheduler has been broken in the past.  

If you need to use state.highstate from the master, you could also setup a cron job with the appropriate command on the master.

nrb1

unread,
Oct 6, 2014, 9:41:10 PM10/6/14
to salt-...@googlegroups.com, oke...@gmail.com
Is this condition (that one has to schedule a cron job) still the case if one needs to schedule jobs from the master?
Reply all
Reply to author
Forward
0 new messages