Perl 6 - the future is here, just unevenly distributed

IRC log for #salt, 2014-11-02

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

All times shown according to UTC.

Time Nick Message
00:02 jalbretsen joined #salt
00:13 hgl joined #salt
00:21 hgl joined #salt
00:22 X86BSD joined #salt
00:23 mapu joined #salt
00:31 madsollll joined #salt
00:31 mapu joined #salt
00:31 bcode joined #salt
00:35 mgw joined #salt
00:35 mapu_ joined #salt
00:43 TyrfingMjolnir joined #salt
00:45 mapu joined #salt
00:48 halfss joined #salt
00:53 aquinas joined #salt
00:53 mapu joined #salt
00:55 pantato joined #salt
00:55 pantato left #salt
01:02 favadi_ joined #salt
01:18 mapu joined #salt
01:23 yomilk joined #salt
01:27 mapu joined #salt
01:28 ckao joined #salt
01:29 dude051 joined #salt
01:35 hgl joined #salt
01:35 glyf joined #salt
01:36 cads joined #salt
01:41 hgl joined #salt
01:44 smcquay joined #salt
01:47 bhosmer joined #salt
01:53 meylor joined #salt
01:59 Cottser Maybe I'm barking up the wrong tree but trying to grab a value from a list in a pillar and feeling a bit stuck. It's a MySQL password, using the mysql-formula: https://gist.github.com/Cottser/f5fe9d3d3231c2da89ad
01:59 Cottser Gist lists out a couple things I've tried
02:04 hellome joined #salt
02:12 halfss joined #salt
02:14 meylor joined #salt
02:16 mgw joined #salt
02:17 anotherZero joined #salt
02:20 yomilk joined #salt
02:21 meylor joined #salt
02:23 pdayton joined #salt
02:27 Blizzy joined #salt
02:27 Blizzy left #salt
02:28 tf198_ joined #salt
02:39 halfss joined #salt
02:41 Wagahai joined #salt
02:46 Cottser Hacky goodness: https://gist.github.com/Cottser/f5fe9d3d3231c2da89ad#comment-1329778
02:56 Mso150_e joined #salt
02:59 blake joined #salt
03:04 anotherZero joined #salt
03:08 racooper joined #salt
03:15 yetAnotherZero joined #salt
03:24 rojem joined #salt
03:24 snuffeluffegus joined #salt
03:35 bhosmer joined #salt
03:39 Mso150_e joined #salt
03:45 tmh1999 joined #salt
03:50 aquinas joined #salt
04:17 tligda joined #salt
04:17 TheThing joined #salt
04:20 Mso150_e_i joined #salt
04:21 tligda joined #salt
04:24 BCC9518C23DDE4FA joined #salt
04:26 elfixit joined #salt
04:32 BCC9518C23DDE4FA joined #salt
04:49 TrafficMan joined #salt
05:09 halfss joined #salt
05:09 bhosmer joined #salt
05:14 ndrei joined #salt
05:20 kermit joined #salt
05:21 Mso150_e_i joined #salt
05:21 amar joined #salt
05:23 amar left #salt
05:24 bhosmer joined #salt
05:27 Ryan_Lane joined #salt
05:40 ggillies joined #salt
05:53 Mso150 joined #salt
05:56 ajolo joined #salt
06:00 Ryan_Lane joined #salt
06:17 yomilk joined #salt
06:21 debian112 joined #salt
06:27 smcquay joined #salt
06:31 aquinas joined #salt
06:44 Ryan_Lane joined #salt
06:49 crocket left #salt
07:06 TheThing joined #salt
07:09 Mso150 joined #salt
07:11 Emantor joined #salt
07:13 bhosmer joined #salt
07:29 Mso150 joined #salt
07:32 TheThing joined #salt
07:33 felskrone joined #salt
07:46 packeteer joined #salt
07:50 yomilk joined #salt
07:52 uber joined #salt
08:10 halfss joined #salt
08:23 agend_ joined #salt
08:29 glyf joined #salt
08:32 yomilk joined #salt
09:02 bhosmer joined #salt
09:33 Mso150_a joined #salt
09:37 asmaps joined #salt
09:47 CeBe joined #salt
09:52 glyf joined #salt
10:03 yomilk joined #salt
10:07 bhosmer joined #salt
10:11 alex-mesos joined #salt
10:13 monkey661 joined #salt
10:33 the_drow joined #salt
10:51 bhosmer_ joined #salt
11:06 ericof joined #salt
11:12 yomilk joined #salt
11:36 nickjj joined #salt
11:42 glyf joined #salt
11:45 CeBe1 joined #salt
11:46 ndrei joined #salt
11:55 halfss joined #salt
12:05 CeBe1 joined #salt
12:10 ericof joined #salt
12:19 ericof joined #salt
12:29 glyf joined #salt
12:31 glyf joined #salt
12:40 bhosmer_ joined #salt
12:44 tillo joined #salt
12:46 tillo Hi! I'm new to salt and I'm trying to understand if a minion can be managed by two completely different masters; I have a bunch of servers I'd like to lightly manage with salt, but some are already partly managed with it by third parties. Can this be done?
12:48 tillo I don't have access to their master and viceversa, by the way, but that could be arranged.
12:57 ndrei joined #salt
12:59 teebes joined #salt
13:07 bhosmer joined #salt
13:08 glyf joined #salt
13:17 diegows joined #salt
13:30 glyf joined #salt
13:30 thayne joined #salt
13:37 mapu joined #salt
14:00 gyre007 joined #salt
14:00 gyre007 hey everyone...salt n00b here...
14:01 gyre007 so I'm rading about top files...
14:01 mgw joined #salt
14:01 gyre007 http://docs.saltstack.com/en/latest/ref/states/top.html
14:01 gyre007 can someone tell me where should the top file be present ? On master ? on Minion ?
14:01 gyre007 im so confused...
14:03 mdasilva joined #salt
14:05 the_drow The top file should be present on the master unless you're working masterless
14:05 gyre007 or both ?
14:05 gyre007 the_drow: does this have to be specified in /etc/salt/master configuration file ?
14:05 the_drow There's a default location for the top file
14:05 the_drow If you want another location then yes
14:06 gyre007 one thing im seeing in both maste and minion config files
14:06 gyre007 is the mention of the top file content
14:07 gyre007 what happens if this stuff is set on both ?
14:07 gyre007 as like file_roots etc...
14:11 viq joined #salt
14:11 babilen gyre007: It doesn't matter unless you configure the minion to run in "file_client: local" mode
14:12 babilen (which is when the minion will run masterless and then the master's settings don't matter)
14:12 gyre007 if its set to remote
14:12 gyre007 then the config is taken from master?
14:13 yomilk joined #salt
14:14 babilen gyre007: Then the minion will communicate with the master, yes.
14:14 gyre007 cool
14:14 gyre007 thanks
14:14 babilen You are welcome :)
14:20 gyre007 also babilen what is the path to top.sls .... is it in /srv/salt/top.sls ?
14:21 gyre007 so if I get this right, file_roots allows you to specify the paths to your envs and formulas/states...
14:21 gyre007 now you need to tell the minion where to find the top.sls file
14:21 gyre007 so it knows which states it should apply right ?
14:21 ndrei joined #salt
14:27 ndrei_ joined #salt
14:29 bhosmer_ joined #salt
14:30 dude051 joined #salt
14:30 babilen gyre007: It is /srv/salt/top.sls and you don't have to tell the minion anything about that. You just tell it how to contact the master (i.e. you set "master: ADDRESS_OF_THE_MASTER" (if "salt" doesn't resolve to that))
14:31 babilen The top.sls assigns states to minions and the minion doesn't "request" states.
14:37 glyf joined #salt
14:44 teebes joined #salt
14:46 ilbot3 joined #salt
14:46 Topic for #salt is now Welcome to #salt | 2014.1.13 is the latest | Help us test the 2014.7 RC! http://bit.ly/salt-rc | Please be patient when asking questions as we are volunteers and may not have immediate answers | Channel logs are available at http://irclog.perlgeek.de/salt/
14:46 Bremsstrahlung joined #salt
14:46 teebes joined #salt
14:48 bhosmer joined #salt
14:56 yomilk joined #salt
14:56 Jimlad joined #salt
15:00 murrdoc joined #salt
15:07 n8n joined #salt
15:12 bhosmer joined #salt
15:19 dupont-y joined #salt
15:29 Jimlad hello all, can anyone tell if there is a module for spinning up jails on freebsd? or suggest how it can/should be done?
15:40 ndrei joined #salt
15:40 ndrei_ joined #salt
15:42 n8n joined #salt
15:43 GothAck joined #salt
15:50 blake joined #salt
15:52 rojem joined #salt
16:04 btmiller joined #salt
16:17 bhosmer joined #salt
16:21 ndrei joined #salt
16:24 ndrei_ joined #salt
16:27 ndrei joined #salt
16:38 b1nar1 joined #salt
16:43 rojem joined #salt
16:45 diehard joined #salt
16:49 babilen Jimlad: http://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.freebsdjail.html
16:52 rojem joined #salt
16:55 gngsk joined #salt
16:55 dalibro joined #salt
16:56 ndrei joined #salt
16:56 ndrei_ joined #salt
16:57 bhosmer joined #salt
17:06 dalibro joined #salt
17:06 alex-mesos joined #salt
17:11 nampham_1 joined #salt
17:15 rojem joined #salt
17:16 bhosmer joined #salt
17:19 the_lalelu joined #salt
17:20 ckao joined #salt
17:20 blackhelmet joined #salt
17:20 nocturn joined #salt
17:20 borgstrom joined #salt
17:20 CSa joined #salt
17:20 A||SySt3msG0 joined #salt
17:20 jacksontj joined #salt
17:20 patarr joined #salt
17:20 cofeineSunshine joined #salt
17:32 halfss joined #salt
17:33 ggoZ joined #salt
17:38 b1nar1 joined #salt
17:56 Ixan joined #salt
18:06 bhosmer joined #salt
18:09 cberndt joined #salt
18:12 alex-mesos joined #salt
18:13 ekristen joined #salt
18:15 teebes joined #salt
18:16 thekabal joined #salt
18:18 snuffeluffegus joined #salt
18:19 thekabal I am trying to define a custom grain, which is a python script defining a ‘function’, and I have placed the script in /srv/salt/prod/_grains , given full permissions, and then I ran salt ‘minion’ saltutil.sync_grains, but salt ‘minion’ grains.item pg_server does not return a result. What am I doing wrong?
18:22 thekabal The grain definition is here: http://pastebin.com/QFNcUTE6
18:27 babilen thekabal: I'd strongly suggest to use a less horrible pastebin in the future (e.g. http://refheap.com, http://paste.debian.net, http://bpaste.net, http://gist.github.com, ...)
18:27 babilen thekabal: What is "command" ?
18:27 babilen You probably want to run the minion in debug mode to sort this out. To do so start it as "salt-minion -ldebug"
18:28 babilen Also your indentation seems to be off by one space
18:29 babilen In fact it is all over the place (4 on line 3, 3 on line 10, 4 thereafter, ...)
18:30 babilen And are you sure that you want that grain to have a value of string and list (depending on the number of matches) ? I would consider that to be extremely awkward and unintuitive.
18:31 thekabal Heh, wow. AWESOME feedback!
18:32 thekabal I inherited this script, and I’m trying to even get it to work, because in my envionment it does not
18:32 thekabal I ‘m not sure what the command bit is, I assumed it was a salt-ism
18:33 thekabal Weird on the indention, the original is consistently 4 spaces
18:33 thekabal Guess its pastebin being terrible. Lemme try one of the ones you suggested
18:34 goodwill joined #salt
18:34 diegows joined #salt
18:35 babilen command doesn't come out of nowhere. If you want to use it you will have to import it (nor am I familiar with it in the context of salt, but the codebase is huge)
18:35 thekabal Indeed, this looks better: http://paste.debian.net/129856/
18:35 babilen But then I can't find a single mention of command.run in the sourcecode.
18:36 thekabal Okay, is there a different way to accomplish that same thing without command.run ? Essentially, what the aim is, is that on machines that have the rpm postgresql*-server installed, I get a grain I can match against
18:37 thekabal (For use in init & top files)
18:38 babilen Take a look at https://github.com/saltstack/salt/blob/develop/salt/grains/core.py#L34 which allows you to use "__salt__['cmd.run'](...)
18:39 thekabal Ooo, many thanks
18:39 babilen But then I'd just use http://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.yumpkg.html#salt.modules.yumpkg.version
18:40 babilen I guess you have to import that too. Not quite sure (as there is some funky monkey patching going on behind the scenes)
18:41 babilen And I really wouldn't conditionally return the version string or a list. Always return a list and let the user of the grain deal with the case that multiple versions are installed (can that actually happen?)
18:42 babilen The problem is that yumpkg might actually require grains to already be available (which is the chicken and egg problem referenced earlier)
18:43 srage joined #salt
18:43 thekabal I’m a little lost :)
18:44 thekabal I tried adding in the __salt__ definitions from the core.py that you referenced
18:44 babilen https://github.com/saltstack/salt/blob/develop/salt/modules/yumpkg.py#L371 just calls https://github.com/saltstack/salt/blob/develop/salt/modules/pkg_resource.py#L145
18:44 ndrei joined #salt
18:44 ndrei_ joined #salt
18:44 babilen thekabal: Well, lets get you running with cmd.run first
18:44 thekabal And then rewrote that command.run part to use __salt__[‘cmd.run’], but still no joy
18:44 thekabal Yeah, did that and didn’t work
18:44 babilen What is the debug output on the minion?
18:44 thekabal Its very noisy
18:44 thekabal :)
18:45 babilen And please don't use [‘cmd.run’] but ['cmd.run']
18:45 thekabal I literally don’t see what is different between those two
18:45 thekabal This? pgrpmlist = __salt__['cmd.run']("rpm -qa postgresql*-server")
18:46 thekabal Oh, now I see, horrid chat font
18:46 babilen Ah, it might be your IRC client being awkward
18:46 thekabal Yeah, I used single quote
18:46 thekabal Not backtickl
18:47 thekabal When I trigger the sync, it shows handling event, and then lists a bunch of “loaded X as Y
18:47 thekabal But pgserver is NOT in the list
18:47 thekabal (The minion debug)
18:47 babilen Okay, could you restart the minion and paste the current grain in its entirety?
18:47 thekabal Sure!
18:48 babilen You typically also get information about errors in the minion debug log, but they might be easy to miss due to it being rather chatty.
18:49 thayne joined #salt
18:50 thekabal Grain: http://paste.debian.net/129861/ and the output from minion in debug: http://paste.debian.net/129863/
18:51 babilen thanks
18:51 srage_ joined #salt
18:51 aquinas joined #salt
18:52 babilen thekabal: fwiw, I wouldn't return None, but {'pg_server': []} in the "no pg server installed" case
18:52 thekabal grep -i "pg_se" /var/log/salt/minion has no results
18:52 thekabal (script name is pg_server.py)
18:53 babilen Oh, and don't have the "import salt.modules.cmdmod" there, but in at the beginning (after the shebang)
18:53 babilen Is the script executable?
18:53 thekabal Roger on both changes, and yes
18:54 thekabal http://paste.debian.net/129866/
18:54 babilen And you have it in /var/cache/salt/minion/extmods/grains/ on the minion?
18:54 thekabal Doh, I did that wrong, hehe
18:55 babilen (adjust indentation, you also want one more level for the key/value pairs in the dictionary)
18:56 babilen Ah, you have to import the re module too (that might be the error)
18:56 thekabal http://paste.debian.net/129869/
18:56 thekabal I don’t understand what you mean in “one more level for the key/value pairs"
18:57 thekabal I mean, I understand k/v pairs, but I don’t see where in the code that it
18:58 thekabal And no, this is on the master under /srv/salt/prod/_grains , I need to be able to have it hosted there as opposed to on the minions if possible (or I have to set it as a deployment)
18:58 babilen http://paste.debian.net/129872/
18:58 babilen Once you run sync_grains it should appear in /var/cache/salt/minion/extmods/grains/ on the minion
18:59 thekabal Traceback (most recent call last):
18:59 thekabal File "./pg_server2.py", line 8, in <module>
18:59 thekabal 'cmd.retcode': salt.modules.cmdmod._retcode_quiet,
18:59 thekabal AttributeError: 'module' object has no attribute '_retcode_quiet'
18:59 thekabal When I ran your version
19:00 babilen http://paste.debian.net/129875/
19:00 babilen Okay, remove those lines (we don't need those anyway)
19:00 babilen (that is line 8 and 9)
19:01 thekabal Roger that! That cleans the output. Now to test syncing..
19:02 thekabal The folder /var/cache/salt/minion/extmods only contains “modules” after sync. No grains dir.
19:03 babilen Where did you place this grain on the master? What is the output of that "salt '*' saltutil.sync_grains" run?
19:03 thekabal salt 'odin' saltutil.sync_grains
19:03 thekabal odin:
19:04 thekabal pwd
19:04 babilen Could you paste your master's config too?
19:04 thekabal Sure!
19:04 babilen Sorry, just want to make sure that /srv/salt/prod is configured correctly in there
19:05 jab416171 joined #salt
19:06 babilen And then, please run "salt-run fileserver.update" and "salt 'odin' saltutil.sync_all" and paste the output of that along with that of "salt 'odin' grains.item pg_server'" and "salt 'odin' cmd.run 'ls -la /var/cache/salt/minion/extmods/grains/'"
19:08 babilen (don't forget to restart your minion)
19:09 thekabal http://paste.debian.net/129883/ (But do keep in mind that we have a symlink from /srv -> /mnt/data/salt/srv , so that may be a little confusing at first.
19:09 aquinas_ joined #salt
19:10 thekabal The output is odin: — grains: modules: outputters: renderers: returners: states:
19:10 aquinas_ joined #salt
19:10 thekabal (hand typed without newlines to avoid paste throttle in channel) :)
19:10 babilen You would have to place it in /srv/salt/_grains based on that configuration (and why do you differentiate between base and prod?)
19:11 thekabal Oh interesting!
19:11 babilen Ah, disregard that
19:12 babilen No, that's cool. Not too sure about base = prod = prod, but meh
19:13 glyf joined #salt
19:13 thekabal That came about because we needed to cross-target from one env level to another (say, dev -> prod), when we REALLY shouldn’t be doing that %$*^, but .. ours is not to reason why, ours is but to do what the PHB tells us right away
19:13 thekabal :P
19:13 thekabal That was the ‘easy’ way around that. I hate it, and one day very soon I’ll rip it out.
19:14 thekabal Moved it to /srv/salt/_grains, redid the sync, no joy, nothing in extmods
19:15 babilen Sure, sorry. It just confused me for a second. No, the /srv/salt/_grains thing was due to me not looking at the correct file_roots block
19:15 thekabal OH, so it should be back where it was?
19:15 babilen yes, sorry
19:15 babilen "Ah, disregard that"
19:15 thekabal K, moving it now
19:16 blackhelmet joined #salt
19:16 babilen So, you have it in /mnt/data/salt/srv/salt/prod/_grains/pg_version.py now, it is executable, you restarted both master and minion, ran "salt-run fileserver.update" and "salt 'odin' saltutil.sync_all" and it still doesn't appear in /var/cache/salt/minion/extmods/grains/ on the minion?
19:16 mdasilva joined #salt
19:18 alex-mesos joined #salt
19:18 patarr joined #salt
19:18 patarr joined #salt
19:18 mgw joined #salt
19:19 A||SySt3msG0 joined #salt
19:19 thekabal It appears that now therer are new things in that directory
19:19 thekabal But not grains
19:20 borgstrom joined #salt
19:20 nocturn joined #salt
19:21 ckao joined #salt
19:21 thekabal But I followed all the rest you posted, although the grain file name is pg_server.py , instead of pg_version.py
19:21 halfss joined #salt
19:21 babilen Right, sure. (doesn't really matter anyway)
19:22 thekabal I always feel like I’m SO close and just missing one tiny thing but can never find it. :(
19:22 babilen I wonder if there is still something in that code that causes salt to be unable to load it. You might want to start the master with "-ldebug" and check for stacktraces)
19:22 thekabal Ok!
19:22 babilen It's a bit late for me, but I'll happily look at this again tomorrow again and try it in my vagrant/kvm setup.
19:23 alex-mesos joined #salt
19:23 thekabal No stacktraces in startup in debug mode
19:23 thekabal Many thanks for taking a look so far. I appreciate it.
19:23 thekabal Enjoy your evening/sleep
19:24 babilen I will, all the best. Feel free to ping me tomorrow
19:48 thekabal AHA! I have just learned that there is an incredibly handy function that already does what I was trying to do in a custom grain! salt ‘minion’ postgres.version gives just what I need
19:49 thekabal Now how to convert that into a grain match..
19:51 thekabal Any clues on how to match against the return from postgres.version in a top or init.sls ?
19:53 dalibro joined #salt
19:54 Mso150_a joined #salt
19:55 bhosmer joined #salt
19:55 pd joined #salt
20:05 diegows joined #salt
20:12 Leonw joined #salt
20:15 dupont-y joined #salt
20:16 hintss joined #salt
20:16 b1nar1 joined #salt
20:17 thekabal Trying to get a conditional that says “if rpm for postgres*-server* is installed”, then do stuff. salt ‘minion’ postgres.version looks perfect, but I can’t seem to make a conditional from it
20:17 thekabal Anyone?
20:18 alex-mesos joined #salt
20:19 glyf joined #salt
20:37 mdasilva_ joined #salt
20:38 pd left #salt
20:41 Ryan_Lane joined #salt
20:49 anotherZero joined #salt
20:52 glyf joined #salt
20:59 thekabal pgrpmlist = __salt__['cmd.run']('rpm -qa postgresql*-server')
20:59 thekabal KeyError: 'cmd.run'
20:59 thekabal Why does that stack trace error?
21:02 alex-mesos joined #salt
21:05 alex-mesos joined #salt
21:05 viq joined #salt
21:06 X86BSD joined #salt
21:06 Gareth thekabal: looks like the cmd module isn't registering on your system for some reason.  What does the rest of that code look like?
21:07 Mso150_a joined #salt
21:07 thekabal Gareth> http://paste.debian.net/129907/
21:08 thekabal The items on line 21-23 (__salt__ definition) is from https://github.com/saltstack/salt/blob/develop/salt/grains/core.py
21:09 pdayton joined #salt
21:09 Gareth looks like it *should* work.
21:10 thekabal Yeah, that is what I thought as well
21:10 thekabal But it no worky (highly technical term)
21:10 halfss joined #salt
21:11 X86BSD joined #salt
21:12 Gareth thekabal: have you tried logging the contents of __salt__ right before that call?
21:12 thekabal No
21:12 thekabal I am extremely limited in my knowledge of Python
21:13 thekabal Gareth> This is the complete error in the minion log: http://paste.debian.net/129909/ , how would I log the contents of __salt__ ?
21:13 Gareth one sec.
21:13 Gareth import logging
21:13 Gareth log = logging.getLogger(__name__)
21:14 Gareth then before your call, put log.debug('__salt__ {0}'.format(__salt))
21:15 lopezio hi there.. anyone using the orchestrator here? i'm prototyping a few orchestrator states, but it seems that my custom _grains and pillar modules ar not available.. i do salt-run state.orch orch.my_orchstate test=True and it is telling me that the grain i use is not available, as well as the external pillars.. any hint
21:16 Gareth brb
21:16 thekabal Just so I’m clear, I add the log.debug insinde the __salt__ definition, or down before pgrpmlist >
21:18 thekabal Gareth> Upon your return, it gives this now: NameError: global name '__salt' is not defined
21:25 Gareth thekabal: sorry. my fault.  the bit inside format should be __salt__
21:26 BossR Question: Due to the incompentancies of another company... I am stuck with Saltstack and things are fucked - would anyone here be interested in making some cash today to complete a web/app cluster and make sure it is working?
21:26 BossR I thought I would offer before I blow the whole thing away and go with puppet
21:28 thayne joined #salt
21:32 pdayton joined #salt
21:35 MugginsM joined #salt
21:35 otter768 joined #salt
21:39 thekabal Gareth> No worries. With that change, it goes back to KeyError: 'cmd.run'
21:39 pdayton joined #salt
21:43 jalaziz joined #salt
21:43 Gareth thekabal: anything in the minion log?
21:44 bhosmer joined #salt
21:44 Gareth thekabal: make sure you're running it with debuging on.  eg. salt-minion -l debug
21:44 crevetor joined #salt
21:45 crevetor Hi guys, I'm trying to deploy machines using salt-cloud and the deployment goes OK but then the minion config file doesn't get replaced
21:45 thekabal Gareth> http://paste.debian.net/129921/
21:45 crevetor I see it in the temp directory but the one in /etc/salt is the one provided in the package
21:45 crevetor any ideas ?
21:50 smcquay joined #salt
21:51 Gareth thekabal: makes sense, the cmd.run isn't in __salt__
21:52 thekabal Gareth> Oh! Then how should I be calling that? Another version of the script had command.run , but that also didn’t seem to work
21:53 Gareth thekabal: which other script were you referencing?
21:53 thekabal Same script, earlier revision.
21:53 thekabal http://pastebin.com/QFNcUTE6
21:57 Mso150_a_y joined #salt
22:01 tf198_ joined #salt
22:15 viq joined #salt
22:20 Singularo joined #salt
22:27 ajolo joined #salt
22:31 asvme joined #salt
22:45 miqui joined #salt
22:47 yomilk joined #salt
22:59 halfss joined #salt
23:05 Corey_ joined #salt
23:06 Guest18271 Anyone have experience using the Saltify provider in salt-cloud to bootstrap windows minions?
23:06 intellix joined #salt
23:08 tcotav joined #salt
23:13 CoreyD I wasn't able to find much documentation on the Saltify provider, if anyone could point in the right direction that would be very helpful as well.
23:13 Outlander joined #salt
23:14 Ryan_Lane joined #salt
23:14 Ryan_Lane joined #salt
23:14 bhosmer joined #salt
23:16 thekabal How do I do a grains match in a sls file (like if grains[“pg_server] == “1”) that says “if pg_server is not blank/zero/null?
23:19 hasues joined #salt
23:19 hasues left #salt
23:20 thekabal {% if grains[‘pg_server’] %} doesn’t seem to work correctly, but that is what I thought it would be
23:20 nkuttler thekabal: which value does it have?
23:20 nkuttler and how does it not work?
23:20 thekabal cf-05-smdw:
23:20 thekabal pg_server:
23:20 thekabal And yet it matches
23:21 thekabal On another machine, which should match, it also matches (as it should), and has this value:   pg_server:
23:21 thekabal 9.1.13
23:23 nkuttler thekabal: try pg_server: None or False?
23:23 nkuttler actually, yaml should default to None if undefined i think
23:23 thekabal How do I check none or false in an if statement
23:24 goodwill its not yaml ... its jinja2
23:24 goodwill I I think
23:24 nkuttler the sls file is yaml
23:24 nkuttler with jinja mixed into it
23:24 nkuttler jinja is rendered, yaml is parsed
23:24 thekabal It is init.sls, if that helps
23:25 nkuttler yeah
23:25 nkuttler personally, i just wouldn't set a falsy value for pg_server.. so no idea what to do
23:26 nkuttler {% if foo is None %} ?
23:26 thekabal I happen to also be editing the script that creates the value, so I’m happy to change it, but I don’t know much about Python
23:27 thekabal nkuttler> failed: Jinja syntax error: no test named 'None'; line 26
23:27 nkuttler thekabal: oh, it's none
23:28 bobsburgers joined #salt
23:28 thekabal Oh, ok. So what I really need is the opposite, if it is NOT none
23:28 nkuttler http://jinja.pocoo.org/docs/dev/templates/#none
23:28 nkuttler well, is not
23:28 nkuttler (if jinja can do that)
23:28 thekabal Oh. I’m deeply confused now.
23:29 thekabal is not none seems to parse, but doesn’t seem to correctly exclude
23:29 thekabal return {"pg_server": []}
23:30 nkuttler ah
23:30 thekabal That is the return if it does not have a versio
23:30 nkuttler can you dpaste your actual top file?
23:30 thekabal What SHOULD that be
23:30 nkuttler that's an empty list, most likely a yaml problem
23:31 thekabal I’m actually avoiding the top file entirely at this point, only using states directly. Its a init.sls, and I’m doing state.sls thisone
23:31 nkuttler thekabal: sure. run the minion with -l debug and look at the rendered yaml
23:31 thekabal It applies the state (or would, I’m using test)
23:31 thekabal Should I just change that return to something easier, like false?
23:32 nkuttler where do you have this return anyway?
23:32 nkuttler could be, i guess
23:32 thekabal It is a custom grain I’ve defined, using a python scriot
23:32 nkuttler yeah, should probably return None or False
23:33 thekabal K!
23:33 bhosmer_ joined #salt
23:34 yomilk joined #salt
23:35 thekabal Very odd. Now I’ve change the return to:
23:35 thekabal return None
23:35 nkuttler and your yaml isn't parsed any more?
23:35 thekabal Well, no
23:35 thekabal The yaml IS parsed
23:36 thekabal Lemme post the sls for you
23:37 thekabal http://paste.debian.net/129935/
23:37 thekabal I have one machine with a pg_server value, and one without. I would expect that without, it would not get the potsgres user, and the opposite on the other
23:38 lukecarrier joined #salt
23:38 thekabal But in reality, if it says “is none”, neither get it. If it says  “is not none” both get it.
23:39 thekabal Should I make the return False instead?
23:41 thekabal Woah! That seemed to do it.
23:41 thekabal I set the return to False, and just checked for whether if blah, and that worked
23:41 thekabal HUZZAH!
23:41 nkuttler nice
23:41 diegows joined #salt
23:42 thekabal Worked on this for five hours. Foul Python, haunter of my dreams!
23:42 thayne joined #salt
23:44 lukecarrier thekabal, Python <3
23:44 thekabal Bah. Two channels, four hours, rewrote virtually all of this. Python is a pain.
23:45 thekabal To be fair, it also had Jinja, Salt, and other fun in the mix
23:45 thekabal But I blame Python for most of it.
23:45 nkuttler you're welcome
23:46 aurynn python: for great zig
23:47 glyf joined #salt
23:47 meylor joined #salt
23:51 thekabal Is there a way to do a multi-line comment?
23:51 thekabal (in an init.sls file)
23:53 thekabal Ah, found it. Its jinja.
23:53 thekabal Thanks again everyon!
23:54 CoreyD Anyone online, have experience using the Saltify cloud provider? The documentation doesn't seem complete.
23:56 november joined #salt

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