Perl 6 - the future is here, just unevenly distributed

IRC log for #salt, 2013-06-11

| Channels | #salt index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:00 jescalan Specified state rbenv.installed is unavailable.
00:01 jacksontj joined #salt
00:02 auser joined #salt
00:02 jescalan :(
00:04 UtahDave looks like it can't find your rbenv.  Do you need to pass it a path to your rbenv?
00:05 jescalan i'm not sure… do i?
00:05 jescalan i don't think it can't find rbenv
00:05 jescalan i think it can't find that state
00:05 jescalan all the state requires is the name of the version to install
00:05 jescalan https://github.com/saltstack/salt/blob/develop/salt/states/rbenv.py
00:06 jescalan this file doesn't throw that specific error anywhere in the implementation either
00:06 jescalan which would seem to me like it's not able to find that file
00:06 jescalan https://github.com/saltstack/salt/blob/develop/salt/states/rbenv.py#L90
00:07 efixit joined #salt
00:07 jescalan if rbenv wasn't installed it would be throwing this error, no?
00:07 jescalan https://github.com/saltstack/salt/blob/develop/salt/states/rbenv.py#L50
00:08 fxhp joined #salt
00:08 abyss42 joined #salt
00:13 adotbrown joined #salt
00:14 UtahDave jescalan: can you start the minion in a terminal in debug mode?  I want to see if there are any rbenv errors or if it says it can't load rbenv for some reason
00:14 UtahDave it might be stacktracing, which would cause Salt to skip it
00:16 aat joined #salt
00:24 sarkis joined #salt
00:30 mgw joined #salt
00:35 jescalan joined #salt
00:35 jescalan oh yeah for sure
00:36 UtahDave ok, I'm heading home now.  Let me know if you continue having issues.
00:37 jescalan [ERROR   ] No changes made for ruby-2.0.0-p195
00:37 jescalan this is all i got in the minion debug
00:37 UtahDave did you start it like this:     sudo salt-minion -l debug
00:37 jescalan yep
00:37 jescalan i mean i got a lot more
00:37 jescalan but that was the only thing related to rbenv
00:37 UtahDave did it load rbenv?
00:38 clintberry joined #salt
00:38 jescalan not that i could see
00:38 jescalan [INFO    ] Executing state cmd.run for source /root/.profile
00:38 jescalan [INFO    ] Executing command 'source /root/.profile' in directory '/root'
00:38 jescalan [INFO    ] {'pid': 2517, 'retcode': 0, 'stderr': '', 'stdout': ''}
00:38 jescalan [INFO    ] Executing state file.append for /root/.profile
00:38 jescalan [INFO    ] No changes made for /root/.profile
00:38 jescalan [ERROR   ] No changes made for ruby-2.0.0-p195
00:38 UtahDave gah, I wish I could help more right now. but I have to head out.  Hit me up tomorrow if you're still seeing this.
00:39 jescalan this is what i got back. the command before the rbenv one just reloads the shell
00:39 jescalan ok no worries - thanks @utahdave !
00:43 lvicks joined #salt
00:53 mgw joined #salt
00:55 admineric If I wanted to copy a file (master -> minion) inside a custom salt module, what is the best way to do that? The module will be executing on the master.
01:12 canci_ How would I go about printing each element of a list exactly once in jinja? (elements may appear multiple times in the list)
01:12 kmwhite joined #salt
01:13 canci_ (On command line I would do ...|sort|uniq - however it seems there is no "uniq" equivalent in jinja)
01:15 Katafalkas joined #salt
01:19 tf198_ joined #salt
01:19 cxz joined #salt
01:22 admineric canci_: you could try set(your_list)
01:23 admineric canci_: testlist = [13, 13, 11, 22]; set(testlist)
01:26 lvicks joined #salt
01:27 canci_ admineric: that's python, not jinja, isn't it?
01:27 admineric you can use python in jinja
01:29 canci_ admineric: I am obviously doing something wrong then
01:29 canci_ I do '{%- for if_name in set(dhcp_interfaces)|sort %}
01:30 canci_ and this yields: UndefinedError: 'set' is undefined
01:30 canci_ admineric: How would I go about calling arbitrary python from jinja?
01:33 favadi joined #salt
01:35 jescalan joined #salt
01:35 jescalan @admineric file.managed
01:35 jescalan sorry, latest response ever
01:35 jescalan http://docs.saltstack.com/ref/states/all/salt.states.file.html#module-salt.states.file
01:36 jescalan you can use salt:// to reference the /srv/salt directory on the master
01:38 admineric jesclan: I want to copy this file over only one time and I am doing this from a salt module not sls
01:38 m_george|away joined #salt
01:39 jescalan by a salt module do you mean through a command? if not then probably beyond me hah
01:39 m_george left #salt
01:39 admineric Modules like http://docs.saltstack.com/ref/modules/
01:39 canci_ admineric: look at the cp module
01:40 canci_ admineric: cp.recv might be it (not sure if this is the right way, though ;) )
01:40 admineric I need something like __salt__['cp.get_file'] but more like cp.put_file
01:41 canci_ ah, because the module is running on the master... forgot about that "detail" :/
01:41 mgw1 joined #salt
01:43 dthom91 joined #salt
01:44 admineric canci_: You are right there is no straightforward way to run arbitrary python in jinja
01:47 mgw joined #salt
01:48 admineric left #salt
01:50 Gwayne joined #salt
01:51 Furao admineric: use python renderer
01:52 Furao oh gone
01:52 canci_ Furao: that would be me not admineric. however I have that issue in a config file template, not in an sls
01:53 canci_ for now I have just added a {# FIXME #} as that duplication is a rare cornercase and might not even be an issue when it occurs
01:53 Furao canci_: I see. well the limitations of jinja2 templates come from jinja2 and not from salt. except the {% include %} extend and other things that salt need to implement
01:54 Furao but if you need to perform some manipulation of data from some salt modules, you should write you own module
01:54 canci_ If the problem really occurs, I would probably write a small salt module which does 'return set(input)'
01:54 DredTiger joined #salt
01:55 canci_ I was just not sure if I would be reimplementing a feature of jinja there
01:55 Furao but why set() instead of other iterable?
01:55 canci_ set(input) makes it a set and thereby removes all duplicates which is what I wanted in the first place
01:56 logix812 joined #salt
01:56 Furao ah I see
01:59 oz_akan joined #salt
02:00 oz_akan joined #salt
02:02 Furao look like there is no unique template filter in jinja2
02:09 jescalan hey quick Q
02:09 jescalan salt '*' pillar.data key='foo'
02:10 jescalan returns bar: baz
02:10 jescalan if i want to get at bar with ninja inside a sls
02:10 jescalan how would i do this?
02:10 jescalan i would have assumed {{ pillar['foo']['bar'] }}
02:10 mgw joined #salt
02:10 jescalan but that throws me an error
02:12 clintberry joined #salt
02:14 mgw joined #salt
02:15 raydeo joined #salt
02:16 kermit joined #salt
02:20 mgw joined #salt
02:31 Gifflen_ joined #salt
02:39 lvicks joined #salt
02:42 Furao pillar['foo']['bar'] is valid, I use that all the time
02:43 Furao there is also salt['pillar.get']('foo:bar')
02:47 bja joined #salt
02:54 Katafalkas joined #salt
03:08 logix812 joined #salt
03:26 kmwhite joined #salt
03:36 kvbik joined #salt
03:36 bja joined #salt
03:42 sarkis joined #salt
03:44 nliadm joined #salt
03:47 clintberry joined #salt
03:51 koolhead17 joined #salt
03:51 koolhead17 joined #salt
03:56 dlam joined #salt
04:06 kmwhite joined #salt
04:22 raydeo joined #salt
04:24 jacksontj joined #salt
04:26 LyndsySimon joined #salt
04:30 sarkis joined #salt
04:37 sebgoa joined #salt
04:38 jkleckner joined #salt
04:47 zz___number5__ joined #salt
04:47 Sypher joined #salt
04:53 maspwr joined #salt
05:06 austin987 joined #salt
05:06 clintber_ joined #salt
05:07 mgw joined #salt
05:09 jalbretsen joined #salt
05:16 krissaxton1 joined #salt
05:23 cxz joined #salt
05:30 aranhoide joined #salt
05:34 middleman_ joined #salt
05:40 oz_akan joined #salt
05:44 ageron joined #salt
05:53 favadi joined #salt
06:00 timl0101 joined #salt
06:05 aranhoide joined #salt
06:10 Ryan_Lane joined #salt
06:13 Ryan_Lane1 joined #salt
06:15 linjan joined #salt
06:17 Rob___ joined #salt
06:18 cxz joined #salt
06:25 vaxholm joined #salt
06:30 dhgbrg joined #salt
06:31 pcarrier_ joined #salt
06:31 efixit joined #salt
06:45 oz_akan joined #salt
06:46 pcarrier_ joined #salt
06:47 krissaxton joined #salt
06:47 `3rdEden joined #salt
07:12 zz___number5__ joined #salt
07:39 aranhoide joined #salt
07:39 zz___number5__ joined #salt
07:42 ageron joined #salt
07:48 azbarcea joined #salt
07:50 sebgoa joined #salt
07:51 adotbrown joined #salt
07:57 dhgbrg joined #salt
08:01 yml joined #salt
08:03 dhgbrg joined #salt
08:04 terminalmage joined #salt
08:06 felixhummel joined #salt
08:23 adotbrown joined #salt
08:27 krak3n` joined #salt
08:40 zooz joined #salt
08:49 carlos joined #salt
09:00 efixit joined #salt
09:01 krak3n` joined #salt
09:07 aleszoulek joined #salt
09:10 sto joined #salt
09:10 whiskybar joined #salt
09:23 mikedawson joined #salt
09:30 sebgoa joined #salt
09:36 bhosmer_ joined #salt
09:41 timl0101_ joined #salt
09:46 adotbrown joined #salt
09:59 krissaxton joined #salt
10:04 jeddi joined #salt
10:13 __gotcha joined #salt
10:17 favadi joined #salt
10:22 adotbrown joined #salt
10:26 fredvd joined #salt
10:29 backjlack joined #salt
10:30 linjan joined #salt
10:46 efixit joined #salt
10:47 carlos joined #salt
11:08 agend joined #salt
11:08 iMil hmm, is there a problem with salt 0.15.3 squeeze packages?
11:09 iMil The following packages have unmet dependencies:
11:09 iMil salt-minion : Depends: salt-common (= 0.15.3-1~bpo60~dst+1) but it is not going to be installed
11:09 iMil E: Broken packages
11:09 krak3n` joined #salt
11:09 agend joined #salt
11:09 iMil if trying to install both:
11:09 iMil The following packages have unmet dependencies:
11:09 iMil salt-common : Depends: msgpack-python but it is not installable
11:09 iMil Depends: python-zmq (>= 13.1.0) but it is not going to be installed
11:09 iMil Recommends: python-mako but it is not going to be installed
11:09 iMil E: Broken packages
11:14 logix812 joined #salt
11:19 efixit joined #salt
11:22 iMil oh, it needs debian backports
11:24 sarkis joined #salt
11:25 maspwr joined #salt
11:26 aranhoide joined #salt
11:26 adotbrown joined #salt
11:37 joehh iMil: does that need to be clearer?
11:37 sebgoa joined #salt
11:39 iMil joehh: my eyes need to be cleaner :)
11:39 iMil it is actually written very clearly
11:40 joehh ok :) It's a little while since I wrote the docs and I hope they are clear enough
11:40 iMil they definitely are, I played rookie on this one :)
11:41 iMil and great job btw, salt docs are one of the reasons why it's taking off so well
11:41 joehh I can only claim the debian page - I think most of the rest is Thomas
11:41 joehh good to hear they are being used
11:52 krissaxton joined #salt
12:04 oz_akan joined #salt
12:24 williamthekid_ joined #salt
12:30 efixit joined #salt
12:32 ggoZ joined #salt
12:34 ggoZ does pip.installed support version param?
12:34 ggoZ in any way? in any fashion?
12:36 giantlock joined #salt
12:37 Teknix joined #salt
12:37 Oct joined #salt
12:37 Oct hello there
12:42 joehh ggoZ: read after http://irclog.perlgeek.de/salt/2013-06-10#i_7177470
12:42 joehh Oct: hello
12:42 santagada_ joined #salt
12:44 Oct trying to use rbenv modules, but not sure it exists in my salt install...
12:44 Oct although I've installed everything a few hours ago
12:45 Teknix joined #salt
12:46 joehh Are you getting something like module rbenv is unavailable? (message from memory so could be inaccurate)
12:47 Oct "rbenv.default" is not available.
12:47 Oct stuff like that
12:47 Oct and other errors about state
12:47 joehh thats it
12:47 Oct I think it's because I've installed the distro package
12:47 joehh I'm not sure what platform you are on, but I think you need install the right package
12:47 joehh There has been a fair bit of discussion on irc over the last couple of days
12:48 Oct I suppose I can just grok the rbenv.py file from the main distro and store it in my salt repo ?
12:48 Oct mmm
12:48 joehh worth checking the logs http://irclog.perlgeek.de/salt/2013-06-11 and the few days before
12:48 Oct doing that
12:48 joehh my guess is that the file will already be there, but it is unavailable due to a missing dependency
12:49 joehh checking the source now
12:50 joehh nothing obvious in terms of dependency checking
12:50 Oct I have no file name rbenv* on my filesystem
12:50 Oct named
12:50 joehh Then I think your suggestion is probably best
12:50 Oct ok
12:51 Oct will grab the py then and try to integrate in my experiments :)
12:51 joehh put it in _modules and it should go out when you do a state.highstate or a sync_modules
12:51 Oct thanks for the quick reply
12:51 Oct ok
12:51 joehh /srv/salt/_modules
12:51 joehh nw :)
12:52 ggoZ joehh: thanks
12:53 ggoZ I'v been using name==version in pip.installed previously, but now upgraded to 15.3, and... im not sure if this stopped working because of upgrade or what...
12:56 Teknix joined #salt
12:56 ggoZ ohh
12:56 ggoZ wtf is this:
12:56 ggoZ Requested dbs-overseer==0.1.19.1, but installing version 0.1.18.4
12:56 ggoZ what is this 'but' !?
12:57 brutasse ggoZ: that's because pip has a cached version from a previous (failed) run
12:58 brutasse look at /tmp/pip-* or a build directory in your virtualenv and remove those dirs
12:59 faust joined #salt
13:00 sarkis joined #salt
13:00 oz_akan joined #salt
13:01 tamentis joined #salt
13:02 dcrouch joined #salt
13:06 juicer2 joined #salt
13:07 scott_w joined #salt
13:07 karlp brutasse: sure, but that's a lower version, how is that ok?
13:08 ggoZ brutasse: ty, i'll look into that
13:08 brutasse karlp: it's not ok, it's an inconsistent state pip isn't able to recover from on his own
13:11 Khollowa_ joined #salt
13:13 FreeSpencer joined #salt
13:14 auser joined #salt
13:14 Gifflen joined #salt
13:15 mikedawson joined #salt
13:19 dcrouch joined #salt
13:21 joehh FreeSpencer: hey - just checking you got the message that the main debian.saltstack.com now has zmq3.2 packages
13:21 joehh the temp packages will go away soonish
13:21 FreeSpencer Ahhhhh sweeet
13:23 DanGarthwaite joined #salt
13:23 timl0101 joined #salt
13:24 maspwr joined #salt
13:24 racooper joined #salt
13:25 teebes joined #salt
13:30 williamthekid_ joined #salt
13:34 dcrouch joined #salt
13:35 jslatts joined #salt
13:41 jescalan joined #salt
13:44 dcrouch_ joined #salt
13:45 DanGarthwaite joined #salt
13:51 rjc joined #salt
13:52 aranhoide joined #salt
13:53 clintberry joined #salt
13:54 sarkis joined #salt
13:55 LyndsySimon joined #salt
13:56 lvicks joined #salt
13:59 Ryan_Lane joined #salt
14:00 __number5__ joined #salt
14:02 danielbachhuber joined #salt
14:04 JasonSwindle joined #salt
14:07 timl0101 joined #salt
14:07 m_george|away joined #salt
14:13 aat joined #salt
14:21 krissaxton joined #salt
14:23 jdaggett joined #salt
14:24 santagada_ joined #salt
14:27 teskew joined #salt
14:27 krissaxton joined #salt
14:29 jescalan if you are running master or minion as a daemon, is there any way to temporarily check the log output? is there a log file somewhere you can tail?
14:29 racooper /var/log/salt/*?
14:30 jescalan ah, awesome
14:30 racooper at least on CentOS from EPEL packages that's where the logs seem to be located.
14:30 jescalan yeah found a minion file in there
14:30 jescalan thanks @racooper
14:31 jescalan one more - running master in daemon mode, is there a way to have it log output only when you run a command?
14:31 jescalan for long-running commands, like installs or downloads, it's weird to just have no output for a few minutes
14:31 jescalan would be awesome to be able to see what's going on
14:31 karlp you should be looking for logs on the minion then.
14:31 karlp there's nothing to log until theminion returns.
14:32 jescalan fair enough
14:32 krissaxton1 joined #salt
14:32 kho joined #salt
14:34 kho joined #salt
14:35 racooper Is it possible to use linux groups in client_acl, or does it have to be by user only?
14:40 jescalan @racooper, tailing the log file in /var/log/salt/minion is not giving me any output
14:41 jescalan from commands run by master
14:41 jescalan :(
14:42 bja joined #salt
14:42 racooper I'm afraid I don't know what to tell you, I haven't looked that far into it yet
14:42 jescalan no worries, thought you might know!
14:44 timl0101 joined #salt
14:45 Ahlee jescalan: I've also noticed logs not appearing in custom _modules unless I use salt builtins, but I haven't looked far enough to see if there's a logging api exposed
14:46 oz_akan joined #salt
14:46 Ahlee i.e. if i call __salt__['cmd.run']("printf %s" "foo") i'll get foo in the minion's log
14:47 Ahlee but if i print("%s" %"foo") in the _module, that will go to stdout of the minion, but not the log file
14:49 santagada joined #salt
14:52 dcrouch__ joined #salt
14:54 aat joined #salt
14:56 Teknix joined #salt
15:00 jacksontj joined #salt
15:03 Furao Ahlee: use python logging for that
15:03 Teknix joined #salt
15:03 Furao create a logger and use in your module
15:03 Furao https://github.com/bclermont/states/blob/master/states/_modules/elasticsearch_plugins.py
15:03 Furao example
15:03 Furao ahah not a good one I don't call the logger
15:04 Furao https://github.com/bclermont/states/blob/master/states/_modules/rabbitmq_plugins.py
15:05 clintberry joined #salt
15:06 ageron Hi.  I was stuck on a really weird behavior, but I just got it.  I'd like to know what you guys think about it:
15:07 ageron salt '*' cmd.run 'echo "hello world"'   => works fine
15:07 ageron salt '*' cmd.run 'echo "hello: world"  => bombs
15:09 ageron After a long investigation, I found that the arguments go through yaml.safe_load.  In the first example, the argument is not modified.  But in the second argument, the argument gets converted to this:   {'echo "hello': 'world"'}
15:10 DerekRBN That is rather odd. Thanks for the heads up
15:11 ageron So the proper way to make the second example work is this:
15:11 ageron salt '*' cmd.run '"echo \"hello: world\""'
15:11 ageron A bit complicated, don't you think?  Shouldn't there be an option to say "please parse my arguments as YAML" instead of it being automatic?
15:13 ggoZ joined #salt
15:14 ageron I think I'll file an issue for this: unless I'm mistaken, the documentation does not say that the arguments are parsed as YAML.
15:15 shocm left #salt
15:15 shocm joined #salt
15:15 teskew joined #salt
15:16 shocm left #salt
15:17 DerekRBN Thats a good idea. At least let it be known. I believe i've ran into something similar and now knowing that its parsed in yaml that was most likely the reason
15:19 jescalan joined #salt
15:20 koolhead17 joined #salt
15:20 koolhead17 joined #salt
15:20 MichaelSalty joined #salt
15:23 m_george left #salt
15:23 santagada joined #salt
15:26 faust joined #salt
15:28 abyss42 joined #salt
15:28 UtahDave joined #salt
15:29 UtahDave Good morning, everyone!
15:29 alexl joined #salt
15:31 faust hi UtahDave
15:32 faust UtahDave: is it wrong to raise an exception if something go wrong in an execution module?
15:33 UtahDave It's ok for an execution module to return a stack trace
15:33 UtahDave Optimally it would return something that explains the stack trace
15:33 UtahDave That being said, state modules should never return a stack trace
15:35 bemehow joined #salt
15:36 faust UtahDave: thank you
15:36 UtahDave you're welcome!
15:43 jdaggett joined #salt
15:45 Vivek joined #salt
15:47 scott_w joined #salt
15:47 kermit joined #salt
15:48 Gifflen joined #salt
15:51 oz_akan joined #salt
15:56 abe_music joined #salt
15:57 santagada joined #salt
15:59 mordred joined #salt
16:02 efixit joined #salt
16:02 oz_akan joined #salt
16:03 auser joined #salt
16:03 `3rdEden_ joined #salt
16:05 jlund joined #salt
16:05 bdf_ joined #salt
16:07 seubert_ joined #salt
16:08 KyleG joined #salt
16:09 jdaggett1 joined #salt
16:11 krissaxton joined #salt
16:18 jacksontj joined #salt
16:18 jlund Is there a way to batch a group of salt module commands together? I have just been writing tiny bash scripts to run them in sequence, but I was wondering if there was a better approach.
16:19 clintberry joined #salt
16:20 UtahDave jlund: yeah, just a sec
16:20 UtahDave salt '*' git.fetch,git.pull,nginx.signal "cwd=/var/git/myproject opts='--all' users=git","cwd=/var/git/myproject opts='origin master'","reload"
16:21 jlund Cool, that's good to know. Thanks!
16:21 UtahDave you're welcome!   Yeah, that comes in handy
16:23 luminous woah
16:23 luminous that is nifty
16:24 JordanRinke1 joined #salt
16:24 KyleG :D
16:24 * KyleG waves at JordanRinke1
16:24 KyleG sup broski
16:25 * luminous hands KyleG a brewski
16:25 JordanRinke1 Chillin, trying to figure out what server where I am logged in as JordanRinke, for apparently forever.
16:25 KyleG wewt thanks luminous
16:25 luminous ;)
16:26 JordanRinke1 aahh hhaaa
16:32 JasonSwindle joined #salt
16:32 ageron jlund: when using compound execution, be aware that a function will only be called once even if you list it twice (this is probably a bug, I'll file an issue).  Moreover, argument parsing is a bit weak, IMHO: in short, it's  " ".join(args).split(",").  Meaning that if one of your args has a comma in it, things will misbehave (again, probably a bug, i'll file an issue).
16:33 abe_music while i'm testing my salt states and such, is there a way that i can instruct salt to reverse everything i've done to get me back to a pristine OS?
16:33 UtahDave abe_music: you'll need to build some states that undo what your other states do
16:34 abe_music UtahDave: thought so, but just wanted to make sure there wasn't an --undo flag or something :)
16:35 krissaxton joined #salt
16:35 krissaxton left #salt
16:36 UtahDave :)
16:40 temp_ joined #salt
16:41 temp_ i have a salt state remote execution question and i haven't figured out exactly what i should be googling for
16:41 JordanRinke joined #salt
16:41 JordanRinke Found it.
16:42 lorimar joined #salt
16:42 UtahDave temp_: what are you trying to do?
16:43 temp_ if i execute a state using state.sls, the stdout/stderr is returned after the entire state execution completes
16:43 lorimar hi all. I'm just getting started with salt. I've got a master and a bunch of minions. The first thing I'm trying to do is distribute ssh_auth keys. I followed this: http://intothesaltmine.org/blog/html/2012/12/08/managing_authorized_keys_with_salt.html and it worked perfectly. Unfortunately though, I have selinux running and a restorecon needs to be run against the new authorized_keys file.
16:43 temp_ if i have a long running state, what's the best way to get access to the realtime stdout/err streams?
16:43 lorimar How would I go about adding that to my salt state?
16:44 Valdude joined #salt
16:44 UtahDave temp_: We don't yet have the ability to get the realtime streams.  We have plans for it, but it hasn't been implemented yet
16:44 bja joined #salt
16:45 temp_ ok...no wonder i haven't been able to google it! :)
16:45 temp_ another quick question...is it possible to get the stdout/err stream content into the minion log?
16:45 UtahDave lorimar: there's an selinux execution module and state
16:45 UtahDave http://docs.saltstack.com/ref/modules/all/salt.modules.selinux.html#module-salt.modules.selinux
16:46 temp_ if so, i could monitor the minion log for such content
16:46 UtahDave and http://docs.saltstack.com/ref/states/all/salt.states.selinux.html#module-salt.states.selinux
16:46 temp_ or is that semantically abusing the purpose of the minion log?
16:46 dthom91 joined #salt
16:46 UtahDave lorimar: otherwise you could just use cmd.run to do whatever you need.
16:47 UtahDave temp_: I don't see a problem with doing that.  I'm not sure if Salt streams it to the log, though
16:48 lorimar UtahDave: ah, perfect. I was looking at the module, but the state was what I needed
16:48 temp_ salt doesn't seem to put stdout/err output into the minion logs by default (although i haven't played around with log level settings)
16:51 JordanRinke1 left #salt
16:54 dlam joined #salt
16:55 JordanRinke Are there any examples of using salt to configure mysql or something similar in a master/slave configuration automatically?
16:55 jeddi joined #salt
16:55 hhtp joined #salt
16:56 luminous UtahDave: speaking of logs, is there a way you can 'tie' into the logs? say I would like to pipe the output to a zmq socket or logstash or something, separately from the file salt dumps to
16:56 jkleckner joined #salt
16:58 UtahDave luminous: I'd use a returner for that, I think
16:59 luminous UtahDave: would that be in real time, or when the minion is 'done' ?
16:59 hhtp joined #salt
17:00 UtahDave when the minion is done
17:01 luminous yea, that is fine for other things I am working towards, but not logging
17:01 UtahDave JordanRinke: I've used the mysql state quite a bit, but haven't used it for master/slave stuff
17:02 jacksontj joined #salt
17:03 santagada joined #salt
17:03 JordanRinke UtahDave: Yeah, trying to figure out how to logistically determine the association - I think I might just be wanting too much though
17:05 UtahDave seems like a mysql master/slave state and execution module would be really nice.
17:06 JordanRinke I think I need to just make an installation script that builds the cluster. salt-cloud the master, save its info, and then build a one off pillar for the slave to read to configure its relationship
17:07 pcarrier_ joined #salt
17:08 JordanRinke I will mess with it a bit later today, for no reason really - but I want to get it so a single script deploys redundant powerdns/percona name servers and a flask based restufl api for the management.
17:10 oz_akan joined #salt
17:10 UtahDave sweet
17:11 LyndsySimon joined #salt
17:12 pcarrier_ joined #salt
17:17 dthom91 joined #salt
17:20 aat joined #salt
17:21 JordanRinke I think that is my best options unless you see a better way? Build the master, build a unique pillar, and have the slave state use that matched pillar to configure the slave
17:23 LyndsySimon joined #salt
17:23 UtahDave Yeah, that would work. You could have the slave query the peer interface for a mysql master and then attempt to connect, but I'm not sure you'd be able to provide all the correct information dynamically.
17:23 UtahDave I've never set up a master/slave with mysql, so I don't know all that it entails
17:25 JordanRinke Fortunately just a master/slave is super easy to setup
17:25 JordanRinke enable binary logging, enable replication
17:25 sebgoa joined #salt
17:25 JordanRinke tell the slave to do the same, and where to pull it from
17:25 JordanRinke No crazy stuff like master/master where you have to synchronize the position or anything
17:25 baniir joined #salt
17:26 jescalan hey @utahdave - still can't figure out how to get salt.states.rbenv working over here :D
17:30 UtahDave jescalan: have you asked on the mailing list yet?  I'll find out who contributed the rbenv state and ping him or her
17:30 jescalan i have not, let me check this out
17:32 UtahDave yeah, send an email and I'll ping the original authoer. He's in the UK
17:33 jescalan Sweet, sounds good - will do!
17:34 jescalan is it legit to run something like
17:34 jescalan cmd.run:
17:34 jescalan - names:
17:34 jescalan - first_command
17:34 jescalan - second_command
17:34 jescalan etc
17:35 jescalan i've seen someone put this in a script before
17:36 aat joined #salt
17:36 austin987 joined #salt
17:38 santagada joined #salt
17:41 UtahDave jescalan: I'm not sure.
17:41 Ryan_Lane joined #salt
17:41 UtahDave i'm not seeing a names option in the cmd state
17:42 karlp did you mean legit as in, "is this a good idea" or legit as in, "is this legal syntax" ?
17:47 juanlittledevil joined #salt
17:50 LyndsySimon joined #salt
17:58 efixit joined #salt
17:59 DredTiger joined #salt
18:01 pmcg joined #salt
18:01 jlund Is there any way to ensure that states get executed in the order they are placed in in the Top file?
18:02 jlund I just want to make sure I'm not missing something.
18:02 jacksontj joined #salt
18:02 dthom91 joined #salt
18:04 UtahDave no
18:04 jlund UtahDave: Didn't think so. Luckily I have my Require chains already working.
18:05 UtahDave good
18:10 santagada joined #salt
18:13 afx_hero joined #salt
18:13 afx_hero joined #salt
18:16 afx_hero left #salt
18:17 jalbretsen joined #salt
18:17 jdenning joined #salt
18:18 jdenning Is anyone using the event system in python code?
18:19 juanlittledevil joined #salt
18:19 jdenning I have some very simple code that should listen for any events on the master and print the data, but when I fire the events, my code does not seem to detect anything.
18:20 jdenning Shouldn't this code detect any event on the master?  (Code is running on master) :
18:20 jdenning import salt.utils.event
18:20 jdenning event = salt.utils.event.MasterEvent('/var/run/salt/master')
18:20 jdenning for data in event.iter_events():
18:21 jdenning print(data)
18:21 jschadlick joined #salt
18:21 jdenning I can see the events fire off in the master's log, but my python code just waits forever.
18:22 jdenning I am firing events like so:
18:22 jdenning salt 'minion1' event.fire_master 'test event 1' 'test'
18:22 jdenning I have also tried:
18:22 jdenning salt 'minion1' event.fire 'test event 1' 'test'
18:23 jdenning neither seems to work..any help would be greatly appreciated!
18:28 bja joined #salt
18:28 jescalan joined #salt
18:28 aranhoide joined #salt
18:35 alekibango joined #salt
18:40 jacksontj joined #salt
18:42 santagada joined #salt
18:43 maspwr joined #salt
18:56 bemehow joined #salt
18:57 jschadlick joined #salt
19:02 jescalan @utahdave just sent it to the mailing list
19:13 LyndsySimon joined #salt
19:15 santagada joined #salt
19:15 jschadlick Hi, I am trying to implement a way of targeting hosts by currently defined roles. Is there any a commonly implemented solution to this in Salt?
19:18 jrgifford_ joined #salt
19:22 jdaggett joined #salt
19:26 zooz joined #salt
19:31 LyndsySimon joined #salt
19:32 jdaggett joined #salt
19:37 billyw joined #salt
19:39 jdaggett joined #salt
19:46 giantlock joined #salt
19:46 MK_FG joined #salt
19:48 santagada joined #salt
19:50 fredvd joined #salt
19:53 oz_akan joined #salt
19:57 bemehow joined #salt
20:01 Chocobo So if you are adding a module to an sls file, how can you find a list of valid states?
20:02 Chocobo for example: salt.modules.pkg
20:09 austin987 joined #salt
20:11 jkleckner joined #salt
20:14 jdenning Anybody using the Event system?
20:16 danielbachhuber joined #salt
20:18 danielbachhuber- joined #salt
20:21 santagada joined #salt
20:22 bja joined #salt
20:24 danielbachhuber joined #salt
20:26 baniir joined #salt
20:26 jkleckner joined #salt
20:26 baniir when a compound grain match is made are simpler grain matches ignored?
20:35 sebgoa joined #salt
20:49 JasonSwindle joined #salt
20:53 santagada joined #salt
20:53 JasonSwindle Can a Salt Module get used in a Salt State?  Example: http://docs.saltstack.com/ref/modules/all/salt.modules.djangomod.html#module-salt.modules.djangomod
20:55 racooper Is there an example somewhere of the syntax for using the yumpkg module's pkg.group_install in a .sls file?
20:55 bja left #salt
20:56 ragnar0k joined #salt
21:02 jacksontj i just noticed that fqdn isn't returning the fqdn (in grains). it has the short name, and the append_domain value is set, but fqdn doesn't have it-- is there a new value which has the fqdn?
21:02 clintberry joined #salt
21:05 robinsmidsrod joined #salt
21:05 mperry__ can i specify a grain to match against in a config set that isn't in the topfile?
21:05 jacksontj nvm, looks to be an old config on the host
21:05 mperry__ for example if dns.sls is included, i want to do different things for redhat vs debian systems
21:05 mperry__ can't seem to get the grain targeting working though
21:08 mperry__ ah i need templates for it. silly me, its right in the tutorial
21:13 __gotcha joined #salt
21:13 __gotcha joined #salt
21:20 timl0101 joined #salt
21:23 bemehow_ joined #salt
21:24 UtahDave joined #salt
21:30 timl0101 joined #salt
21:32 DerekRBN joined #salt
21:42 auser joined #salt
21:44 auser hey all
21:45 JordanRinke hello
21:51 danielbachhuber joined #salt
21:54 chrisgilmerproj joined #salt
21:57 UtahDave joined #salt
22:10 JordanRinke joined #salt
22:14 jkleckner1 joined #salt
22:15 terminalmage joined #salt
22:16 terminal1 joined #salt
22:17 terminal1 joined #salt
22:21 sarkis joined #salt
22:22 terminalmage joined #salt
22:23 dcrouch joined #salt
22:24 jlund How do you conditionally run a state only if another state has changed? Like if I want to touch a file, but only if another file has changed?
22:24 auser jlund: cmd.wait will do that for you
22:24 jlund The file module does not appear to implement mod_watch.
22:25 jescalan joined #salt
22:25 auser cmd: does
22:25 auser lemme get you an example
22:25 jlund auser: Thanks
22:25 auser sure
22:27 auser jlund: https://gist.github.com/auser/5761313
22:28 aat joined #salt
22:28 kermit joined #salt
22:29 jlund auser: Excellent. Thank you so much!
22:29 auser np jlund
22:32 efixit joined #salt
22:41 bemehow joined #salt
22:43 herlo joined #salt
22:43 triad joined #salt
22:44 krissaxton joined #salt
22:44 triad2 joined #salt
22:44 herlo joined #salt
22:45 elements joined #salt
22:46 triad2 Anyone know any options for installing SaltStack without an internet connection?
22:47 morganfainberg left #salt
22:48 canci_ triad2: If you are on ubuntu/debian you could probably download the debs from the repository and copy those to the machine where you want to install offline
22:49 raz joined #salt
22:58 triad2 I am on Ubuntu. I'll try that but it looks like I have to figure out the dependencies first
22:58 triad2 Thanks
23:02 mikedawson joined #salt
23:03 raz joined #salt
23:08 adotbrown joined #salt
23:13 aat joined #salt
23:15 luminous if you create a modules/foo.py and stick some callables in there, do you need to do anything before that module is available?
23:15 luminous available to be used with salt 'host' foo.bar ?
23:16 luminous I've run  salt 'host' saltutil.sync_modules   but this hasn't changed anything
23:17 UtahDave restarting the minion will cause it to reload all the modules
23:17 UtahDave but you should probably
23:17 UtahDave put the module in /srv/salt/_modules
23:17 UtahDave and then run saltutil.sync_modules
23:18 luminous I've only been fiddling with this on the master
23:18 luminous and have added to salt/modules/
23:18 admineric joined #salt
23:19 luminous OH i see
23:19 luminous _modules is the file_roots version, salt/modules is the package..
23:19 luminous silly me
23:19 cxz joined #salt
23:20 UtahDave yes, the salt master won't distribute modules in salt/modules
23:20 UtahDave only ones in /srv/salt/_modules
23:20 luminous arg, still no go
23:20 admineric Anyone know how to call a salt.runner from salt web api?
23:21 luminous UtahDave: I can fiddle with this some more, but maybe you can confirm.. are we limited to foo.bar? or can you have foo/bar.py such that you are then calling foo.bar.baz?
23:21 luminous does _modules need an __init__.py?
23:22 Nazca joined #salt
23:22 luminous admineric: I think I saw mention of that as needing to be explicitly supported, but that it isn't yet
23:23 luminous but I'm not 100% sure on that
23:24 luminous >.<
23:24 chrisgilmerproj left #salt
23:24 adotbrown joined #salt
23:26 aat joined #salt
23:28 UtahDave luminous: yeah, I think you do that.  The rh_ip module has sub directories
23:28 bemehow joined #salt
23:28 admineric Is there any equivalent salt module to jobs.lookup_jid?
23:28 UtahDave admineric: have you looked in saltutil.py?
23:29 UtahDave whiteinge: how do you call runner from the salt-api?  Don't you have to set the client to runner or something?
23:29 luminous ah yes.. look at that. being the only one I overlookded that
23:30 whiteinge yeah client='runner'
23:30 luminous I assume you should see some modules sync'd in the output from saltutil.sync_modules/
23:31 whiteinge admineric: there's also a convenience URL for looking up jobs specificially
23:31 whiteinge http://salt-api.readthedocs.org/en/latest/ref/netapis/all/saltapi.netapi.rest_cherrypy.html#get--jobs-(jid)
23:32 admineric Awesome, thank you
23:32 luminous AH!
23:32 whiteinge curl -sS localhost:8000 -H 'Accept: application/x-yaml' -d client='runner' -d fun='jobs.lookup_jid' -d jid='20130508110452079648'
23:32 whiteinge admineric: ^^
23:32 luminous I was putting _modules in /etc/salt/   not /etc/salt/states >.<
23:33 UtahDave doh!
23:33 luminous yep
23:33 whiteinge admineric: the thing to watch out for when calling runner function is the arguments are not named 'arg' but rather the arg names are specific to what function you're calling.
23:33 whiteinge as in the example above
23:33 luminous though, interestingly enough.. the foo.ping works, but foo.bar.ping is "not available" though it was sync'd
23:34 admineric I see, good to know
23:36 luminous when would you want to use a runner over a regular module?
23:37 sarkis joined #salt
23:37 sarkis joined #salt
23:39 UtahDave luminous: a runner is executed on the master, as opposed to execution modules that run on the minions
23:39 APLU joined #salt
23:39 jesusaurus can i not use file.append on a non-existent file?
23:39 jesusaurus how can i create an empty file if it doesnt exist and leave it alone if it does?
23:40 UtahDave several of those file module functions have a replace: False option
23:40 UtahDave so it will only take effect if the file doesn't exist.
23:41 luminous UtahDave: AH! I might submit a pull request for adding that detail..
23:42 juanlittledevil joined #salt
23:43 juanlittledevil howdy
23:43 jesusaurus oh, theres a file.touch
23:43 jesusaurus thats works
23:44 juanlittledevil I've got a question for you gurus…. I've got this on my minion:
23:44 juanlittledevil grains:
23:44 juanlittledevil roles:
23:44 juanlittledevil - dbserver
23:44 juanlittledevil - backupserver
23:44 juanlittledevil - prod
23:44 juanlittledevil and I see it on my master:
23:45 juanlittledevil [root@salt salt]# salt '*db*' grains.item roles
23:45 juanlittledevil budb0.sjco.creditkarma.com:
23:45 juanlittledevil roles:
23:45 juanlittledevil dbserver
23:45 juanlittledevil backupserver
23:45 juanlittledevil prod
23:45 krissaxton joined #salt
23:45 juanlittledevil this on my top.sls
23:45 juanlittledevil prod:
23:45 juanlittledevil 'roles:prod':
23:45 juanlittledevil - match: grain
23:45 juanlittledevil - core
23:45 juanlittledevil - prod
23:45 juanlittledevil one of my __env__
23:46 juanlittledevil however. highstate is not seeing this grain.
23:46 juanlittledevil [root@salt salt]# salt '*db*' state.highstate
23:46 juanlittledevil budb0.sjco.creditkarma.com:
23:46 juanlittledevil ----------
23:46 juanlittledevil State: - no
23:46 juanlittledevil Name:      states
23:46 juanlittledevil Function:  None
23:46 juanlittledevil Result:    False
23:46 juanlittledevil Comment:   No states found for this minion
23:46 juanlittledevil Changes:
23:46 juanlittledevil any ideas?
23:46 juanlittledevil I'm at a loss. ;(
23:52 jdaggett joined #salt
23:52 adotbrown joined #salt
23:53 btanaka joined #salt
23:59 juanlittledevil joined #salt

| Channels | #salt index | Today | | Search | Google Search | Plain-Text | summary