FAQ
I am using reactor to catch certain events, my reactor.conf in
/etc/salt/master.d looks like:

     reactor:
       - 'health/agent/update':
         - salt://health-checks/reactor.sls

In reactor.sls - I want to get some data from agents and run a certain SLS
only on certain salt minions (Not on salt master itself). So I use
following block along with ```tgt``` to ensure it runs only on those
minions. This looks fine based on documentation
[https://docs.saltstack.com/en/latest/topics/reactor/]. In
update_server.sls I produce some managed files.

     {% set event_data = data.data %}
     {% set target_server_name = data.data.server_name %}
     'update server states':
       runner.state.orchestrate:
         - tgt: {{ target_server_name }}
         - mods: health-checks/update_server
         - pillar:
             event_data: {{ event_data }}

But managed files are generated only on salt-master and not on any of
```tgt``` minions. What am I missing? What is right way to run a sls on
target minions and produce desired results there?

I also tried using salt.state but that results into an error, code

      salt.state:
         - tgt: '*{{ target_server_name }}*'

and error:

     2015-12-04 06:37:24,467 [salt.utils.process][INFO ][17924] Process
<class 'salt.utils.reactor.Reactor'> (17989) died with exit status None,
restarting...

--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Vishal Biyani at Dec 7, 2015 at 9:59 am
    Sorry about my bad here - I think using Runner was gross mistake
    (Documentation clearly says only for tasks need to be performed on salt
    master). I finally managed to get things working using local.state.sls and
    then using tgt to target intended servers.

    Though what I need some clarity on is composition of "local.state.sls" -
    which I could not yet make out from documentation.


    Thanks
    -Vishal
    On Monday, December 7, 2015 at 12:28:05 PM UTC+5:30, Vishal Biyani wrote:

    I am using reactor to catch certain events, my reactor.conf in
    /etc/salt/master.d looks like:

    reactor:
    - 'health/agent/update':
    - salt://health-checks/reactor.sls

    In reactor.sls - I want to get some data from agents and run a certain SLS
    only on certain salt minions (Not on salt master itself). So I use
    following block along with ```tgt``` to ensure it runs only on those
    minions. This looks fine based on documentation [
    https://docs.saltstack.com/en/latest/topics/reactor/]. In
    update_server.sls I produce some managed files.

    {% set event_data = data.data %}
    {% set target_server_name = data.data.server_name %}
    'update server states':
    runner.state.orchestrate:
    - tgt: {{ target_server_name }}
    - mods: health-checks/update_server
    - pillar:
    event_data: {{ event_data }}

    But managed files are generated only on salt-master and not on any of
    ```tgt``` minions. What am I missing? What is right way to run a sls on
    target minions and produce desired results there?

    I also tried using salt.state but that results into an error, code

    salt.state:
    - tgt: '*{{ target_server_name }}*'

    and error:

    2015-12-04 06:37:24,467 [salt.utils.process][INFO ][17924] Process
    <class 'salt.utils.reactor.Reactor'> (17989) died with exit status None,
    restarting...
    --
    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+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupsalt-users @
postedDec 7, '15 at 6:58a
activeDec 7, '15 at 9:59a
posts2
users1

1 user in discussion

Vishal Biyani: 2 posts

People

Translate

site design / logo © 2022 Grokbase