Perl 6 - the future is here, just unevenly distributed

IRC log for #salt, 2016-01-07

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

All times shown according to UTC.

Time Nick Message
00:04 cswang joined #salt
00:12 hasues joined #salt
00:12 hasues left #salt
00:13 PeterO_ joined #salt
00:14 brianfeister joined #salt
00:16 otter768 joined #salt
00:20 rem5 joined #salt
00:22 abednarik joined #salt
00:24 yomilk joined #salt
00:26 baweaver joined #salt
00:32 yomilk joined #salt
00:32 frew to detect if we are in ec2 we use 'ec2:instance_id:i-*'
00:32 frew would 'ec2:instance_id' also work?
00:40 iggy probably just ec2:instance_id
00:41 otter768 joined #salt
00:42 thehaven joined #salt
00:44 colegatron joined #salt
00:59 keepguessing joined #salt
00:59 keepguessing this sls file is failing to install https://github.com/cloudnativeapps/kubernetes/blob/master/cluster/saltbase/salt/kube-apiserver/init.sls
01:00 keepguessing when I run salt 'kubernetes-master' state.sls kube-apiserver it fails with
01:01 keepguessing http://paste.debian.net/361664/
01:01 keepguessing it says it cannot find the services here. How do I "help" it find it?
01:01 keepguessing whytewolf: care to have a look :-)
01:02 whytewolf well, service:docker and service:kubelet are not in the file and there is no include
01:04 yomilk joined #salt
01:04 keepguessing whytewolf: if docker is already installed then would it matter?
01:05 keepguessing I know its static resolution issue. I am just confirming that with my above question.
01:05 whytewolf watch doesn't actualy watch services or anything like that. watch only pertains to salt. and salt states. it is "watching" for changes in salt states
01:06 keepguessing its require and not watch.
01:07 whytewolf oops, but same diff. it is states that it is requireing :P
01:07 keepguessing the section failing is in the requisites.
01:07 keepguessing ok
01:07 keepguessing but I just checked the history of this file and it was always there.
01:08 keepguessing without the includes.
01:10 jaybocc2 joined #salt
01:10 keepguessing could there be another way how it could recognize the services?
01:11 whytewolf keepguessing: it has nothing to do with the services. it is ALL about states. if there are states named docker and kubelet with service modules in them then they should match.
01:11 whytewolf in the top.sls
01:12 whytewolf if you are running with state.sls then the include needs to be in there
01:13 keepguessing oh ok so the problem is not here then.
01:13 keepguessing I was debugging with state.sls
01:13 zmalone joined #salt
01:14 whytewolf right which means it doesn't have a compleate highstate datastructure to work with
01:14 whytewolf [shown with state.show_highstate]
01:18 lompik joined #salt
01:18 cyborg-one joined #salt
01:19 keepguessing whytewolf: ok I need to debug something else highstate is clean.
01:20 keepguessing thanks for your help whytewolf
01:24 cberndt joined #salt
01:42 dyasny joined #salt
01:48 evidence joined #salt
01:49 PeterO joined #salt
01:49 rem5 joined #salt
01:54 racooper joined #salt
01:57 baweaver joined #salt
01:58 jaybocc2 joined #salt
02:14 malinoff joined #salt
02:20 catpigger joined #salt
02:28 penguinpowernz joined #salt
02:29 malinoff joined #salt
02:32 numkem1 joined #salt
02:33 anotherZero joined #salt
02:35 writtenoff joined #salt
02:36 XenophonF left #salt
02:37 dancat joined #salt
02:39 beardedeagle joined #salt
02:40 rem5 joined #salt
02:42 beardedeagle joined #salt
02:45 ageorgop joined #salt
02:47 ilbot3 joined #salt
02:47 Topic for #salt is now Welcome to #salt! | Latest Version: 2015.8.3 | Logs: http://irclog.perlgeek.de/salt/ | Paste: https://gist.github.com/ (please don't multiline paste into channel) | Ask with patience as we are volunteers and may not have immediate answers
02:48 nZac joined #salt
02:48 dancat joined #salt
02:52 numkem joined #salt
02:53 justanotheruser joined #salt
02:56 zmalone joined #salt
03:06 numkem joined #salt
03:10 jaybocc2 joined #salt
03:11 favadi joined #salt
03:12 Score_Under joined #salt
03:12 ryau_ joined #salt
03:30 justanotheruser joined #salt
03:37 ageorgop joined #salt
03:40 anotherZero joined #salt
03:42 numkem joined #salt
03:46 brianfeister joined #salt
04:00 numkem joined #salt
04:04 dancat joined #salt
04:10 llua^_^AznSmile- joined #salt
04:12 ageorgop joined #salt
04:18 llua joined #salt
04:19 mattj_ joined #salt
04:25 beardedeagle joined #salt
04:26 kshlm joined #salt
04:35 anmol joined #salt
04:43 anmol joined #salt
04:56 XenophonF joined #salt
04:59 beardedeagle this may seem like a rather odd question, but before I try it: can you use for loops or lists with cloud confs?
05:03 Furao joined #salt
05:07 stanchan joined #salt
05:08 XenophonF beardedeagle: salt-cloud doesn't run a renderer over them, if that's what you're wondering
05:08 XenophonF beardedeagle: same as salt-master or salt-minion
05:09 XenophonF beardedeagle: what i do is generate them from jinja templates in a state formula
05:09 dancat joined #salt
05:10 XenophonF beardedeagle: i use salt-formula, specifically, and the salt-cloud configuration files get run through jinja
05:11 XenophonF beardedeagle: so to answer your question, more succinctly: no, but you can generate them from templates that do let you use loops, lists, etc.
05:20 rdas joined #salt
05:22 Hipikat joined #salt
05:29 ryau joined #salt
05:29 s_kunk joined #salt
05:29 s_kunk joined #salt
05:34 PeterO joined #salt
05:39 ryau joined #salt
05:41 Theo joined #salt
05:41 Furao joined #salt
05:44 ryau joined #salt
05:46 cberndt joined #salt
05:47 Furao joined #salt
05:50 Theo joined #salt
05:57 linjan_ joined #salt
06:03 calvinh joined #salt
06:08 PeterO joined #salt
06:12 beardedeagle joined #salt
06:13 beardedeagle @XenophonF: That clears a lot up, thanks. I was headed towards templates anyway so this is just another bump in that direction.
06:28 XenophonF beardedeagle: glad to help
06:29 otter768 joined #salt
06:30 jaybocc2 joined #salt
06:37 salad_ joined #salt
06:37 kaushal_ joined #salt
06:42 auzty joined #salt
06:44 colegatron joined #salt
06:45 linjan__ joined #salt
06:49 rihannon joined #salt
06:52 RandyT joined #salt
06:53 edrocks joined #salt
06:55 jcockhren joined #salt
06:55 bharper joined #salt
06:56 buMPnet joined #salt
06:56 freelock joined #salt
06:56 nlb joined #salt
06:56 s_kunk joined #salt
06:58 twork joined #salt
07:02 justanot1eruser joined #salt
07:08 XenophonF hah i've got an MSI package for salt now!
07:08 XenophonF w00t!
07:08 onlyanegg joined #salt
07:08 XenophonF now just to put all of the pieces together
07:09 rotbeard joined #salt
07:14 twork once again, a simple, simple, simple thing and i can't figure out how to do it...
07:15 twork two minions, each with the same config file that i want to seed with a couple of specifics from the pillar.
07:16 twork i know how to step through a list of files on a minion and seed them that way.
07:16 Norrland left #salt
07:16 twork but it's stepping minion to minion that's got me all confused.
07:16 twork https://gist.github.com/mjinks/929a616bbf0fdefaaa21
07:16 justanotheruser joined #salt
07:16 justanotheruser joined #salt
07:18 XenophonF twork: first of all, do you have the template kwarg set in your file.managed state?
07:18 XenophonF twork: you must explicitly enable templating and pick an engine, e.g., "template: jinja"
07:19 twork oh, yes: i did do that
07:19 XenophonF twork: second, if the file is the same on two minions, that's easy
07:19 XenophonF twork: just run the same state on both minions
07:19 twork i am doing that...
07:20 twork let me fix what i posted; i trimmed too far
07:20 XenophonF twork: ok, third, in your template config, use the variable names app_port and app_server
07:21 XenophonF twork: fourth, also in that template, at the top of the template look up those values in pillar, e.g., {% set var = salt['pillar.get']('key1:key2') %}
07:22 XenophonF twork: fifth, and this is where i think you're hung up, have two separate pillar files
07:22 XenophonF twork: e.g., this.sls and that.sls
07:23 XenophonF twork: and in this.sls, put web_fronts: app-server: ... (etc)
07:23 XenophonF twork: and in that.sls, put the same thing, but for that.tomcat.int (following your example)
07:23 XenophonF twork: so basically you'd flatten the pillar keys a little
07:24 XenophonF twork: and in the pillar top.sls, assign this.sls to the one server and that.sls to the other, just like you do with salt states
07:24 XenophonF and bob's your uncle!
07:24 twork i just updated a little
07:24 twork reading...
07:25 brianfeister joined #salt
07:25 XenophonF twork: here's a concrete example - settings for a minecraft server, https://github.com/irtnog/salt-pillar-example/blob/master/minecraft/example/com/init.sls
07:25 twork aha! *that's* what all that {% mumbo jumbo %} is in this context.
07:26 XenophonF twork: and here is how i assign that pillar sls, https://github.com/irtnog/salt-pillar-example/blob/master/top.sls#L59
07:26 XenophonF twork: yup, you got it
07:27 twork i'm used to seeing that stuff i a loop context, but hadn't quite gotten it over to here
07:27 XenophonF twork: and here's the config file template that has the pillar lookups in context - https://github.com/irtnog/spigotmc-formula/blob/master/spigotmc/files/server.properties.jinja
07:27 Bryson joined #salt
07:27 XenophonF twork: and here's another templated config file, https://github.com/irtnog/spigotmc-formula/blob/master/spigotmc/files/ops.json.jinja
07:28 XenophonF twork: the json file uses looping, which you're keen on ;)
07:28 twork :)
07:28 XenophonF twork: the json one is probably not strictly necessary, as i should be able to pass that spigotmc:ops dict directly to the |json formatter
07:28 XenophonF twork: i can't remember why i rendered it by hand---probably a bug in minecraft's json parser or something
07:29 twork nuts; and with that i need to sign off all of a sudden. copying & pasting this little talk and back when i can.
07:29 twork much, much, much thanks.
07:29 XenophonF twork: no problem - poke around in my github repos, i posted lots of examples
07:29 XenophonF if anything's unclear, email me
07:30 XenophonF address is in the commit logs
07:30 XenophonF i'm off to bed myself - ta!
07:33 Bryson joined #salt
07:35 NaPs joined #salt
07:43 felskrone joined #salt
07:48 ryau_ joined #salt
07:48 brianfeister joined #salt
07:49 mdupont joined #salt
07:53 ryau joined #salt
07:56 ryau_ joined #salt
07:59 ryau joined #salt
08:00 antpa joined #salt
08:00 jaybocc2 joined #salt
08:00 otter768 joined #salt
08:01 cyborglone joined #salt
08:01 elsmo joined #salt
08:02 otter768_ joined #salt
08:04 otter76__ joined #salt
08:04 NaPs joined #salt
08:05 antpa joined #salt
08:06 TyrfingMjolnir joined #salt
08:06 otter768 joined #salt
08:08 otter768_ joined #salt
08:10 otter768 joined #salt
08:12 otter768_ joined #salt
08:12 impi joined #salt
08:13 antpa joined #salt
08:14 otter768_ joined #salt
08:15 otter768 joined #salt
08:17 otter768_ joined #salt
08:19 otter768 joined #salt
08:19 kawa2014 joined #salt
08:21 otter768_ joined #salt
08:21 PeterO_ joined #salt
08:23 otter768 joined #salt
08:24 k_sze joined #salt
08:24 k_sze How do I tell what exactly a minion is doing?
08:25 otter768_ joined #salt
08:26 antpa joined #salt
08:27 otter76__ joined #salt
08:29 otter768 joined #salt
08:31 otter768_ joined #salt
08:32 KermitTheFragger joined #salt
08:33 otter76__ joined #salt
08:34 otter768 joined #salt
08:36 dijit minion log.
08:36 otter768_ joined #salt
08:38 otter768 joined #salt
08:40 otter768 joined #salt
08:42 otter768_ joined #salt
08:44 otter76__ joined #salt
08:46 otter768 joined #salt
08:47 kshlm joined #salt
08:48 otter768_ joined #salt
08:50 otter768 joined #salt
08:51 kawa2014 joined #salt
08:52 otter76__ joined #salt
08:53 otter768 joined #salt
08:56 otter768_ joined #salt
08:56 netcho joined #salt
08:57 otter76__ joined #salt
08:58 linjan__ joined #salt
08:58 beardedeagle joined #salt
08:59 otter768 joined #salt
09:00 dgutu joined #salt
09:01 otter768_ joined #salt
09:03 otter76__ joined #salt
09:04 s_kunk joined #salt
09:04 s_kunk joined #salt
09:05 otter768 joined #salt
09:06 fredvd joined #salt
09:07 otter768_ joined #salt
09:09 otter76__ joined #salt
09:09 kshlm joined #salt
09:11 otter768 joined #salt
09:12 Rumbles joined #salt
09:13 otter768_ joined #salt
09:14 slav0nic joined #salt
09:14 otter768 joined #salt
09:16 GreatSnoopy joined #salt
09:17 otter768 joined #salt
09:18 otter768 joined #salt
09:20 otter768_ joined #salt
09:22 otter768 joined #salt
09:24 otter768_ joined #salt
09:24 Xevian joined #salt
09:26 otter768 joined #salt
09:28 otter768_ joined #salt
09:29 Rumbles hi, I'm struggling with an error when using data in pillar, can anyone advise what I'm doing wrong? The error I get is "Unable to manage file: Jinja variable 'dict object' has no attribute 'elk'" Some further info on my config: http://fpaste.org/308104/
09:29 jamesp9 joined #salt
09:29 Rumbles I have refreshed the pillar already, when I'm googling that error, all the results I get are to do with bugs
09:30 AndreasLutro I've got a problem where the top.sls file is outdated, but everything else is up-to-date - anyone had similar issues?
09:30 otter768 joined #salt
09:32 otter768_ joined #salt
09:34 otter76__ joined #salt
09:34 Rumbles AndreasLutro, how do you mean it's outdated?
09:35 Rumbles in my env we keep everything in git, then rsync the files to our salt master when there are updates, I'm not aware of a default method to get the manifests on to the master
09:35 otter768 joined #salt
09:37 AirOnSkin Rumbles: In elasticsearch.tmpl try using {% if salt['pillar.get']('elk:env:size') == "single" %}
09:37 AndreasLutro Rumbles: I've got a single git repository including pillars and states. I combined 3 SLS files into a single one in a recent commit, but salt acts as if top.sls still includes all 3
09:37 otter768_ joined #salt
09:37 NaPs joined #salt
09:39 Rumbles thanks AirOnSkin , I'll try that now
09:39 ericof joined #salt
09:39 otter76__ joined #salt
09:40 Rumbles AndreasLutro, so on your salt master you just pull from git when there are updates?
09:40 Rumbles have you tried deleting and pulling fresh?
09:40 AndreasLutro no, I use gitfs
09:40 Rumbles oic
09:40 is_null hi all, is it possible that i can't call state.sls "The function "state.sls" is running as PID 3861 and was started a" because the reactor started a job ?
09:40 Rumbles sorry, not had much experience with that
09:40 Rumbles but it sounds more like a git gitfs issue than a salt issue...
09:41 AndreasLutro rm -rf /var/cache/salt/* worked but that's obviously not ideal!
09:41 AndreasLutro is_null: that is absolutely what's happening
09:41 otter768 joined #salt
09:41 is_null omg
09:42 is_null of course the only way for me to know is to follow the very tidy logs on the master xD
09:42 AndreasLutro you can't run more than 1 state job at the same time
09:42 AndreasLutro salt-run jobs.active
09:42 AndreasLutro will show currently active jobs
09:43 is_null yeah so in my salt_call bash function (since have a bash function to encapsulate over every salt function we have a lot less problems) i should wait for jobs to stop then, thanks !
09:43 otter768_ joined #salt
09:44 bhosmer joined #salt
09:45 keimlink joined #salt
09:45 otter768 joined #salt
09:47 Rumbles still get the same error AirOnSkin, thanks though
09:47 otter76__ joined #salt
09:48 is_null it's a bit a shame that salt-call can't queue the state.sls task as it's using zmq after all xD
09:48 N-Mi joined #salt
09:49 otter768_ joined #salt
09:49 linjan__ joined #salt
09:51 otter768 joined #salt
09:52 jhauser joined #salt
09:53 otter768_ joined #salt
09:53 evle1 joined #salt
09:55 otter76__ joined #salt
09:56 otter768 joined #salt
09:58 otter768_ joined #salt
10:00 otter768_ joined #salt
10:02 otter768 joined #salt
10:03 is_null AndreasLutro: but is there any way to see active jobs from inside a minion ?
10:04 otter768_ joined #salt
10:06 jaybocc2_ joined #salt
10:06 otter768 joined #salt
10:08 otter768 joined #salt
10:09 ingslovak joined #salt
10:09 dgutu joined #salt
10:10 otter768_ joined #salt
10:12 otter768_ joined #salt
10:14 otter768 joined #salt
10:15 ecdhe joined #salt
10:16 jasonrm joined #salt
10:16 otter768_ joined #salt
10:17 otter768 joined #salt
10:19 linjan__ joined #salt
10:19 otter768 joined #salt
10:21 otter768_ joined #salt
10:23 otter768 joined #salt
10:25 otter768_ joined #salt
10:27 otter768 joined #salt
10:29 otter768 joined #salt
10:31 otter768_ joined #salt
10:34 jasonrm joined #salt
10:35 jcristau joined #salt
10:37 calvinh_ joined #salt
10:46 LondonAppDev joined #salt
10:47 larsfronius joined #salt
10:48 blckbit10 joined #salt
10:56 Rumbles joined #salt
10:56 AdamSewell joined #salt
11:03 is_null hi all, is it possible to know, from a minion, if a job is running already ?
11:03 dgutu joined #salt
11:03 is_null to avoid race conditions in automated deployment processes
11:05 AndreasLutro is_null: not sure about that
11:06 evle joined #salt
11:10 malinoff joined #salt
11:12 is_null AndreasLutro: this is how we did it: https://gist.github.com/jpic/8a94155f4b333de272fd
11:13 is_null we have quite a lot of really really nice hacks in there to make salt behave hehehehehe
11:14 is_null like automatic --retcode-passthrough  ^^
11:19 mage_ is there a way to just add an item to a list in a pillar ?
11:21 mage_ for ex https://gist.github.com/silenius/67e925a7599f4ac178d3
11:21 mage_ I just want to add "hash:/usr/local/mailman/data/aliases" to both list without overriding
11:24 BeerMonkey joined #salt
11:25 mage_ and if not, what's the common approach to resolve this ?
11:30 LondonAppDev joined #salt
11:33 LondonAppDev joined #salt
11:35 losh joined #salt
11:39 LondonAppDev joined #salt
11:44 LondonAppDev joined #salt
11:45 enginxyz joined #salt
11:45 enginxyz hi guys
11:45 enginxyz is there any ways to remove or trim bottom-top space and white space
11:46 enginxyz in jinja templated file
11:47 enginxyz after i have run state a template file, there is occur some whitespace line
11:47 yomilk joined #salt
11:53 jaybocc2 joined #salt
11:55 LondonAppDev joined #salt
11:58 malinoff enginxyz: http://jinja.pocoo.org/docs/dev/templates/#whitespace-control
12:01 jaybocc2 joined #salt
12:07 agend joined #salt
12:07 bluenemo joined #salt
12:22 sfxandy joined #salt
12:22 sfxandy hi everyone
12:23 amcorreia joined #salt
12:23 Rumbles joined #salt
12:25 codehotter When is the next salt release likely to be branched?
12:25 codehotter Are new releases branched from develop a significant amount of time before they are released? Or is a new release basically the state of develop at that time?
12:26 Bucciarati joined #salt
12:26 larsfronius joined #salt
12:28 larsfron_ joined #salt
12:28 sfxandy anyone got any experience with the salt event bus and the fire_event parameter added in salt 2015.8?
12:29 dgutu joined #salt
12:32 otter768 joined #salt
12:36 dgutu joined #salt
12:45 colegatron joined #salt
12:49 sarcasticidiot joined #salt
12:49 sarcasticidiot Good afternoon everyone,
12:49 sarcasticidiot I'm running into some issues defining nodegroups in the salt master
12:50 sarcasticidiot "[WARNING ] Key nodegroups with value None has an invalid type of <type 'NoneType'>, a dict is required for this value
12:50 sarcasticidiot "
12:50 sarcasticidiot This seems to break somethings since defining a nodegroup does not seem to work, "Node group group1 is unavailable" stated after the error
12:51 SpX joined #salt
12:52 viq sfxandy: you have a question, or are you conducting a survey? ;)
12:52 sfxandy lol
12:53 sfxandy arguably both viq
12:53 viq sfxandy: then if you have an actual question, it usually works better to, you know, ask it ;)
12:53 sfxandy ive noticed some strange behaviour whereby I am getting duplicate events being fired.  most notably around the use of the 'user.present' state
12:53 sfxandy has anybidy else observed this or similar behaviour?
12:55 * viq gives a chance to respond to someone who actually knows anything about it
12:56 sfxandy checking the event payload, the duration, start_time are all the same ....
12:58 sfxandy sarcasticidiot, can you paste your nodegroup definition from the master config file please?  what it looks like is you have the nodegroups keyword in your config file, but nothing defined for it....
13:00 sarcasticidiot I already found the reason behind it, seems like some minion defined in the nodegroup is causing it
13:00 sfxandy ok
13:00 sarcasticidiot Odd..
13:01 sfxandy perhaps your definition wasn;t correct...?
13:01 ctolsen joined #salt
13:01 sarcasticidiot Might be, I'm going to redo it and see if the problem repeats itself, quite a long list of minions
13:02 sfxandy must confess, not a huge fan of nodegroups
13:02 sarcasticidiot Neither am I but seemed to be the easiest way to target certain minions for upgrade
13:03 anmol joined #salt
13:03 sfxandy we migrated out config from nodegroups into Pillar...
13:03 sarcasticidiot Might need to do that too..
13:05 viq pillar? I was previously using grains for that
13:06 akhter joined #salt
13:09 akhter joined #salt
13:11 onlyanegg joined #salt
13:16 ctolsen joined #salt
13:17 ALLmightySPIFF joined #salt
13:17 calvinh joined #salt
13:18 leev joined #salt
13:18 ntropy joined #salt
13:19 jbrouwers joined #salt
13:20 nexsja joined #salt
13:21 godlike joined #salt
13:21 godlike joined #salt
13:22 beardedeagle joined #salt
13:29 sfxandy yeah Pillar.  whatever you do don't mention Pillar vs grains to bablien ....
13:29 sfxandy babilen even
13:36 lunarlamp joined #salt
13:36 tampakrap joined #salt
13:43 _mel_ joined #salt
13:44 yomilk joined #salt
13:55 subsignal joined #salt
13:55 gh35 joined #salt
13:56 rem5 joined #salt
13:57 yidhra joined #salt
13:58 Dennis_ joined #salt
13:58 Dennis_ Hi
13:58 dyasny joined #salt
13:58 lompik joined #salt
13:59 Dennis_ Googled for my answer and searched over the salt website, but cannot find my answer
14:00 mapu joined #salt
14:00 sander joined #salt
14:00 Dennis_ we are looking into deploying with salt our dockers, however we want to keep the docker orchestration in place and use the docker-compose files files
14:01 Dennis_ is there a logical way of calling for the docker-compose files in sis?
14:01 Dennis_ is there a logical way of calling for the docker-compose files in sls?
14:01 sander Hi, is it maybe possible to run multiple commands with salt? example salt -L 'salt2,salt3' status.uptime,pkg.install htop
14:02 JDiPierro joined #salt
14:03 mm108 joined #salt
14:03 babilen sfxandy: The evil!
14:03 babilen :)
14:03 sfxandy exactly lol
14:05 CeBe joined #salt
14:07 wangofett sander: I'd use orchestration for that, maybe?
14:07 wangofett targeting multiple minions is possible
14:08 wangofett and should be pretty easy
14:08 fredvd joined #salt
14:09 intr1nsic joined #salt
14:11 xenoxaos joined #salt
14:11 antpa joined #salt
14:13 jaybocc2 joined #salt
14:13 bhosmer joined #salt
14:15 Azid joined #salt
14:18 anotherZero joined #salt
14:20 antpa joined #salt
14:22 cpowell joined #salt
14:23 cpowell joined #salt
14:23 subsigna_ joined #salt
14:25 jaybocc2 joined #salt
14:29 viq joined #salt
14:32 otter768 joined #salt
14:43 agend joined #salt
14:46 hasues joined #salt
14:54 hasues left #salt
14:54 perfectsine joined #salt
14:57 kawa2014 joined #salt
14:58 anotherZero joined #salt
14:58 tmclaugh[work] joined #salt
14:58 scoates joined #salt
15:00 winsalt joined #salt
15:01 favadi joined #salt
15:03 stbenjam joined #salt
15:07 Tanta joined #salt
15:09 nZac joined #salt
15:10 nZac joined #salt
15:10 FreeSpencer joined #salt
15:10 FreeSpencer joined #salt
15:11 zmalone joined #salt
15:13 Crazy67 joined #salt
15:13 Crazy67 joined #salt
15:14 bhosmer joined #salt
15:14 andrew_v joined #salt
15:14 Gabemo joined #salt
15:15 Gabemo joined #salt
15:17 spaceSub Hey, I don't really get the yumpkg module. I'd like to do something like 'yum --enablerepo=elrepo-kernel'.
15:19 spaceSub The yumpkg documentation has an example: salt '*' pkg.mod_repo reponame enabled=1 gpgcheck=1
15:19 DaStee joined #salt
15:19 DaStee Hi
15:19 spaceSub This sort of look like what I want, but I don't know how to write that in in YAML..
15:19 sander multiple minions works well but only i want to run multiple commands too
15:20 fullstop Let's say that I have a managed file.. is there a way to stop a service _before_ it is sent to the minion?
15:20 linjan joined #salt
15:21 fullstop I guess I need to require a command to stop the service?
15:22 slav0nic joined #salt
15:22 nZac joined #salt
15:24 peters-tx joined #salt
15:24 morissette joined #salt
15:29 babilen spaceSub: That is an execution function and not a state (presuming you mean "how to call that in a state" by "how to write that in YAML")
15:29 babilen You can, however, call execution functions with https://docs.saltstack.com/en/latest/ref/states/all/salt.states.module.html
15:30 babilen Might also want to take a look at the pkgrepo states (not entirely sure what "--enablerepo" does in yum land)
15:30 spaceSub I mean I know how I'm supposed to use the line I pasted, but I presume I got to be able to enable a repo from within a state file too.
15:31 spaceSub Oh, hmm let's see.
15:31 ranomore1 joined #salt
15:31 spaceSub Oh you can disable repos but still have them configured. Enablerepo makes the package manager use that repo again.
15:33 babilen Why wouldn't you tell salt to configure and enable it to begin with?
15:34 spaceSub You often configure repos by installing an rpm which drops the right files into the right places. It's quite common that these RPMs install multiple repos but only enable the "main" repo. In this case I'd like to enable the repo with the mainline kernel init, which comes diabled by default.
15:35 spaceSub *in it
15:35 spaceSub http://elrepo.org/tiki/tiki-index.php << It's about this btw.
15:36 Dw_Sn joined #salt
15:36 Dw_Sn anyidea what might be the problem when salt-run cache.clear_all return False on Centos7.2 ?
15:37 FreeSpencer joined #salt
15:37 FreeSpencer joined #salt
15:39 Dw_Sn it seems that salt-run always stuck in somekind of network connection
15:39 mapu joined #salt
15:41 jhauser joined #salt
15:42 quasiben joined #salt
15:43 numkem joined #salt
15:44 illern joined #salt
15:46 winsalt we need to have 'add -l debug' stickied to the top of this chat
15:48 RandyT winsalt: and 'salt-run state.event pretty=True' :-)
15:49 winsalt yep, these two commands are like looking into the salt matrix
15:50 Brew joined #salt
15:51 XenophonF joined #salt
15:51 XenophonF i've got msi packages for salt and its immediate dependencies on windows!
15:52 XenophonF tell you what, compiling pycrypto and pywin32 was a PITA
15:52 pkimber joined #salt
15:53 kshlm joined #salt
15:56 spuder joined #salt
15:56 XenophonF so now what i need to do is (1) bundle all of the MSIs together and (2) add nssm.exe plus the default root to a top-level installer package
15:58 XenophonF so if you already have python 2.7.11 installed, it should just add or update the missing libs
16:07 Cottser joined #salt
16:08 _JZ_ joined #salt
16:12 DammitJim joined #salt
16:14 sdm24 joined #salt
16:14 spaceSub http://pastebin.com/HNBJzYg5
16:14 spaceSub This does enable the repo but is really suboptimal.. Is there really not another way?
16:14 spaceSub This marks enabled and gpgcheck every time as changed and is generally kinda ugly :/
16:16 Topic for #salt is now Welcome to #salt! | Latest Version: 2015.8.3 | Paid support available for open source Salt! www.saltstack.com/support | Logs: http://irclog.perlgeek.de/salt/ | Paste: https://gist.github.com/ (please don't multiline paste into channel) | Ask with patience as we are volunteers and may not have immediate answers
16:18 XenophonF spaceSub: what's wrong with using a pkgrepo state?
16:18 XenophonF you shouldn't need module.run
16:21 iggy ^ almost never
16:23 spaceSub I agree that I shouldn't have to. As you can read above that was a suggestion by babilen (well at least a sugestion how to use the one function I found.). But yeah. I would much rather just active a repository as described above, but I can't see any way to do just that?
16:25 spaceSub Hmm.. maybe I will just add the damn repo by hand. I don't really know if that could be a problem.
16:25 cyteen joined #salt
16:25 HardWall joined #salt
16:26 whytewolf typically isn't
16:26 malinoff joined #salt
16:27 ChrisU joined #salt
16:27 babilen spaceSub: I linked you to the proper state to run that execution function. Is that not working for you?
16:28 babilen But then: I'd personally prefer to be explicit and not rely on "some package" to add the repository configuration, but add that in a suitable pkgrepo state as well.
16:28 spaceSub As I said: It works, but it looks ugly and tells me it changed the two fields every time (even when in fact the fields didn't change).
16:29 spaceSub Yeah, okay. I'll probs go with that now..
16:32 frew so if I wanted to have a file that is controlled by a pillar, is a reasonable way to do it to use a pattern like: salt://foo/{{bar}}.conf ?
16:33 otter768 joined #salt
16:35 denys joined #salt
16:36 thalleralexander joined #salt
16:36 babilen frew: That question is a little too generic so I go with a "maybe"
16:36 frew well
16:36 babilen Are you sure that bar is defined?
16:36 frew so in our old system basically we create a single /etc/security/limits.conf file
16:37 jaybocc2 joined #salt
16:37 frew we do this by concatenating: 1) a generic one, 2) one for each role the server implements, and 3) one for the server's hostname
16:37 frew I was going to reimplement that logic it salt in a state (don't see how it could be in a pillar)
16:37 frew the only other idea I have, which maybe isn't a bad idea, is to instead of taking files, actually extract the data from within the files into yaml
16:37 frew that might be the best option...
16:38 frew babilen: the variable will be defined, the file name not
16:39 frew I think I'm gonna go the data driven yaml direction, as that should make this more "salt-y"
16:39 frew thanks :)
16:39 babilen I'd simply render the entirety of that file based on data in the pillar *or* (preferred approach!) simply drop suitable files in /etc/security/limits.d/ that are each rendered based on pillar data
16:39 undefinednull joined #salt
16:40 frew currently the files are so simple that using the .d thing seems overkill
16:40 frew I'll do that later if it does end up getting more complex
16:40 frew but for now we're talking a maximum of like, 8 lines
16:41 frew babilen: thanks
16:41 winsalt you could probably have one file that is templated with if statements to include the stuff you would tack on
16:41 favadi joined #salt
16:42 beardedeagle joined #salt
16:42 frew I am currently enjoying the idea of merging pillardata, though I guess the problem with that is that the source of data can be all over the place
16:43 thalleralexander joined #salt
16:44 undefinednull joined #salt
16:45 XenophonF frew: when possible (like, if the app supports something.d-style configs) i'm a big fan of what babilen described
16:45 XenophonF frew: it's nice when the program or service to be configured supports composition like that
16:46 XenophonF frew: alternatively, you can merge the data in pillar, but i don't recall the rules around that
16:46 amcorreia joined #salt
16:46 frew I have them handy.
16:46 XenophonF frew: like, salt might merge dicts but not lists, etc.
16:46 frew actually you can tell it to merge lists
16:47 frew but I'm using dicts since they represent sets better anyway
16:47 XenophonF frew: do you have the link hand? hit me with the cluestick please
16:47 frew sec
16:47 XenophonF s/hand/handy/
16:48 frew https://docs.saltstack.com/en/latest/ref/configuration/master.html#pillar-source-merging-strategy
16:51 UtahDave joined #salt
16:52 dayid joined #salt
16:52 jaybocc2 joined #salt
16:53 Theo joined #salt
16:54 ChrisU left #salt
16:54 Theo left #salt
16:55 TheoSLC joined #salt
16:56 colegatron I have a pillar for a logrotate state, but in the logrotation configuration (which is part of the pillar) I need to refer to another pillar variable. Is that possible?
16:58 colegatron it looks like this:
16:58 colegatron http://pastebin.com/sbLSZJG9
16:59 ryau joined #salt
16:59 Bryson joined #salt
17:00 spiette joined #salt
17:01 XenophonF thanks frew
17:02 frew no prob
17:05 Rumbles joined #salt
17:10 beardedeagle joined #salt
17:13 onlyanegg joined #salt
17:17 onlyanegg I'm getting this error "'base:monitor.nagios' failed: Conflicting ID 'file.managed'". Does this make sense? file.managed is not an id right? It's a state
17:17 babilen frew: Even for few lines I quite like a semantic separation .. might be worth to start this early
17:18 colegatron does salt provides some mechanism to twice-parse pillars? I need to refer to a value in the pillar in other point of the pillar. http://pastebin.com/sbLSZJG9
17:19 frew babilen: ok so if I were to do that I guess what I'd do is have the pillardata contain the files to include?
17:19 Theo joined #salt
17:19 frew (the other nice thing about doing that is that I don't have to generate a static file in a template, which seems a little silly
17:20 LondonAppDev joined #salt
17:20 murrdoc joined #salt
17:21 CheKoLyN joined #salt
17:22 frew babilen: I'll see what I come up with. thanks
17:22 bhosmer joined #salt
17:22 tampakrap joined #salt
17:22 frew the only thing I don't like about this is that I end up with what is sorta per-server data in my state files
17:23 ajw0100 joined #salt
17:23 frew I guess the other option is to generate multiple .d files from pillar data, but the bummer there is that I still have to generate the data instead of it being simpler, static files
17:24 frew I'm gonna go for static files in the states for now
17:24 babilen frew: How so? My idea would be to split those files semantically with according sections in the pillar. You generate suitable file.managed states based on data in your pillar and therefore only include what you have data for.
17:24 frew I see what you mean.
17:25 babilen Or you be a bit more specific in your states and do limits.d/generic.conf limits.d/my_application1.conf ...
17:25 frew I guess what bothers me, and maybe this is me being naive, is that I Was under the impression that the goal is to have the states be very generic
17:25 frew and any actual data be in pillardata
17:25 frew but that might just be some dogma I stepped in
17:25 babilen Or you ship more specific files with the application they pertain to .. In a way I *really* like to write rather generic states and do the logic in pilllars
17:26 babilen No, that is a good approach
17:26 murrdoc generic states + pillars is the right way
17:26 murrdoc the one true way
17:26 frew heh
17:26 frew ok so I'm going to be putting this limits.d stuff in the state right, because pillars don't serve files... right?
17:27 frew I'm gonna just do static files in the state for now, where the pillardata has which static file to include, and then go from there
17:27 frew nothing is set in stone after all.
17:28 gcorey joined #salt
17:30 colegatron babilen, I need to refer to a pillar item value to build the value of another pillar item. you can see it at http://pastebin.com/sbLSZJG9  could you give me any advice on which approach to take?
17:31 whytewolf colegatron: you can not access pillar from within pillar.
17:32 tehsu is there another way to send emails other than smtp_return
17:33 whytewolf colinstgeorge: would sugest writing the state that uses the pillars to put the data together on it's end
17:34 babilen ^ +1
17:34 colegatron I don't understand what you mean
17:35 whytewolf colegatron: are you using a formula or writing your own states?
17:35 colegatron I'm using the logrotate formula.
17:36 colegatron but seems I'll need to continue writing all the states by my own, right?
17:39 whytewolf well, you must be using something speceil to begin with cause log rotate doens't look like it would know what to do with s3_rotate_path
17:39 whytewolf [logrotate-formula
17:39 whytewolf ]
17:40 colegatron sure. I am modifying the formula to add some prerotate/endscript lines using the s3_rotate_path
17:40 jaybocc2 joined #salt
17:41 whytewolf okay, so you are already adding the s3_rotate_path. why not just use the pillar data to build that as a variable in the state instead of create it as pillar data?
17:41 morissette joined #salt
17:43 writtenoff joined #salt
17:44 PeterO joined #salt
17:44 Bryson joined #salt
17:45 jaybocc2 joined #salt
17:46 colegatron to do not tie the state to data that is only my own convention.
17:47 whatapain joined #salt
17:47 whytewolf colegatron: but you are modifing it already to fit your concention
17:47 whytewolf s/concention/convention
17:49 colegatron yes, but also trying to not tie the state to data
17:53 XenophonF frew: you can store files in pillar!
17:53 frew oh?
17:53 frew how do you access them?
17:53 XenophonF frew: i (ab)use the !!binary YAML data type and the file.managed state's contents_pillar kwarg
17:54 frew huh.
17:54 XenophonF frew: mostly because i have a few stupid apps that require DER-encoded X.509 certificates
17:54 frew so it's not quite as nice as salt://... ?
17:55 XenophonF frew: i think it's nice
17:55 zmalone different from salt://, I don't think you can limit salt:// targeting
17:55 XenophonF frew: the file.managed state doesn't need a source kwarg if you use contents_pillar
17:55 zmalone so any minion can request any file in a master's file_root
17:56 tehsu smtp_return, can it go into the master instead of each minion?
17:56 rubenb joined #salt
17:56 antpa joined #salt
17:57 toastedpenguin joined #salt
17:57 XenophonF frew: here's a concrete example - https://gist.github.com/xenophonf/f812cb89b3e67054d771#file-init-sls-L46
17:58 XenophonF the panorama9 client needs a pfx file installed to a magic location in order to tie it to your account
17:58 XenophonF pfx is a binary-only format, so i base64-encoded ours and stuck that into pillar via YAML's !!binary data type
17:59 XenophonF http://yaml.org/type/binary.html
17:59 frew sure; I don't need to worry about binary data (yet)
17:59 frew but this is cool...
17:59 XenophonF well, if you're just dealing with text, you can just use a multi-line string in YAML
18:00 XenophonF i do that with my PEM-encoded X.509 certificates and private keys
18:00 frew does it have to be YAML?
18:00 XenophonF no
18:00 XenophonF you can use whatever pillar supports
18:00 frew that's sorta part of my point, that if possible, I'd rather just not wrap static data with YAML or w/e else
18:00 XenophonF heck, a file pillar would work just fine
18:00 frew ok
18:00 frew right
18:00 frew thanks for this example
18:00 XenophonF again, in the file.managed state, you'd use contents_pillar instead of source or whatever
18:00 frew right
18:01 frew and I guess panorama9:client_certificate is pillar/panorama9/client_certificate.sls?
18:01 Theo joined #salt
18:01 spyd3r joined #salt
18:02 XenophonF no, in my configs its in .../pillar/defaults/panorama9.sls
18:02 frew ok
18:02 XenophonF but that sets the dict that the state references
18:03 XenophonF the SLS files under .../pillar are just for targeting, same as state SLS files
18:03 XenophonF what you name the keys inside of them is what counts, and that's what you'd reference e.g., in pillar.get or the contents_pillar kwarg
18:04 XenophonF here's how you'd do a file_tree ext_pillar - https://docs.saltstack.com/en/latest/ref/pillar/all/salt.pillar.file_tree.html
18:04 XenophonF in that case the pillar name and the SLS ID you'd use for targeting would be the same, iirc
18:04 XenophonF somebody correct me if i'm wrong
18:05 XenophonF anyway the file_tree ext_pillar slurps in the raw contents of the file and puts it into a pillar key named after the relative pathname of the file
18:05 XenophonF there's an example in the docs
18:06 baweaver joined #salt
18:06 wangofett Hey... so I can use `salt '*' pillar.items` to see all pillar data, but what if I just want to look at one specific key (and all of the subdata)
18:06 wangofett I've tried pillar.items <mypillar> and pillar.get <mypillar>
18:06 XenophonF call pillar.get
18:06 wangofett but it doesn't appear to work
18:07 XenophonF salt * pillar.get foo:bar:baz
18:08 XenophonF or you could do: salt -I foo:bar:baz:* pillar.get foo:bar:baz
18:08 XenophonF which would only call pillar.get on minions with that key set
18:09 tehsu whats the correct key for a --return smtp in a sls
18:10 wangofett hrm.... see - pillar.items shows me the whole dictionary, and pillar.ls shows me - custom_repos as one of the keys, but pillar.get custom_repos shows nothing
18:11 whytewolf wangofett: pillar_refresh maybe?
18:12 ilbot3 joined #salt
18:12 Topic for #salt is now Welcome to #salt! | Latest Version: 2015.8.3 | Paid support available for open source Salt! www.saltstack.com/support | Logs: http://irclog.perlgeek.de/salt/ | Paste: https://gist.github.com/ (please don't multiline paste into channel) | Ask with patience as we are volunteers and may not have immediate answers
18:12 dalibro joined #salt
18:12 wangofett whytewolf: that was it
18:12 egil_ joined #salt
18:12 wangofett thanks
18:12 whytewolf np
18:12 dalibro hello ! anyone knows if it's possible to run salt-cloud commands via tornado api ?
18:13 ageorgop joined #salt
18:15 stbenjam_ joined #salt
18:16 nZac joined #salt
18:18 cyborg-one joined #salt
18:18 stupidnic Is there a specific option I need to include on a salt state for network for the interface to be reloaded once the state is applied? Or do I need to something like a service.running?
18:18 ryau joined #salt
18:19 badgerops joined #salt
18:19 nZac joined #salt
18:20 UtahDave dalibro: yeah, there is a salt-cloud runner you can call from the api
18:20 FreeSpencer What OS?
18:21 badgerops good morning - I've got a salt upgrade question, and haven't had much luck finding an upgrade guide on the salt site. We're running 2015.5.0, going to 2015.8.3. Just curious if there are any upgrade gotcha's that y'all have seen.
18:21 XenophonF oh hey UtahDave, I've got MSI packages for Salt and its dependencies
18:21 XenophonF i don't have them bundled together neatly yet
18:21 dalibro Aha ! Didn't know the term, thank you UtahDave ! ;-)
18:22 XenophonF building an MSI for pypiwin32 was quite challenging!
18:23 mapu joined #salt
18:25 ryau_ joined #salt
18:25 notnotpeter joined #salt
18:26 antpa joined #salt
18:26 cberndt joined #salt
18:27 teryx510 joined #salt
18:27 toastedpenguin joined #salt
18:30 digitalhero joined #salt
18:31 ryau joined #salt
18:31 iggy badgerops: you've read the release notes?
18:33 ryau__ joined #salt
18:34 otter768 joined #salt
18:35 wangofett If I'm just trying to grok how Salt handles states and includes better, is there a good state to use for testing? Something like a null state? Or just "cmd.run: - name: echo foo"?
18:35 whytewolf wangofett: the test states?
18:35 whytewolf wangofett: https://docs.saltstack.com/en/latest/ref/states/all/salt.states.test.html
18:36 Eugene You can also add test=True to see what a state would change
18:36 wangofett whytewolf: ahhhh perfect
18:36 wangofett that's nice
18:36 zmalone You can do dry runs too, and test.ping for minion targetting
18:36 wangofett that's very nice
18:36 iggy the easiest way to start to understand Salt's oddities is to use salt for useful things (imo)
18:36 whytewolf ^ +1
18:36 wangofett iggy: natch. I've been using it for useful things and starting to build up an environment
18:37 wangofett we'll be doing pre-production testing soon
18:37 impi joined #salt
18:37 wangofett but there are still some cases that I don't have my head fully wrapped around yet
18:37 iggy you'll get there
18:38 wangofett what happens if we do X? What about Y? What if we put X *and* Y together? Do we get P or Q? Or PQ?
18:38 iggy I've been using salt for 2 years now or so... still learn new stuff
18:38 wangofett having some simpler states will make that go a little faster ;)
18:38 whytewolf iggy: likewise. about a year and a half and I still am finding WTF things
18:39 robawt +1
18:39 wangofett I guess it actually was more than that when I first encountered Salt at the PyArkansas conference
18:39 wangofett someone did a presentation that I thought was pretty neat... didn't use it myself until later
18:39 wangofett but I did snag a nice free Salt t-shirt ;)
18:40 iggy wangofett: another thing that helped me in the beginning was using salt-call -l debug on the minions and seeing the rendered (post-jinja) output
18:40 wangofett nice
18:41 whytewolf yeah -l debug is a biggie. write a module/state to get the feel of it. and actualy dig into some of the code
18:41 indispeq joined #salt
18:41 * wangofett has dug into a *lot* of saltstack code :P
18:41 whytewolf lol. most of us have :P
18:42 wangofett I can't remember which one it was... I ended out hacking one of the modules... oh right - msgpack
18:42 wangofett well, it was a response thing. msgpack was doing some weirdness on return. Just patching a line in there solved my problems
18:43 whytewolf ohhh, bug fix?
18:45 UtahDave XenophonF: Ah, cool! I'd be really interested to see your msi installers.  Are you using wix to build them?
18:45 colegatron joined #salt
18:46 wangofett whytewolf yeah. I think so. There was a bug at one point where I think the zmq return when it was deserializing msgpack was barfing all over the place, causing 100% cpu on the master
18:46 erchn joined #salt
18:46 wangofett I think that was what I was hacking anyway ^_^
18:47 erchn Hoping to get an opinion on the salt loader code, I'm using Nova/Swift and on one of my machines, I had failed to install the novaclient python library, in that case loader was saying that salt.modules.nova was returning None, when in fact it returns False on failed import.
18:48 morissette joined #salt
18:48 erchn Looking closer at line 1475 (on develop branch) virtual is being explicitly set to None, on import error
18:48 erchn https://github.com/saltstack/salt/blob/develop/salt/loader.py#L1475
18:48 erchn I feel like this should probably be set to False
18:49 erchn as the warning later down about the modules returning the wrong thing is a little misleading
18:49 erchn another option is that the nova modules should be catching the exception and returning False
18:55 digitalhero joined #salt
18:59 erchn ignore this, it's been fixed in the latest 2015.8 branch, and fixed again in develop
18:59 keepguessing joined #salt
19:00 keepguessing I have this definition of bridge in my sls and I find that eth0 and cbr0 end up having the same ip address.
19:01 keepguessing is my cbr0 state definition wrong?
19:01 wangofett keepguessing: have you checked ipaddr to make sure they don't really? ;)
19:01 wangofett or ipconfig
19:01 wangofett or whatever it is on your system lol
19:01 wangofett (i.e. use cmd.run)
19:01 keepguessing wangofett: ifconfig yes
19:02 keepguessing wangofett: I used ifconfig. I lost network to the machine. I had to go to the console and found this.
19:02 wangofett in that case, I'd assume that something is wrong with the state
19:03 keepguessing http://paste.ubuntu.com/14431990/ the definition of the state
19:04 drawsmcgraw joined #salt
19:05 whytewolf sooo, if the ip was on eth0, do you have anything to remove the ip from it?
19:06 undefinednull joined #salt
19:07 keepguessing whytewolf: no thats the main interface. I should not remove the ip from eth0.
19:07 keepguessing whytewolf: but how could it get the same ip.
19:07 keepguessing whytewolf: and it is happening everytime I run the state
19:07 undefinednull joined #salt
19:08 mohae joined #salt
19:08 whytewolf keepguessing: well, if it is a bridge, it must be getting the mac address of the eth0 which dhcp already has an ip address for
19:08 dalibro UtahDave: do you by any chance know how to pass args to runner via api ? (https://gist.github.com/daliborkrejic/b408baef463ae08812ff)
19:08 dalibro getting  this,  expected_extra_kws=CLIENT_INTERNAL_KEYWORDS
19:09 onlyanegg joined #salt
19:09 dalibro probably I'm not passing them right
19:10 UtahDave dalibro: yeah, let me find an example
19:10 armguy joined #salt
19:13 baweaver joined #salt
19:15 murrdoc UtahDave:  when is 2015.5 getting EOL'ed
19:18 ajw0100 joined #salt
19:18 iggy it is
19:18 mapu joined #salt
19:22 murrdoc what u mean it is
19:22 armguy joined #salt
19:24 iggy well, it's not getting any more releases... and I imagine any fixes are "if somebody remembers" or "if somebody else does the work"
19:24 twork so, it's obvious what i want to do here; i don't know what the correct syntax is and i've tried for a couple hours to figure it out: https://gist.github.com/mjinks/d118f82ebf2fda2789ee
19:25 rem5 joined #salt
19:25 twork my big frustration is, i'd like to figure this out for myself, but i fail.
19:25 erchn twork, put the jinja block above the state, then use "target: {{ target }}" in the state
19:25 zmalone murrdoc: If you have support, probably May 2016
19:25 twork teach me to fish.
19:25 zmalone http://saltstack.com/wp-content/uploads/2015/03/SaltStack-Enterprise-Support-Maintenance-Services-Terms-21015.pdf
19:26 twork thanks erchn
19:26 iggy lol, support for 20000 servers
19:26 digitalhero joined #salt
19:27 zmalone I think 2015.5.9 was recently tagged, so there will be at least one more release on that
19:27 sfxandy joined #salt
19:28 rm_jorge joined #salt
19:28 zmalone "Just wanted to give a heads up that we plan to tag 2015.5.9 around the end of this week."
19:29 bhosmer_ joined #salt
19:30 k00mi joined #salt
19:30 jhujhiti_ joined #salt
19:30 twork i thought i'd seen other cases (written by not-me) where jinja was inside a logic area instead of outside it.
19:31 bstaz_ joined #salt
19:31 twork maybe that was in a template and not a state. i dunno.
19:31 Ryan_Lane_ joined #salt
19:31 dalibro twork, what about this? https://gist.github.com/mjinks/d118f82ebf2fda2789ee (comment)
19:31 iggy there were 2 2014.7 tags after the last release
19:32 jcristau_ joined #salt
19:32 buhman_ joined #salt
19:32 armguy joined #salt
19:33 Kelsar_ joined #salt
19:33 clemensb joined #salt
19:33 rubenb_ joined #salt
19:33 ablemann_ joined #salt
19:33 kevinqui2nyo joined #salt
19:33 twork dalibro: hm, i thought i'd tried something to that effect and gotten an error. must have been something !that.
19:33 GnuLxUsr_ joined #salt
19:34 tawm04_ joined #salt
19:34 twork oh well! the jinja-outside-the-logic idea works.
19:34 twork happy with that.
19:34 OliverMT_ joined #salt
19:34 erchn twork, look at my latest comment on your gist
19:34 ramblinpeck_ joined #salt
19:34 mikepea_ joined #salt
19:34 quasiben joined #salt
19:35 erchn that should also work, the target is a dict, not a list, so the leading dash should only be in front, not in the values as well
19:35 dalibro right !
19:35 bluenemo how can I use pkgrepo.managed to also add a deb-src line instead of only the deb when adding a ppa in ubuntu?
19:36 Kelsar_ joined #salt
19:36 copelco_ joined #salt
19:37 brucewang joined #salt
19:37 georgemarshall_ joined #salt
19:37 seblu42 joined #salt
19:37 DaveQB14 joined #salt
19:38 dober joined #salt
19:38 dober joined #salt
19:39 keepguessing joined #salt
19:39 twork erchn: aha, yes, i did not do it that way; the 'cargo' i culted had (which i thought was strange) looked like the snippet now in my last comment, https://gist.github.com/mjinks/d118f82ebf2fda2789ee
19:40 rem5 joined #salt
19:40 sjorge joined #salt
19:40 sjorge joined #salt
19:40 _ikke_ joined #salt
19:40 twork i think. of course i don't have that example right handy any more, been too busy thrashing around for some other example to learn from
19:40 beardedeagle I assume that if I setup salt with ZeroMQ and decide to change to RAET later, I can simply install the reqs and change the transport in the configs rather than having to destroy my master and recreate?
19:41 spaceSub joined #salt
19:41 feliks joined #salt
19:41 JPaul joined #salt
19:41 iggy beardedeagle: not exactly
19:41 dyasny joined #salt
19:41 iggy you have to rekey everything
19:41 jhujhiti joined #salt
19:41 Fabbe joined #salt
19:41 Vye joined #salt
19:41 iggy but you can use the same master (just not at the same time... i.e. a single master can't run zmq and raet at the same time)
19:41 cheus joined #salt
19:42 chitown joined #salt
19:42 nZac joined #salt
19:42 stolenmoment joined #salt
19:42 erchn twork, either way, setting a variable doesn't make it magically appear in the output rendered Jinja, you need to "{{ variable }}" to put it where you want it
19:42 beardedeagle werd. I needed to spin this all up in a new project anyway. Good of time as any to destroy and rebuild.
19:42 kbyrne joined #salt
19:43 tzero joined #salt
19:43 stolenmoment left #salt
19:43 jay_d joined #salt
19:43 okfine joined #salt
19:44 aboe joined #salt
19:44 twork erchn: what about, {% variable = 'foo' %} ; {% if variable == 'blah' %} [...] ?
19:45 erchn {% set variable = 'foo' %}; {% if variable == 'blah' %} [...]
19:46 erchn but yeah, you can use that variable in future logic functions
19:46 erchn logic blocks*
19:47 zer0def joined #salt
19:47 erchn twork, I wouldn't hesitate to google "jinja2" and look at the examples, look at the "template designer" document on the main Jinja site
19:48 twork erchn: thanks, that's probably a good idea. early in this adventure i (think i) did do that, but i'm probably due for a refresher, now that i have some context for how all this stuff gets put into use
19:50 twork something i'm still not clear on though:
19:50 undefinednull joined #salt
19:51 twork i've gotten the idea (wrong obviously) that jinja gets resolved in a first pass, then the python logic; so, it wouldn't matter where it's placed in the state file.
19:52 iggy what python logic?
19:52 erchn yea, that's not correct.  Jinja is executing the Python logic (if blocks for instance), and setting variables etc all in one pass, the second pass is Salt parsing the resulting Yaml, in this case.
19:53 twork iggy: ...isn't it python what knows the "name:\n  this.that:\n    - oh: my"?
19:53 murrdoc zmalone:  so support till may 2016 if one is paying saltstack for support ?
19:53 zmalone That would be what is implied by that doc, although parts of it looks out of date
19:53 zmalone I would imagine 2015.5 will see public patches until then too
19:54 murrdoc dear god
19:54 erchn twork, think of Jinja as being a hybrid language loosely based around Python, and copying many of the patterns.  The Jinja rendering happens, the Yaml is handed to Salt, and we carry on.
19:54 murrdoc what page
19:55 twork erccn: ah, ok, so... what i had been calling "salt talking python" was yaml?  learning all this stuff at the same go... which is what...
19:55 erchn that's not to say that you cannot use some Python functions, like "variable.startswith('a')", but you can do most things using what Jinja shows on their template design page
19:56 erchn I need to run, good luck
19:56 twork so you see why i get tripped up, putting logic in wrong contexts
19:56 twork thanks, i'm set i think
19:56 digitalhero joined #salt
19:57 twork definitely set in this case, maybe a tad better at this too...
19:57 zmalone murrdoc: section 9, "Support Services cover the current Major Release and two prior Major Releases for at least 12 months after its general release. In addition, Support Services cover all Minor Releases under a currently supported Major Release. Customer must upgrade or update to a supported version of the Software to continue to receive the support services described herein."
19:57 edrocks joined #salt
19:57 murrdoc oh
19:57 murrdoc i never seent that
19:57 murrdoc thanks zmalone
19:59 M-MadsRC joined #salt
19:59 iggy murrdoc: just cough up a couple million to get support and you'll be fine
20:00 wendall911 joined #salt
20:02 tehsu is there a way to put --return smtp into an sls
20:02 * murrdoc gets paid less than a 20th of that
20:03 tehsu is enterprise support different from the paid supprot in the topic?
20:04 linjan joined #salt
20:05 iggy I would assume so
20:06 iggy I mean sse actually has separate releases and all
20:08 jasonrm joined #salt
20:09 murrdoc is there opensource support
20:09 murrdoc is that cheaper than $100 a host
20:09 undefinednull joined #salt
20:12 digitalhero joined #salt
20:12 coval3nce joined #salt
20:13 om Hey guys.  Any ideas on using salt for nagios server and nrpe/nsclient++ client minion deployment?  I want to move away from the puppet nagios server/nrpe client setup I have using puppet export resources.  What features are suggested and used in lieu of puppet export resources?
20:13 whytewolf murrdoc: isn't that kind of what this channel is for :P
20:13 coval3nce is there a way to change /etc/salt/minion config options via a salt module command? https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.config.html#module-salt.modules.config only appears to be setters and not getters.
20:14 whytewolf coval3nce: MOST salt minion configs can be set as pillars
20:14 XenophonF UtahDave: i'm building the intallers using bdist_msi
20:14 coval3nce Im running into an issue upgrading from Salt 2015 to 2018 with master_type set to ‘standard’ vs ‘std’.
20:14 coval3nce @whytewolf was hoping to figure out how to change it BEFORE i upgade the rest of my minions so i dont ahve to manually login fix/restart
20:15 XenophonF UtahDave: next step is to try to chain them together using something like http://wixtoolset.org/documentation/manual/v3/xsd/wix/msipackage.html
20:15 om Any integrated modules or states for full nagios deployment?
20:15 armguy joined #salt
20:15 whytewolf coval3nce: file.manged. since the upgrade will need to restart the salt-minion anyway
20:15 XenophonF UtahDave: it might be better to write a proper service using win32service et al (http://www.chrisumbel.com/article/windows_services_in_python)
20:15 huds joined #salt
20:16 coval3nce @whytewolf ok, i’ll have to make sure to run that before the upgrade then i guess.  damn schema changes ;)
20:16 om this looks promising
20:16 om https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.nagios.html
20:16 XenophonF UtahDave: i'm only using MSI for bootstrapping
20:16 om but for server side?
20:16 XenophonF UtahDave: ideally, salt would install into an existing python27 runtime on windows just like on linux, right?
20:17 dalibro joined #salt
20:17 XenophonF UtahDave: so MSIs could be provided to facilitate bootstrapping, but "pip install salt" should work right, too
20:18 dalibro UtahDave: sorry, felt off, did you maybe found an example ? I've looked @ libpepper, but can't find anything :-(
20:18 coval3nce @whytewolf sed command sounds quicker ;)
20:18 whytewolf coval3nce: file.replace then :P
20:19 OpsDave joined #salt
20:20 coval3nce @whytewolf hell didnt even know that module existed, RTFM'ing
20:23 larsfronius joined #salt
20:24 adelcast does anyone know if there is a way to configure external auth on minions? I want to restrict which execution modules certain users can call
20:24 adelcast via salt-call
20:24 adelcast I haven't tried it, but maybe external_auth works on the minion as it works on the master?
20:26 baweaver joined #salt
20:26 antpa joined #salt
20:27 nZac joined #salt
20:30 slav0nic basepi, hi, can you check https://github.com/saltstack/salt/issues/26070
20:30 saltstackbot [#26070]title: Custom grains aren't available to pillars | ### Problem Description...
20:32 Destreyf joined #salt
20:32 edrocks joined #salt
20:35 otter768 joined #salt
20:38 felskrone joined #salt
20:40 mapu joined #salt
20:41 ipmb joined #salt
20:47 nZac joined #salt
20:49 tehsu so, anyone know if its possible to put return smtp into a state
20:54 armguy joined #salt
20:57 baweaver joined #salt
20:59 ajw0100 joined #salt
21:04 Bryson joined #salt
21:05 ajw0100 joined #salt
21:13 ranomore joined #salt
21:14 M-MadsRC joined #salt
21:14 ranomore left #salt
21:14 digitalhero joined #salt
21:17 baweaver joined #salt
21:21 gh35 left #salt
21:23 GreatSnoopy joined #salt
21:24 NaPs joined #salt
21:26 PeterO joined #salt
21:27 rem5 joined #salt
21:31 conan_the_destro joined #salt
21:35 quasiben1 joined #salt
21:35 baweaver joined #salt
21:36 sdm24 can I have reactor files in gitfs, like my states? Or do they have to be local?
21:36 drawsmcgraw sdm24: Looking at my configs, they can be in gitfs
21:36 ryau joined #salt
21:37 drawsmcgraw In fact... mine *are* in gitfs
21:37 sdm24 ooh, would you mind pasting them?
21:37 sdm24 or at least an example haha, I can't find anything googling
21:37 drawsmcgraw I'll show you my reactor config, one second
21:38 sdm24 yeah thats what I meant, i don't need teh .sls files
21:38 sdm24 thanks
21:38 antpa joined #salt
21:39 ryau_ joined #salt
21:39 drawsmcgraw sdm24: http://dpaste.com/3DBDAJ9
21:40 drawsmcgraw The sls was right there, so I put that in as well
21:40 drawsmcgraw My use of Reactor is limited to salt-api
21:40 drawsmcgraw But all you'd need to do is replace that line 'salt/netapi/hook/riemann-update-configs' with the proper Salt event to react to.
21:43 sdm24 thanks drawsmcgraw. I didn't know you can use salt://reactor, all the examples I saw were /srv/reactor
21:44 baweaver joined #salt
21:44 drawsmcgraw ah
21:44 drawsmcgraw Yeah it's just using the Salt file server
21:44 drawsmcgraw So at the base of my Salt state tree, I have a directory called 'reactor'
21:45 digitalhero joined #salt
21:46 marsdominion joined #salt
21:46 marsdominion joined #salt
21:48 felskrone joined #salt
21:50 snarfy joined #salt
21:51 cyborg-one joined #salt
21:51 snarfy Yo.
21:51 justanotheruser joined #salt
21:51 jay_d joined #salt
21:51 dyasny joined #salt
21:51 feliks joined #salt
21:51 sjorge joined #salt
21:51 jcristau_ joined #salt
21:51 bstaz joined #salt
21:51 colegatron joined #salt
21:51 notnotpeter joined #salt
21:51 stbenjam_ joined #salt
21:51 egil_ joined #salt
21:51 Theo joined #salt
21:51 denys joined #salt
21:51 godlike joined #salt
21:51 llua joined #salt
21:51 invalidexception joined #salt
21:51 titilambert joined #salt
21:52 tehsu is there a list of what can go into a returner in a schedule
21:53 murrdoc everything can go in a returner
21:53 murrdoc in that all returner can go
21:53 snarfy I've been using salt-cloud for aws, vmware, and lxc. and when we use it for lxc, it executes runners for each lxc provider, regardless of which cloud provider i'm working with. I can do --list-locations vmware and I get salt-runners for lxc containers running
21:54 snarfy is this expected behavior?
21:54 tehsu nevermind, found the list, https://docs.saltstack.com/en/latest/ref/returners/all/index.html#all-salt-returners
21:55 justanotheruser joined #salt
21:56 toastedpenguin joined #salt
21:57 tiadobatima joined #salt
22:00 onlyanegg joined #salt
22:02 UtahDave snarfy: I don't think that is expected behavior.  Have you checked if there is an open issue on that already?
22:03 silicon_id joined #salt
22:04 snarfy not specifically, though i didn't see anything googling the kws. i'll doublecheck the GH issues.
22:06 silicon_id when using the tomcat module, I keep getting a failure when deploying war files with the comment "Failed to create HTTP request"
22:06 digitalhero joined #salt
22:08 silicon_id I'd really like to be able to integrate salt into our jenkins pipeline for deploying, but this is the sticking point
22:09 snarfy i don't see anything. I'll see if I can dig into it some more. might not get to it til later tho. Thanks for the heads up. I couldn't tell if it was supposed to be happening or not
22:10 huds joined #salt
22:10 drawsmcgraw silicon_id: can you approach it from another angle?
22:10 onlyanegg joined #salt
22:10 drawsmcgraw Maybe a service.running() against Tomcat?
22:10 snarfy it doesn't break anything per se, it's just odd to have to interact with those containers for no apparent reason
22:10 drawsmcgraw or service.restart, or stop/start, or some combination?
22:11 drawsmcgraw Or hell, just a cmd.run and use the catalina.sh script that ships with Tomcat
22:12 LondonAppDev joined #salt
22:12 silicon_id tomcat is running, pillar is set with user/passwd for tomcat manager
22:13 silicon_id I can successfully run tomcat.fullversion, none of the other functions seem to be working
22:14 snarfy oh, actually i guess it does break things since salt-cloud doesn't work at all if one of those containers is down
22:14 snarfy what have i done...
22:16 coval3nce joined #salt
22:17 coval3nce is there a workaround for https://github.com/saltstack/salt/issues/29511 without having to build and distribute a minion fro the head branch?
22:17 saltstackbot [#29511]title: Exception raised when processing __virtual__ function for nova. Module will not be loaded global name 'novaclient' is not defined | A quick look at the code, the bug seems to be in salt/utils/openstack/nova.py where novaclient is try/except importerror but then check_nova uses novaclient which doesn't exist. ...
22:19 keimlink joined #salt
22:20 chrismoos joined #salt
22:20 cpowell_ joined #salt
22:21 ryau joined #salt
22:22 whytewolf coval3nce: looks like a fix for that will be in 2015.8.4 in the meantime you could replace your utils/openstack/nova.py with the one from the head of 2015.8
22:22 coval3nce @whytewolf yeah was going to see about getting a patch diff form the commit for the fix and using file.patch
22:22 whytewolf coval3nce: https://github.com/saltstack/salt/pull/29196/files
22:22 saltstackbot [#29196]title: We need novaclient imported to compare versions |
22:23 ryau__ joined #salt
22:24 coval3nce whoa, you can add “.patch” to a commit in github
22:24 coval3nce that is epic
22:25 larsfronius joined #salt
22:26 JDiPierro joined #salt
22:27 frew ok, so I'm restructuring my code to better match the Salt Best Practices (after a gentle correction from my boss)
22:27 frew the main thing is that I'm migrating pillar data to match the respective states better
22:28 frew (before I had pillar data within roles instead of a more tight coupling with the related state)
22:29 nZac joined #salt
22:29 frew so instead of having two files, a role.www and a role.ops, both containing a set of gems that gets merged, I'm moving to a single ruby role which picks the set of gems inside the pillar
22:29 frew so this is my new file
22:29 frew https://gist.github.com/frioux/1ea9135533790da24937
22:30 frew does this look reasonable?
22:30 ryau joined #salt
22:30 murrdoc with varying definitions of reaso
22:30 frew heh
22:30 murrdoc is that a top.sls ?
22:30 frew no
22:30 frew it's pillar/ruby.sls
22:31 murrdoc and roles is defined in jinja
22:31 frew right
22:31 frew so given that, how do I correctly handle if neither of those two if blocks match?
22:32 frew the yaml will be invalid if they do not
22:32 murrdoc put a - null at the end of it
22:32 frew ok
22:32 murrdoc "- null"
22:32 frew right
22:32 frew will salt filter that out or should I when I consume the data?
22:33 whytewolf or put a gem you know has to go on every system regardless or a gem that is installed always
22:33 frew whytewolf: if there were one I would
22:33 nZac joined #salt
22:33 coval3nce Anyone have an examle of how to do an unless requisite for a specific salt version?
22:35 frew murrdoc: how do you handle the null value?  Does jinja have a list comprehension?
22:35 * frew is looking
22:36 ryau joined #salt
22:36 frew looks like I can use a list comprehension
22:36 murrdoc u dont need to
22:36 otter768 joined #salt
22:36 frew oh it does it automatically or something?
22:36 murrdoc u ll iterate over it ?
22:37 frew well that's how I'll install the packages, right?
22:37 murrdoc put a iterable and count
22:37 murrdoc jinja has checks for both
22:37 baweaver joined #salt
22:37 frew not really following...
22:37 frew sorry
22:39 murrdoc {% if salt[pillar.get]('ruby') |length ==0 %}
22:39 frew yeah just adding "if gem" to the end of the iteration seems to work fine
22:39 frew lemme show you; maybe I'm missing something
22:39 murrdoc well if gem will work too
22:39 frew https://gist.github.com/frioux/1ea9135533790da24937
22:39 frew the pillar is the top one
22:40 UtahDave left #salt
22:40 writteno1 joined #salt
22:42 frew murrdoc: shoudl I be using salt[pillar.get]('ruby') instead of just pillar.get('ruby') ?
22:42 frew the former certainly looks noisier
22:43 sdm24 coval3nce: it's not an exact answer to your question, but I have an upgrade state, where I use {% if grains['saltversion'] == '2015.8.3'  %}
22:43 iggy salt['pillar.get'] if you want to use nested lookups
22:43 murrdoc i prefer salt['pillar.get']
22:43 frew huh, ok
22:43 murrdoc iggy:  prefers salt.pillar.get
22:43 iggy and then for consistency
22:43 RobertChen117 joined #salt
22:43 sdm24 coval3nce: where instead of unless, you  can wrap your state around {% if %} and {% else %} tags
22:44 coval3nce @sdm24 I tried “- onlyif: {{ salt['grains.get']('saltversion') == '2015.8.3' }}"
22:44 coval3nce seems to work, excepct now im runnin ginto exceptions being thrown by file.patch ;)
22:44 iggy onlyif has to be a shell command
22:44 coval3nce oh….so it probably always works
22:45 rem5 joined #salt
22:45 zenlot1 joined #salt
22:46 sdm24 I think unless is based only on exit codes
22:47 ryau_ joined #salt
22:49 coval3nce hmm does file.patch expect the md5 AFTER the file has been patched?
22:50 coval3nce ah yes, yes it does
22:51 ryau joined #salt
22:57 rem5 joined #salt
22:58 tiadobatima joined #salt
22:58 tiadobatima joined #salt
22:59 tiadobatima joined #salt
22:59 frew when I write a pillar, can it be written in python directly?
23:01 tiadobatima1 joined #salt
23:01 ajw0100 joined #salt
23:01 tiadobatima joined #salt
23:02 XenophonF i think you can do it using the python renderer, instead of the default jinja+yaml one
23:03 frew XenophonF: any docs on that?  I can't find it
23:03 frew aha
23:04 XenophonF https://docs.saltstack.com/en/latest/ref/renderers/index.html
23:05 tiadobatima joined #salt
23:05 XenophonF http://citynav.com/2014/06/saltstack-python-renderer-examples/
23:05 frew yeah it seems to work
23:05 XenophonF https://docs.saltstack.com/en/latest/ref/renderers/all/salt.renderers.pyobjects.html
23:05 XenophonF pyobjects is another way to do it
23:05 XenophonF https://docs.saltstack.com/en/latest/ref/renderers/all/salt.renderers.pydsl.html
23:06 XenophonF https://docs.saltstack.com/en/latest/ref/renderers/all/salt.renderers.py.html
23:06 frew this is awesome
23:06 frew XenophonF: thanks
23:06 XenophonF dude, salt's the best!
23:06 frew I'm not sold yet, but I'm not sold on CM so... :)
23:06 * frew 'll come around
23:06 XenophonF heh
23:09 XenophonF frew: here's something slightly different, a reactor script written using the py renderer
23:09 XenophonF https://github.com/irtnog/salt-states/blob/development/salt/files/reactors/github.sls
23:09 XenophonF that's a work in progress
23:09 XenophonF i'm not entirely sure it works yet
23:09 XenophonF but you'll get the idea
23:09 frew I haven't done anything with reactors yet
23:10 frew so with the normal jinja+yaml pillar you can import other pillars to get pillar data during pillar... compilation
23:10 frew any idea how to do that with python?
23:10 frew because __pillar__ is not available (Which isn't super surprising)
23:10 XenophonF no
23:11 XenophonF you can't refer to pillar data when you're rendering pillar data, as the pillar data doesn't exist until after rendering finishes
23:11 XenophonF it's circular, right?
23:11 frew it works with normal jinja because you can pull it in
23:11 frew lemme show you how we did it and maybe you'll see what I mean
23:11 frew https://gist.github.com/frioux/1ea9135533790da24937#file-state-sls-L3
23:11 drawsmcgraw left #salt
23:11 frew note that it is clearly accessing the pillar/roles/map.jinja
23:12 XenophonF that's not
23:12 XenophonF you're confusing two different things
23:12 frew ok?
23:12 XenophonF um
23:12 frew (very possible)
23:12 XenophonF i'm not sure how to explain this well
23:12 frew fwiw this *does* work, I might jsut be using the wrong words
23:12 XenophonF so i'm going to explain it badly! :)
23:12 frew well I know it works and I have a good feel for how it worsk
23:13 XenophonF heh
23:13 frew (by skipping salt entirelyu and reading the data myself)
23:13 XenophonF with a {% from ... import ... %} in jinja, you're loading code/data from the file system
23:13 frew right.
23:13 XenophonF same goes for {% import_yaml ... %} or {% import_json ... %}
23:13 frew I guess I could do the same thing with python, but the data I'd load would have to be written in python
23:13 XenophonF that's not pillar data at that point
23:14 frew right
23:14 frew I understand that
23:14 XenophonF ok
23:14 XenophonF maybe i misunderstood you
23:14 frew nah it's fine
23:14 frew basically now the issue is
23:14 frew if I write a pillar in python
23:14 frew I can no longer use that to reuse data within pillars
23:14 frew I have to switch the shared data to python
23:14 frew and then I have to switch evertying using that shared data to python
23:15 frew and suddenly I've forced my whole project to switch away from jinja entirely
23:15 frew right?
23:15 XenophonF i see where you're going with that
23:15 XenophonF so from jinja can you do the equivalent of {% from ... import ... %}, only import something written in python
23:15 XenophonF and i think the answer is, no, you can't
23:16 XenophonF but i'm checking
23:16 XenophonF https://docs.saltstack.com/en/latest/ref/renderers/all/salt.renderers.jinja.html
23:16 frew XenophonF: if it's not obvious I'm very grateful for your help so far
23:17 frew I'd guess that this is a security issue; don't want people loading python from templates
23:18 XenophonF pillar data gets rendered on the salt-master
23:18 XenophonF only the final data structure gets sent to the minion
23:18 frew I... could maybe use salt.renderers.jinja from within python to pull in jinja data
23:19 XenophonF you might be better off encapsulating this in an execution module, which would be accessible from any of the renderers
23:19 frew is that an external pillar?
23:20 XenophonF http://stackoverflow.com/questions/4828406/import-a-python-module-into-a-jinja-template#4829057
23:21 frew what is the exectuion module thing you are saying?
23:21 XenophonF so i think the ultimate answer is "no, you can't import python code into a jinja template"
23:21 XenophonF so you'd write your own version of something like salt/modules/cmdmod.py
23:21 frew right
23:21 XenophonF you can put that into _modules, sync to the master...
23:21 XenophonF but wait a second
23:21 XenophonF what are you trying to accomplish?
23:22 cpowell joined #salt
23:22 frew right
23:22 XenophonF there might be a simpler way to do it
23:22 frew always a good question
23:22 whytewolf the most important question
23:22 frew so there are 3 parts involved here (that I know of)
23:22 frew the most fundamental is our roles, which basically servers "do"
23:22 frew and that is the data that needs to be reused ALL THE TIME
23:22 frew it's data that both pillars and states need access to
23:23 frew and then of course there is my pillar data based on those roles
23:23 frew and then the state that pills in the pillar data, but I don't think that's important right now
23:23 XenophonF like if you're trying to combine the values of two pillar keys, don't compose that in pillar itself
23:24 frew I'm sorry I don't follow
23:24 XenophonF e.g., if you have a pillar key named 'environment' and another named 'role'
23:24 XenophonF don't try to hack some code together that creates a pillar key named "envrole"
23:24 XenophonF at least, not in pillar
23:24 frew no I wouldn't
23:24 XenophonF create that combination elsewhere
23:25 frew for us, roles is a list
23:25 XenophonF so here's how i'm making role and environment assignments
23:25 XenophonF https://github.com/irtnog/salt-pillar-example
23:26 JDiPierro joined #salt
23:26 XenophonF mine's a little simpler - a role is not multi-valued
23:26 frew hah
23:26 frew clever
23:27 XenophonF and then putting that together with states:
23:27 XenophonF https://github.com/irtnog/salt-states/blob/master/top.sls
23:27 larsfronius joined #salt
23:29 hasues joined #salt
23:29 whytewolf yay, I almost get to start building my 3.0 personal openstack enviroment. the network cable finally came
23:29 hasues left #salt
23:29 frew so you basically have a single environement (Which we call server-class) and a single role per server (Which we have multiple of)
23:29 frew I still don't see how to make the role information more generally accessible
23:31 XenophonF brb
23:35 XenophonF back
23:35 frew welcome back :)
23:35 frew it seems to me like the best option is an external pillar that gets loaded early
23:35 XenophonF no i have multiple environments following the DTAP phases: dev/test/stage/prod
23:36 ajw0100 joined #salt
23:36 XenophonF and a single role per server, but a multi-role server is just another role with more states attached to it
23:36 frew ok
23:36 XenophonF i could have "role: minecraft" and "role: webforum" and "role: minecraft+webforum"
23:37 pppingme joined #salt
23:38 M-MadsRC joined #salt
23:39 XenophonF all targeting is in states/top.sls
23:39 frew I guess what I'm not seeing is where you have pillar data generated in your salt-pillar-example repo
23:39 frew based on the role
23:39 XenophonF i absolutely do not do that and do not recommend it
23:39 XenophonF waaaaaaaaaaaaay too complicated
23:39 frew ok
23:39 frew well...
23:39 XenophonF here's how i do it
23:40 frew I'm not sure how I can talk my boss out of it?
23:41 digitalhero joined #salt
23:44 TyrfingMjolnir joined #salt
23:45 subsignal joined #salt
23:47 RandyT lorengordon: you around?
23:48 lorengordon RandyT: i am
23:48 RandyT wanted to see if I could pester you again for some feedback on something I am trying to do...
23:48 RandyT https://gist.github.com/rterbush/b08c2eb429162d40d77f
23:48 XenophonF frew: the combo of the environment and role pillar keys determine which states get sent to minions
23:49 frew right.
23:49 lorengordon ok, i'm looking at it
23:49 RandyT would be interested to know if this is even a good idea.. and then secondly, if you have thoughts as to why this powershell script works from command line on the server and not when called from this state.
23:49 XenophonF frew: there is a separate pillar SLS that contains all of the pillar keys that configure those states
23:49 XenophonF NOT the environment or role pillar SLS files
23:49 frew right.
23:49 neogenix joined #salt
23:49 frew well
23:49 frew for whatever reason
23:49 XenophonF so looking at my salt-pillar-example repo, you'll notice that environment/*.sls and role/*.sls are empty
23:50 frew yeah I did notice that
23:50 XenophonF except for setting the environment and role keys
23:50 RandyT some odd behavior in that I am forced to sleep waiting for the amount of time I expect the compression of the file to take as well, which seems lame
23:50 frew XenophonF: ok
23:50 RandyT so not sure if it is blocking somehow since when run from command line, it pops up a dialog box with progress bar...
23:50 fredvd joined #salt
23:50 XenophonF but the rest of the production salt master config is in salt/example/com/init.sls (which gives the very pretty looking salt.example.com assignment in pillar/top.sls)
23:51 RandyT calling this state from a schedule...
23:51 lorengordon i tend to use 'start /wait' if i need it to block, or in powershell i'll use 'start-process -wait'
23:51 XenophonF i name those final pillar SLS files after the public service endpoint of a given service package
23:51 frew m.
23:52 frew I guess either this is beyond me or we are talking past each other
23:52 lorengordon this script is complex enough that i wouldn't embed it in the cmd.run state
23:53 frew XenophonF: hoenstly I don't think I can fundamentally change the meaning or application of roles here
23:53 frew maybe after I've learned salt more, but as it stands I don't think that's a real option for me
23:53 lorengordon parameterize the values you want to pass in, save the ps1 script in the same file_roots location as the state, and use cmd.script
23:53 RandyT lorengordon: ok, suggest using a file.managed: to install and run it on schedule?
23:54 RandyT ah, ok
23:54 lorengordon are you familiar with parameterizing powershell scripts? it's pretty easy
23:55 RandyT lorengordon: not really... cannot recall if past examples you have shared were doing this... I will dig around unless you have an easy pointer
23:55 murrdoc i d like to see a paste
23:55 M-liberdiko joined #salt
23:56 XenophonF that's cool
23:56 XenophonF i'll confess that i don't completely understand what you're trying to do with pillar
23:56 lorengordon first line of the script would be `[CmdLetBinding()]`
23:56 XenophonF so, my apologies for muddying the waters here
23:56 frew eh no big deal
23:57 frew I'm gonna try something more my speed and then com back to this later
23:57 lorengordon then you can add params in a `Param()` block, like so: `Param($ParamName1, $ParamName2, $ParamName3)`
23:57 lorengordon Each param can go on a separate line to keep it clean
23:57 RandyT lorengordon: ok, will give that a try. Thanks again for your help as always.
23:58 lorengordon you can set a default value just using `$ParamName1='mydefault'`
23:58 RandyT ok
23:58 lorengordon you can enforce types and do validation, as well, if you want to get fancy
23:58 RandyT my powershell is progressing slowly as you can see. :-)

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