cmd.script usage in master - syndic - minion setting

60 views
Skip to first unread message

Markus Kirchberg

unread,
Mar 15, 2013, 1:56:41 AM3/15/13
to salt-...@googlegroups.com
Hi,

I'm running a master master - syndic master - minion setup and have a question about the proper usage of cmd.script.

What I've been doing:

1) I added a Hello World script to the master master file server and tried to get it to run on the minions ... without success.

[root@mastermaster]# salt 'abc.def.com' cmd.script salt://helloWorld.sh
abc.def.com:
    ----------
    pid:
        5350
    retcode:
        0
    stderr:
       
    stdout:

I quickly noticed that there was actually no file downloaded (but would have expected a different return code!).

2) Subsequently, I moved the Hello World script to the syndic master and then re-ran the command from the master master.

[root@mastermaster]# salt 'abc.def.com' cmd.script salt://scripts/helloWorld.sh
abc.def.com:
    ----------
    pid:
        5441
    retcode:
        0
    stderr:
       
    stdout:
        Hello Woooorrrllllllddddddddd!

Now it worked; but is there a way to point cmd.script to the master master or make the syndic master(s) sync their files with the master master in some way???

Cheers,

      Markus

David Boucha

unread,
Mar 15, 2013, 2:11:19 AM3/15/13
to salt users list

No, you have to make sure the syndic master has all the files it needs to serve.

There are a few options:
1. Run a minion on the syndic master and use file.recurse
2. Use gitfs to back your file_roots of both master master and syndic master. So they match.
3. Use some other custom solution like scp or rsync.

--
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.
 
 

Markus Kirchberg

unread,
Mar 15, 2013, 2:25:31 AM3/15/13
to salt-...@googlegroups.com
Got it; thx for the quick reply.
> You received this message because you are subscribed to a topic in the
> Google Groups "Salt-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/salt-users/NPxPi2sRfJE/unsubscribe?hl=en-US.
> To unsubscribe from this group and all its topics, send an email to

Markus Kirchberg

unread,
Mar 18, 2013, 1:59:50 AM3/18/13
to salt-...@googlegroups.com
I tried your first suggestion and it does the trick.

However, while setting up a syndic master that also runs a minion daemon, I noticed a potential bug (I'll create a separate issue for this). When issuing a salt '*' cmd.run 'uname -a' call on the Master Master, only the response from the Syndic Master's minion is shown but not the responses from the minions controlled by the Syndic Master -- but the command is actually executed on all of the minions controlled by the Syndic Master (and their replies are received by the Master Master) according to the debug logs. If I target only the Syndic Master's minion or only the minions controlled by the Syndic Master, the output is correct. There seems to be a bug when merging both responses in case of a salt '*' call ...  It's a minor issue but a likely source for confusion ...

Cheers,

Markus
>> email to salt-users+unsubscribe@googlegroups.com.
>>
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Salt-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/salt-users/NPxPi2sRfJE/unsubscribe?hl=en-US.
> To unsubscribe from this group and all its topics, send an email to
> salt-users+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages