Perl 6 - the future is here, just unevenly distributed

IRC log for #salt, 2014-09-01

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

All times shown according to UTC.

Time Nick Message
00:00 grepory_ joined #salt
00:02 TamCore joined #salt
00:02 rnts joined #salt
00:02 ShibMcNe joined #salt
00:02 csa_ joined #salt
00:02 DenkBret1l joined #salt
00:02 Bosch[]_ joined #salt
00:02 lionel_ joined #salt
00:02 svx_ joined #salt
00:02 jerrcs joined #salt
00:02 MTecknol1gy joined #salt
00:02 beebeeep joined #salt
00:02 arochett1 joined #salt
00:02 arnoldB joined #salt
00:02 tru_tru_ joined #salt
00:02 vividloop_ joined #salt
00:02 teepark_ joined #salt
00:03 trevorjay joined #salt
00:03 imil_ joined #salt
00:03 uzomg joined #salt
00:03 honestly_ joined #salt
00:05 codekoala-simann joined #salt
00:05 codekoala-simann joined #salt
00:05 tempspace_ joined #salt
00:06 rigor789|away joined #salt
00:06 dstokes_ joined #salt
00:06 ZombieTwiglet joined #salt
00:06 garphy`aw joined #salt
00:06 EugeneKay joined #salt
00:06 MKFG joined #salt
00:06 homelinen_ joined #salt
00:06 \ask_ joined #salt
00:06 crane joined #salt
00:06 g3cko_ joined #salt
00:06 keekz_ joined #salt
00:06 Blacklite_ joined #salt
00:06 samed_ joined #salt
00:07 dccc joined #salt
00:08 ecdhe joined #salt
00:09 vbabiy joined #salt
00:09 homelinen joined #salt
00:09 MTecknology joined #salt
00:10 schimmy joined #salt
00:11 samed joined #salt
00:20 diegows joined #salt
00:22 soasme joined #salt
00:22 jalbretsen joined #salt
00:25 diegows joined #salt
00:26 njs126 joined #salt
00:30 kingel joined #salt
00:42 to_json joined #salt
00:46 oz_akan joined #salt
00:48 aquinas joined #salt
00:56 aquinas_ joined #salt
00:57 adsisco_ joined #salt
01:05 djinni` joined #salt
01:08 djinni` joined #salt
01:22 djinni` joined #salt
01:25 Ryan_Lane joined #salt
01:28 TTimo joined #salt
01:30 pled76 joined #salt
01:33 bhosmer joined #salt
01:42 malinoff joined #salt
01:46 pled76 joined #salt
01:47 ngo joined #salt
01:47 oz_akan joined #salt
01:51 diegows joined #salt
01:51 pled76 joined #salt
01:57 pled76 joined #salt
01:57 rome joined #salt
01:58 vbabiy joined #salt
02:04 favadi joined #salt
02:06 zhipengh joined #salt
02:09 thayne joined #salt
02:15 kingel joined #salt
02:20 to_json joined #salt
02:26 vbabiy joined #salt
02:27 TTimo joined #salt
02:27 rjc joined #salt
02:38 steaksinger joined #salt
02:47 pled76_ joined #salt
02:48 oz_akan joined #salt
02:48 MK_FG joined #salt
03:00 jnials joined #salt
03:19 ajolo joined #salt
03:21 bhosmer joined #salt
03:28 oz_akan joined #salt
03:31 Ryan_Lane joined #salt
03:35 pled76 joined #salt
03:42 jkaye joined #salt
03:58 rome joined #salt
04:02 dvestal joined #salt
04:04 kingel joined #salt
04:24 Jana joined #salt
04:25 MK_FG joined #salt
04:25 dvestal joined #salt
04:30 thayne joined #salt
04:31 hjst joined #salt
04:40 jkaye joined #salt
04:41 jalaziz joined #salt
04:41 pled76 joined #salt
04:43 felskrone joined #salt
04:44 felskrone1 joined #salt
04:47 pled76 joined #salt
04:49 ramteid joined #salt
04:49 flebel joined #salt
05:01 melinath joined #salt
05:07 jkaye joined #salt
05:08 TTimo joined #salt
05:10 bhosmer joined #salt
05:17 yomilk joined #salt
05:19 pled76 joined #salt
05:36 ianmcshane joined #salt
05:42 pled76 joined #salt
05:46 pled76_ joined #salt
05:48 Ryan_Lane joined #salt
05:51 oz_akan joined #salt
05:53 kingel joined #salt
05:55 to_json joined #salt
05:59 rome joined #salt
06:01 colttt joined #salt
06:05 agend joined #salt
06:10 dccc_ joined #salt
06:11 n8n joined #salt
06:11 TTimo joined #salt
06:24 duncanmv joined #salt
06:26 agend joined #salt
06:27 catpiggest joined #salt
06:36 yomilk joined #salt
06:38 masm joined #salt
06:38 pled76 joined #salt
06:41 jnials joined #salt
06:43 Sweetsha1k joined #salt
06:45 lcavassa joined #salt
06:52 oz_akan joined #salt
06:53 ianmcshane joined #salt
06:59 bhosmer joined #salt
07:03 pled76 joined #salt
07:03 MrTango joined #salt
07:03 kingel joined #salt
07:07 geekmush joined #salt
07:09 colttt joined #salt
07:12 sectionme joined #salt
07:14 slav0nic joined #salt
07:16 Damianz_ joined #salt
07:17 pled76 joined #salt
07:17 jhauser joined #salt
07:19 Damianz_ Hi, I have a question in regards to failover masters - it seems you need all the masters running to start a minion? I have a minion pointing at 2 masters, 1 master goes away while running things carry on working as expected... only 1 master is up on minion restart and it fails with a SaltClientError exception and 'Error while bring up minion for multi-master. Is master responding?' in the logs.
07:19 Damianz_ joined #salt
07:19 j-saturne joined #salt
07:22 chiui joined #salt
07:24 scalability-junk joined #salt
07:28 ianmcshane joined #salt
07:32 alanpearce joined #salt
07:34 llovelock joined #salt
07:38 kingel joined #salt
07:39 ianmcshane joined #salt
07:43 dvestal_ joined #salt
07:45 deepz88 joined #salt
07:49 tomspur joined #salt
07:50 dvestal joined #salt
07:50 ndrei joined #salt
07:53 pled76 joined #salt
07:53 oz_akan joined #salt
07:54 iMil joined #salt
07:54 darkelda joined #salt
08:00 rome joined #salt
08:03 ThomasJ|d joined #salt
08:05 bhosmer joined #salt
08:05 intellix joined #salt
08:07 ianmcshane joined #salt
08:08 deepz88 joined #salt
08:09 _ale_ joined #salt
08:11 N-Mi joined #salt
08:11 N-Mi joined #salt
08:13 TTimo joined #salt
08:14 ianmcshane joined #salt
08:16 deepz88 joined #salt
08:23 pled76 joined #salt
08:25 CeBe joined #salt
08:26 CeBe1 joined #salt
08:30 adsisco_ joined #salt
08:32 che-arne joined #salt
08:33 pled76_ joined #salt
08:33 runiq joined #salt
08:33 runiq joined #salt
08:35 runiq Hey all, I was wondering about the pillar hierarchy used in the 'Best Practices' doc: http://docs.saltstack.com/en/latest/topics/best_practices.html#structuring-pillar-files
08:35 jdmf joined #salt
08:36 runiq Right at the end of that paragraph, an apache configuration is shown, with two levels ofo hierarchy: 'apache', which makes sense to me, and 'lookup', which doesn't. What is the additional hierarchy level used for?
08:42 ckao joined #salt
08:45 runiq Is it just used to avoid polluting the namespace itself when using a formula?
08:48 bhosmer joined #salt
08:48 n8n_ joined #salt
08:54 oz_akan joined #salt
09:01 TheThing joined #salt
09:01 kingel joined #salt
09:03 n8n joined #salt
09:06 kingel joined #salt
09:07 geekmush1 joined #salt
09:09 malinoff joined #salt
09:14 linjan joined #salt
09:15 Twiglet joined #salt
09:15 babilen runiq: You typically have a "map.jinja" in your formula in which you specify rather invariant bits of the formula that still differ between platforms. Values specified in there comprise things such as package names, configuration file paths, user names, ... To make a distinction between settings a user would normally want to change and these values the additional "lookup" level is being used.
09:16 babilen The name stems from "lookup table"
09:17 dratone_ joined #salt
09:17 j-saturne joined #salt
09:19 babilen runiq: In fact i don't really consider the exemplified configuration to be in line what *I* consider best practices. I personally just use lookup for things I want to override in map.jinja and for nothing else. Direct references to the lookup pillar would therefore never happen (as you just reference the map) and things users would genuinely want to change via pillars shouldn't use the "lookup" level.
09:20 babilen "- source: {{ salt['pillar.get']('apache:lookup:config:tmpl') }}" should therefore be "- source: {{ salt['pillar.get']('apache:config:tmpl') }}" in my opinion
09:24 yomilk joined #salt
09:32 ndrei joined #salt
09:32 runiq babilen: Alright, that makes sense. So lookup in that example is used to avoid polluting the namespace. Thanks! :)
09:33 babilen I'd recommend reading http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html too
09:34 runiq Yeah, I have, but the lookup dict wasn't mentioned there either IIRC
09:35 malinoff runiq, its a bit tricky: http://docs.saltstack.com/en/latest/topics/best_practices.html#modularity-within-states
09:35 pled76 joined #salt
09:35 malinoff and there: http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html#abstracting-platform-specific-data
09:36 runiq Yup, I've read that. It's a cool system, though a bit hard to get your head around at first.
09:36 runiq Thanks!
09:38 TheThing joined #salt
09:38 babilen In a way I guess you can argue that the location of the template file is rather invariant. I'd probably include it in the map and then reference the map rather than the pillar…
09:43 ndrei joined #salt
09:44 Nss joined #salt
09:45 pled76 joined #salt
09:54 viq joined #salt
09:54 oz_akan joined #salt
09:56 ianmcshane joined #salt
09:56 oz_akan joined #salt
09:57 dariusjs joined #salt
10:01 rome joined #salt
10:03 sadbox joined #salt
10:04 ndrei joined #salt
10:13 geekmush joined #salt
10:13 bluenemo joined #salt
10:14 TTimo joined #salt
10:15 bluenemo hi guys. I want to learn about how to write macros and I'm fiddling around with the macros in the nginx formula. I mostly copied them line by line so far and going through them trying to understand whats happening. Somehow in my resulting pasted file, I have a newline occuring and I cant find out why: http://paste.debian.net/hidden/11017ad8/ the result is the last block on the bottom. For example tests {
10:15 bluenemo newline, another newline, barz { and so on. I'm sure I'm missing something simple, but cant spot it :(
10:16 bluenemo the macro is basically 100% from https://github.com/saltstack-formulas/nginx-formula/tree/master/nginx/ng/files/nginx.conf
10:18 bluenemo forgot the pillar data: http://paste.debian.net/hidden/546ca5ca/
10:20 pled76 joined #salt
10:27 ntropy not read through your entire code, but seems like this may help you - http://jinja.pocoo.org/docs/dev/templates/#whitespace-control
10:29 ndrei joined #salt
10:31 yomilk joined #salt
10:35 pled76 joined #salt
10:36 bhosmer joined #salt
10:40 istram joined #salt
10:40 msusta joined #salt
10:45 pled76_ joined #salt
10:45 yomilk joined #salt
10:51 bluenemo ntropy, thanks for the link. I checked every line again; what totally puzzles me is that I basically copied the nginx state; which works without the newlines.. it seems that in the line in the template:  {{ macro_block(v, k, operator, delim, (ind + indent_increment)) }}  a newline is appended before the values are filled in.
10:53 fredvd joined #salt
10:53 bhosmer joined #salt
10:55 intellix joined #salt
10:57 oz_akan joined #salt
10:58 runiq left #salt
11:11 ntropy bluenemo: right, so if you change {{ macro_block... to {{- macro_block..., then you'll be all set
11:21 mechanicalduck joined #salt
11:23 endragor joined #salt
11:28 verwilst joined #salt
11:28 verwilst hello! I was wondering how to have per-minion variables ala puppet hiera
11:28 verwilst im playing with pillar, but for now that seems to be more 'generic'
11:29 eliasp verwilst: that's actually what you want
11:29 eliasp verwilst: you can also use external pillar sources: http://docs.saltstack.com/en/latest/topics/development/external_pillars.html
11:30 verwilst eliasp: yeah, i think so too, but i can't seem to make it up out of the examples.. they all seem pretty generic, like 'use httpd when using centos as packagename' etc
11:30 eliasp verwilst: use the Pillar's top.sls file to assign a pillar to one or more minions using the usual targeting methods
11:30 eliasp verwilst: could you describe a usecase you're struggling with to adapt it to pillars?
11:30 pled76 joined #salt
11:30 verwilst eliasp: the example says 'base': 'myhost.domain' - mysql for example
11:30 verwilst sure, that gives mysql to one host
11:31 verwilst but what if i have 10 hosts that need mysql, but i want to have a different password for each
11:31 verwilst do i need to put an if clause inside mysql.sls for each host?
11:31 ndrei joined #salt
11:31 eliasp no, it's far easier
11:32 bluenemo ntropy, I thought the same, however that sadly breaks the formatting like follows: http://paste.debian.net/118717/ :(
11:32 verwilst in puppet you can just define the hierarchy and be done with it, i feel like i'm missing sth vital here :)
11:33 eliasp your SLS should be "agnostic", so your SLS looks something like this: "mysql: -pkg: {{ pillar['mysql.package'] }} -pass: {{ pillar['mysql.pass'] }}"
11:33 verwilst the state you mean
11:33 eliasp verwilst: yes, state/SLS are more or less the same ;)
11:34 verwilst myeah, a pillar is also an sls, so :) wanted to make sure i was following you correctly :)
11:34 eliasp ok, sorry… yes, I mean the MySQL state
11:35 verwilst i think i have that part covered
11:35 eliasp then in your Pillar's top.sls you first assign the Pillar containing mysql.package to all affected minions:
11:35 eliasp 'G@role:mysql':
11:35 eliasp - match: compound
11:35 eliasp - pillars.mysql
11:35 eliasp ok
11:35 verwilst hm
11:35 eliasp then you assign the individual passwords
11:35 verwilst that was my first mistake, i'd put it in '*' :)
11:36 eliasp minion-001:
11:36 eliasp - pillars.mysql.credentials.001
11:36 eliasp minion-002:
11:36 eliasp - pillars.mysql.credentials.002
11:36 j-saturne joined #salt
11:36 eliasp if this follows a certain scheme, you could wrap this up in a Jinja for-loop
11:36 ndrei joined #salt
11:36 verwilst and that's also in top.sls?
11:37 verwilst can i do like '*.domain1': - pillars.mysql.credentials.domain1 for example?
11:37 noeol joined #salt
11:38 eliasp verwilst: yes, this is purely targeting-based: http://docs.saltstack.com/en/latest/topics/targeting/
11:38 verwilst and i have a /srv/pillar/mysql/credentials/domain1.sls file then?
11:38 eliasp verwilst: you can do the assignments just in the same way you do them to assign states to minions
11:39 verwilst hm ok, that pillars.mysql part isnt 100% clear yet, but i'm getting there, maybe if you have a link to the concept handy i could read up on that as well
11:39 eliasp exactly… just make sure the top.sls assignments match your folder structure, so my example would translate to:
11:39 eliasp pillars/mysql.sls
11:39 eliasp pillars/mysql/credentials/001.sls
11:39 eliasp pillars/mysql/credentials/002.sls
11:39 endragor Hello! Is there a way to access a function from salt.utils from states (jinja)? There is a couple of useful functions under "utils.network" which I'd like to use.
11:39 verwilst and why 'pillars'
11:39 verwilst why not /src/pillar/mysql/credentials?
11:40 verwilst or just /src/pillar/mysql.sls with some variables inthere?
11:40 verwilst are there some guidelines?
11:40 xmj you want /srv/
11:40 eliasp verwilst: you could leave this off… it's just a convention I'm using here to make it easier when reading it, that I'm explicitely handlign a pillar at this point
11:40 verwilst typo :)
11:40 verwilst xmj ^^
11:40 eliasp verwilst: as I'm pulling everything from GitFS here, so I don't have a parent file-structure in /srv
11:40 verwilst ah ok
11:43 eliasp the content of the pillar files would look like this then:
11:43 eliasp mysql.sls:
11:43 eliasp mysql:
11:43 eliasp pkg: mysql-server
11:43 eliasp mysql/credentials/001.sls:
11:43 eliasp mysql:
11:43 eliasp pass: 012344566
11:44 eliasp the content/structure of the Pillar files itself has nothing to do with the matching in the Pillar's top.sls
11:44 eliasp the structure is used in your States' Jinja when accessing the pillar via {{ pillar['foo']['bar'] }} which would translate to a pillar content like
11:44 eliasp foo:
11:44 eliasp bar: hello world
11:44 eliasp verwilst: if you need further help, ping me please
11:45 martoss joined #salt
11:45 verwilst eliasp: i'm going to let it sync in a bit and i'm going to play with it :) i think i'll just use per-domain passwords, or use a default password, and optionally change it for some domains
11:45 laubosslink joined #salt
11:46 verwilst that's my goal anyways :)
11:46 verwilst eliasp: thanks for getting me on track :)
11:47 eliasp laubosslink: salt-run manage.down
11:47 eliasp laubosslink: salt-run manage.up
11:50 pled76 joined #salt
11:58 oz_akan joined #salt
12:02 rome joined #salt
12:04 endragor posted the question from above: https://groups.google.com/forum/#!topic/salt-users/iUYBO4uidq8 Would appreciate if someone gives a clue. Thanks!
12:04 verwilst eliasp: shouldn't i made an sls file per group then?
12:04 verwilst like mysql/domains/mydomain.sls ?
12:05 verwilst and have '*.mydomain':  - mysql.domains.mydomain in top.sls?
12:05 alanpearce joined #salt
12:06 verwilst mysql.credentials looks so .. limited.. it should contain more than that
12:06 verwilst mysql.domains doesn't look right either though
12:06 eliasp verwilst: whatever you want… the data-structures inside your Pillars will be unified/merged before being applied to the Minion
12:06 verwilst it feels like i'm trying to shoehorn it into hiera's structure too much
12:07 eliasp verwilst: the content of top.sls matches the folder/file structure of your Pillar files, the usage of Pillars in Jinja {{ pillar['foo']['bar'] }} matches the structure inside your Pillar files
12:08 noeol left #salt
12:08 verwilst so maybe i could have /srv/pillar/domains/mydomain.sls and /srv/pillar/hosts/myhost.sls
12:08 verwilst or is that a no-no
12:08 eliasp see also: http://docs.saltstack.com/en/latest/topics/pillar/#pillar-namespace-merges
12:08 eliasp sure, I don't see a problem here
12:08 scalability-junk joined #salt
12:09 eliasp split the Pillars into single files whatever makes it you the easiest to assign them individually/grouped in your top.sls
12:09 intellix joined #salt
12:10 eliasp keep the structure inside your Pillars as close to what makes it easy handling the Pillar data in a generic fashion via Jinja in your states
12:11 verwilst eliasp: although that doesnt really work, since it's not a hierarchy afaik
12:11 eliasp so the (merged) content structures could follow a hierarchy like
12:11 eliasp mysql:
12:11 eliasp package: mysql-server
12:11 eliasp config:
12:11 eliasp param1: foo
12:11 eliasp param2: bar
12:11 eliasp credentials:
12:11 eliasp user: abc
12:11 eliasp pass: 12345
12:11 verwilst you can't say 'all hosts have variable A = 'a', unless host 'x' has 'b' specified above it
12:12 eliasp while your Pillar files would resemble your environment/different hosts/etc.
12:12 diegows joined #salt
12:12 eliasp verwilst: as Pillars will be merged, existing values will be overwritten which would resemble probably your needs in a certain way
12:13 eliasp verwilst: but you're actually probably still stuck a bit too much in the Hiera mindset :)
12:13 verwilst eliasp: and can you define the order in which it is overwritten?
12:13 verwilst i think i am ;)
12:13 verwilst i just want to set my mysql root pass ffs :P
12:14 eliasp hmm, from the docs: "Note: Remember: conflicting keys will be overwritten in a non-deterministic manner!" … sorry, that's a bit a bummer, I hope this will be resolved with the upcoming Pillar improvements
12:15 mortis_ is there an ETA for 2014.7.0 stable?
12:16 TTimo joined #salt
12:16 eliasp mortis_: "soon" … it's in RC, so the more people report test feedback, the sooner is "soon" ;)
12:16 mortis_ eliasp: "soon" is nice :)
12:17 verwilst eliasp: i could do {{ pillar['mysql']['server']['root_password'], 'defaultp4ss' }}, and only set the pass through pillar for certain domains
12:18 noeol joined #salt
12:18 eliasp verwilst: yes and no
12:18 eliasp you could do it, but then you'd expose secret data within your states SLS which is considered a really bad practice
12:18 kingel joined #salt
12:18 eliasp but you could provide as "default" another pillar like "default_root_password"
12:19 eliasp once the merging isn't non-deterministic anymore, you won't that "workaround" anymore and just set the default at a "higher" point in the Pillar hierarchy
12:22 verwilst true
12:22 verwilst now i just need to find out how to organise my pillar files.. :P
12:24 pled76 joined #salt
12:25 bhosmer_ joined #salt
12:31 fredvd joined #salt
12:32 babilen verwilst: https://www.refheap.com/89647 is a pillar structure I use quite often whenever I want to define a value for only some minions
12:34 * verwilst checks
12:35 verwilst oh, i always see a pillar as a structured data file
12:35 verwilst with like an if here and there at the most P
12:35 verwilst :P
12:38 verwilst i'm currently messing with /srv/pillar/mysql/hosts/myhost_mydomain.sls
12:38 verwilst but that looks so ugly
12:40 TTimo joined #salt
12:41 eliasp verwilst: listen to babilen… 99,9% of the time he gets things done right ;)
12:41 eliasp and those 0,01% of it… I don't remember what it was, so I couldn't have been that bad :)
12:42 babilen verwilst: https://www.refheap.com/89649 is a slightly more involved example that I use to easily define pillars for Nagio NRPE checks
12:43 babilen *Nagios
12:45 bhosmer joined #salt
12:45 babilen https://www.refheap.com/89651 (sorry)
12:47 thayne joined #salt
12:48 hugo joined #salt
12:50 kivihtin joined #salt
12:51 mortis_ personally cant stand nrpe, so i made a wrapper that runs nagios-plugins via salt-peers https://github.com/mortis1337/nagios-plugins/blob/master/check_by_saltpeer.py
12:52 jalaziz joined #salt
12:54 mortis_ can be pretty scary securitywise tho :)
12:54 mortis_ depends on env
12:54 babilen mortis_: I'm not too much of a fan either, but then I quite often implement in salt what grew organically before (and thereby get rid of a *lot* of inconsistencies), but I like you approach and might steal it at one point.
12:55 mortis_ :)
12:56 ianmcshane joined #salt
12:56 verwilst babilen: and are those normal sls pillars?
12:56 verwilst or external ones or ... ?
12:57 babilen They aren't external, but I wouldn't necessarily call them "normal" either. It's just that I start writing them in Python as soon as I need to do something that is a little more involved.
12:57 verwilst but i just want a different mysql root pass for 1 domain :( :P
12:57 * verwilst longs for hiera :D
12:58 kingel joined #salt
12:58 babilen So, use what I showed in my first paste and use that pillar in lieu of what you have now.
12:58 oz_akan joined #salt
12:59 verwilst hm, forgot about that one
12:59 verwilst and that would be mysql.credentials for example?
12:59 babilen But then, a simple "{% if grains['id'] == 'my.speshul.box' %} - somepwd {% else %} - otherpwd {% endif %}" might be all you need in this case.
13:00 babilen I just found endless lines of jinja if/else to be hard to maintain and ugly to behold, which is why I adopted the "define Python dictionary of exceptions" approach for situations in which I have to do this for, say, 5+ minions
13:01 verwilst i like the python approach idd
13:02 verwilst a little overkill for 1 if, sure, but easy if decide to add different passwords for more domains for example
13:02 babilen exactly
13:03 verwilst what's the 'or$noather' param?
13:03 verwilst i would expect 1 pass per host? :)
13:03 babilen Ah, you can use ('someverylongstring ..... that demands a' \n 'linebreak') to define multiline strings in Python
13:04 babilen It will be implicitly joined
13:05 babilen And yeah, just one password per host :)
13:06 babilen https://www.refheap.com/89655
13:10 pled76 joined #salt
13:11 racooper joined #salt
13:11 CeBe joined #salt
13:13 verwilst babilen: aaah sorry i imagined a comma!
13:13 verwilst that's why i didnt get it :)
13:13 verwilst didnt expect a newline there :P
13:14 dccc_ joined #salt
13:14 babilen yeah, I should have made that clearer when I replaced the actual values there
13:15 pled76 joined #salt
13:26 CeBe2 joined #salt
13:30 tmh1999 joined #salt
13:33 dude051 joined #salt
13:33 kingel joined #salt
13:42 pled76 joined #salt
13:44 jaimed joined #salt
13:46 pled76_ joined #salt
13:48 mkopo joined #salt
13:48 bnikolau1 joined #salt
13:48 p2_ joined #salt
13:48 _dancat_ joined #salt
13:48 tinuva joined #salt
13:49 godber1 joined #salt
13:49 davet joined #salt
13:49 stevednd joined #salt
13:49 manytrees_ joined #salt
13:49 urtokk_ joined #salt
13:49 mkopo Hi, Cant download latest pdf docs from address https://media.readthedocs.org/pdf/salt/latest/salt.pdf
13:49 Schmidt joined #salt
13:49 fxhp joined #salt
13:49 mkopo It says build failed or sth like that
13:49 Nazca joined #salt
13:49 jesusaurus joined #salt
13:50 verwilst can you use the full python stack? if grains['id'] in _user_passwords:
13:50 verwilst should be replace to check for *.mydomain in grains['id']
13:50 verwilst replaced*, sorry, pressed enter too fast there :)
13:50 babilen You can do whatever you want (as long as it is valid Python)
13:51 verwilst awesome
13:51 babilen And "for *.mydomain in grains['id']" would not be
13:51 verwilst babilen: no, that was in normal english :)
13:51 babilen You literally write pure Python there :)
13:52 verwilst babilen: do you have a link to the concept you're using in your paste? the "i'm using python in my sls, and i have a run() method etc" ?
13:53 babilen Keep in mind that *all* pillar SLS files are rendered and that the "jinja|yaml" renderer is implicitly used if you don't specify another one. What I pasted simply uses the "py" renderer which does some monkey patching (ugly!) and then calls the run() function in the module.
13:53 verwilst oh
13:53 babilen I am not sure if it is discussed in the context of pillars, but let me check
13:54 babilen http://docs.saltstack.com/en/latest/ref/renderers/all/salt.renderers.py.html (for states)
13:55 agend_ joined #salt
13:55 babilen http://docs.saltstack.com/en/latest/ref/renderers/ is the overview, http://docs.saltstack.com/en/latest/ref/states/all/salt.states.file.html mentioned the py renderer for file.managed and I'm sure I can dig something up for pillars
13:55 dratone joined #salt
13:55 mechanicalduck_ joined #salt
13:57 toastedpenguin joined #salt
13:58 babilen verwilst: I can't find it for pillars, but it is simply easy: You use "#!py" as shebang (in lieu of the implicit "#!jinja|yaml"). Salt will then import it as a Python module and call its run() method which is expected to return a dictionary of pillar values.
13:59 babilen The only tricky part is the monkey patching of __salt__, __grains__, ... which will *not* be available at evaluation time, but only during runtime.
13:59 babilen This is also the reason why I define the NRPE checks in the context of a function as certain bits simply aren't available when the module is evaluated.
13:59 oz_akan joined #salt
14:01 babilen Note that you can use other renderers too (or even write your own) -- yamlscript has, for example, recently been released and might be of interest: https://github.com/DockerNAS/yamlscript-formula
14:02 babilen Personally I think that choosing jinja as default templating engine was a *massive* mistake and that mako would have been a much better choice. I don't want to burden my colleagues with a plethora of different renderers/templating engines/... though which is why I try to stick to jinja, yaml and py/pydsl
14:02 rome joined #salt
14:05 verwilst babilen: https://www.refheap.com/cada4c225293483221597511c like this?
14:05 babilen No
14:05 verwilst default pass on the outside?
14:06 babilen What is the pillar structure you want to access the password? (e.g. mysql:server:root_pwd)
14:06 verwilst don't know mako
14:06 verwilst babilen: yeah
14:06 babilen You have to return a dictionary from run
14:07 verwilst aah
14:09 geekmush1 joined #salt
14:09 babilen https://www.refheap.com/088cfa50a6fb69593f82786d4
14:10 babilen A pillar is a dictionary. mysql:server:root_pwd is a sequence of keys and you can set values.
14:11 babilen These dictionaries are simply "updated" at the highest level (so no deep merging) which explains why values completely replace earlier values with duplicate keys
14:11 babilen (little indentation problem in my paste, but you can hopefully fix that)
14:12 verwilst babilen: i always forget the second argument as well
14:12 verwilst for the default
14:12 verwilst nice :)
14:14 bhosmer joined #salt
14:15 ndrei joined #salt
14:16 verwilst babilen: if you want to set your port, bind-address and password on a per-host basis for example
14:16 verwilst can't you have an init.sls for example with a function like this?
14:16 verwilst that just returns an array per host?
14:17 verwilst like for my password, but then with multiple values?
14:17 babilen Sure
14:17 eliasp verwilst: sure, you can return whatever datastructures you'd like to process then in your state
14:17 noeol joined #salt
14:17 babilen Let me show you two approaches
14:17 verwilst creating a sls per variable seems a bit overkill
14:20 babilen https://www.refheap.com/088cfa50a6fb69593f82786d4 would be one idea
14:21 babilen If you want to define defaults for each and exceptions then adopt the one-dict-per-value approach earlier and use three dictionaries ..
14:22 verwilst that would have been my idea as well idd
14:23 verwilst but defaults for each.. i would just define one dictionary as default
14:23 verwilst and either override all or nothing :)
14:23 verwilst not to overengineer it
14:24 verwilst that could even be /srv/pillar/mysql.sls !
14:24 babilen Do whatever is the most simple solution that allows you to tackle *most* of the issues you expect to face in immediate future
14:24 peters-tx joined #salt
14:24 babilen *in the
14:26 verwilst this is quite the helpful channel btw! thanks so much babilen and eliasp!
14:28 bhosmer joined #salt
14:30 verwilst babilen: i could even go further, and have _de,faults, _domain_settings and _host_settings, and merge those manually, and compile a pillar out of those!
14:30 eliasp verwilst: yw
14:30 verwilst best of all worlds!
14:30 verwilst replicating puppets' hiera in a few easy lines ;)
14:31 pled76 joined #salt
14:31 eliasp verwilst: "Salt can be whatever you want it to be" :)
14:31 eliasp verwilst: I actually plan to use Salt as monitoring infrastructure in the long term
14:31 eliasp IIRC there was even already somebody doing this … have to search GitHub again for it
14:32 verwilst oh :) zabbix does the trick there for me though :)
14:32 eliasp verwilst: why duplicate functionality when another tool in use provides it already? ;)
14:32 eliasp I mean: ok, I need to add some logic to evaluate the returned information, but after all I love consolidating stuff
14:33 eliasp anyways… back to work for now
14:33 ndrei joined #salt
14:36 mhubbard joined #salt
14:38 WarP|onwork joined #salt
14:40 aquinas joined #salt
14:40 aquinas_ joined #salt
14:44 j-saturne joined #salt
14:54 ndrei joined #salt
14:58 martoss1 joined #salt
15:00 oz_akan joined #salt
15:03 martoss joined #salt
15:10 linjan joined #salt
15:15 bhosmer joined #salt
15:26 vbabiy joined #salt
15:31 catpig joined #salt
15:32 CatPlusPlus joined #salt
15:33 SheetiS joined #salt
15:35 che-arne joined #salt
15:37 pled76 joined #salt
15:38 scoates_ joined #salt
15:38 kingel joined #salt
15:43 endragor joined #salt
15:44 endragor Is there a way to check in SLS whether certain pillar value was changed from the last call?
15:46 shaggy_surfer joined #salt
15:47 nyx joined #salt
15:47 shaggy_surfer joined #salt
15:51 j-saturne joined #salt
15:52 felskrone joined #salt
15:54 kingel joined #salt
15:56 pled76 joined #salt
15:57 tmh1999 joined #salt
15:59 pled76_ joined #salt
16:01 eliasp endragor: no
16:01 oz_akan joined #salt
16:03 bhosmer_ joined #salt
16:03 rome joined #salt
16:04 ajolo joined #salt
16:07 bhosmer joined #salt
16:07 ndrei joined #salt
16:14 tmh1999 joined #salt
16:15 rogst joined #salt
16:19 pled76 joined #salt
16:22 elfixit joined #salt
16:23 kingel joined #salt
16:24 jnials joined #salt
16:31 SheetiS joined #salt
16:34 vbabiy joined #salt
16:36 acabrera joined #salt
16:37 catpig joined #salt
16:40 nyx_ joined #salt
16:44 pled76 joined #salt
16:51 SheetiS joined #salt
16:53 tmh1999 joined #salt
16:55 catpigger joined #salt
16:56 pled76 joined #salt
17:00 jensnockert joined #salt
17:02 oz_akan joined #salt
17:04 snuffeluffegus joined #salt
17:05 stolitablrrr joined #salt
17:10 TyrfingMjolnir joined #salt
17:11 deepz88 joined #salt
17:11 pled76_ joined #salt
17:17 snuffeluffegus joined #salt
17:18 j-saturne joined #salt
17:22 tmh1999 joined #salt
17:24 ndrei joined #salt
17:24 kingel joined #salt
17:26 bluenemo joined #salt
17:31 n8n joined #salt
17:36 melinath joined #salt
17:36 intellix joined #salt
17:37 bluenemo when I do a {% from map.jinja import foo, bar with context %}, it seems the items are getting sorted alphabetically. Can I turn this off somehow?
17:45 snuffeluffegus joined #salt
17:46 pled76 joined #salt
17:46 nyx joined #salt
17:52 bhosmer joined #salt
18:00 bluenemo basically my problems starts with pillar.get; when I do a salt '*' pillar.get foo:bar, the seem sorted alphabetically there. thats what I like to appear as written in my pillar file
18:02 oz_akan joined #salt
18:04 nickg joined #salt
18:04 rome joined #salt
18:04 bluenemo argh all I google gives me back stuff about the book of genesis m)
18:05 diegows joined #salt
18:07 rmnuvg joined #salt
18:08 catpiggest joined #salt
18:12 catpig joined #salt
18:13 fllr joined #salt
18:15 bluenemo Is there a salt recipe where I can have an exemplary look at how to do this? What I want to do is template / macro a config file, and I'd like to structure to stay exactly as ordered in the pillar. Some applications need there config file options to be in the right order, so sbd surely has done this before; just cant find anything about it :(
18:15 pled76 joined #salt
18:18 eliasp bluenemo: I don't know if the pillar module re-orders the keys of a dictionary in some way, but to prevent this you could create an array with single-value dictionaries as elements… ugly, but should work
18:18 eliasp s/array/list/g
18:18 tmh1999 joined #salt
18:19 catpig joined #salt
18:21 eliasp another possibility would be something like this: https://gist.github.com/eliasp/58afa53eee1fe3196678
18:22 eliasp this would restrict your config to the keys listed in the 1st line, but the order of the keys in your config should be deterministic
18:22 eliasp bluenemo: ^^
18:23 kivihtin joined #salt
18:25 kingel joined #salt
18:25 bluenemo eliasp, thats nifty (both ideas)
18:26 eliasp bluenemo: to make the 2nd solution not that restrictive, pull the list of keys also from the pillar
18:26 eliasp so your state would be completely agnostic
18:26 kingel joined #salt
18:27 catpig joined #salt
18:28 alanpearce joined #salt
18:31 quup joined #salt
18:31 _ikke_ joined #salt
18:32 quup Hi, where can I find the docs for v2014.1.7? In "Pillars Walkthrough" latest docs issues saltutil.pillar_refresh and 2014.1.4 docs doesn't do a refresh at all. For 2014.1.7 it seems the command is saltutil.refresh_pillar
18:33 quup The docs I found: http://docs.saltstack.com/en/latest/topics/tutorials/pillar.html  and http://salt.readthedocs.org/en/v2014.1.4/topics/tutorials/pillar.html?highlight=refresh
18:34 quup nevermind... seems to be bug in docs
18:36 quup I'll send a pull request
18:40 _ikke_ I run salt over a vpn tunnel. When I do state.Highstate, salt says a certain managed file is up-to-date, while the version on the minion is empty and the version on the master is not. When I manually run file.get_diff on the files, it shows the correct diff. Any clue what might be going on?
18:40 iggy bluenemo: sorteddict in newer pythons should help... not entirely sure how to tie that into a map though
18:42 catpig joined #salt
18:45 catpigger joined #salt
18:45 pled76 joined #salt
18:47 rypeck joined #salt
18:48 _ikke_ ah, src -> source
18:49 catpiggest joined #salt
18:52 catpigger joined #salt
18:59 linjan joined #salt
18:59 catpiggest joined #salt
19:01 jensnockert joined #salt
19:02 kingel joined #salt
19:03 oz_akan joined #salt
19:04 catpigger joined #salt
19:08 diegows joined #salt
19:09 bluenemo eliasp, your 2nd solution works. thank you! :)
19:09 eliasp bluenemo: nice! yw
19:10 schimmy joined #salt
19:11 pled76 joined #salt
19:11 catpig joined #salt
19:14 geekmush joined #salt
19:15 catpigger joined #salt
19:15 pled76_ joined #salt
19:17 alanpearce joined #salt
19:18 pled76 joined #salt
19:18 catpiggest joined #salt
19:22 catpigger joined #salt
19:23 dN0t joined #salt
19:25 dariusjs joined #salt
19:28 alanpearce joined #salt
19:29 catpiggest joined #salt
19:35 kingel joined #salt
19:35 catpiggest joined #salt
19:36 alanpearce joined #salt
19:40 bhosmer joined #salt
19:43 bluenemo when I:  {% set foo = salt['pillar.get']('bar') %}  I set foo = the dict contents of bar. Can I somehow append to that later on? as in (pseudocode) %{ set foo 'append-magic-character' salt['pillar.get']('bla') ?
19:44 ze- what type is bar?
19:44 ze- and what type is bla?
19:46 ze- bluenemo: it's pseudo-python, so it will depend on types (dict, strings, array, ...) to use the proper operators/functions/...
19:47 pled76 joined #salt
19:55 ndrei joined #salt
19:56 joehoyle joined #salt
19:56 sectionme joined #salt
19:56 alanpearce joined #salt
19:57 eliasp joined #salt
19:59 dvestal joined #salt
20:03 izibi joined #salt
20:04 oz_akan joined #salt
20:04 alanpearce joined #salt
20:05 rome joined #salt
20:06 bluenemo ze-, its a dict (key: value) from the pillars. I have to admit I dont know exactly what I'm doing.. I'm hacking around on existing salt recipes to learn about salt. This might show what I'm trying to accomplish: http://paste.debian.net/hidden/4c827a6d/
20:06 catpigger joined #salt
20:08 bluenemo my actual target is to get the pillar data that salt['pillar.get']('foo') would output in the order I wrote it down in the pillar; by default its ordered alphabetically, which breaks stuff for my purpose
20:10 ze- bluenemo: a dict is *not* ordered. The display order it for coherency, but it's an unorder association.
20:10 iggy OrderedDict
20:10 catpiggest joined #salt
20:11 ze- yeah, but you don't get such types in grains or pillars.
20:12 iggy yeah, that's what i said earlier... not sure how to tie that into pillars
20:12 ze- bluenemo: from the example linked in your paste, there is:
20:12 ze- * an ordered list of possible keys
20:12 iggy maybe pillars need to be extended
20:12 ze- * a dict where keys might be present
20:13 ze- and the linked examples output them directly.
20:13 oz_akan joined #salt
20:14 ze- the order in which keys are present in a dict is not ever available, lost as it is read.
20:14 perfectsine joined #salt
20:15 ze- ie: what you try to do is impossible. :)
20:16 pled76 joined #salt
20:18 bluenemo ze-, iggy, thanks for the heads up :) damn it :) hm. is there any example salt recipe where a config file is constructed in an ordered mode from pillar data? as in what would be the best practice way to template a config and define the order of the values in that config?
20:19 che-arne joined #salt
20:22 alanpearce joined #salt
20:23 bluenemo i'll have a look at https://github.com/bechtoldt/postfix-formula, where ordering the data in the pillars (recipient_restrictions) would break the concept
20:24 dvestal joined #salt
20:25 alanpear_ joined #salt
20:27 TheThing joined #salt
20:28 wendall911 joined #salt
20:30 ze- bluenemo: recipient_restrictions is just a string with multiple words in it. not a dict, nor a list.
20:30 bluenemo just found out too, yes
20:30 ze- if you want to keep ordered data, use a list.
20:30 ze- in the list, you can have complex structures. like dicts with only one key if you want key/value associations.
20:31 ze- my_stuffs:
20:31 ze- - key1: value1
20:31 ze- - key2: value2
20:31 ze- :)
20:31 nahamu johngrasty: I'm pretty sure I've recreated and fixed #14184
20:31 wendall911 joined #salt
20:31 johngrasty nahamu: I just saw that. I will actually have time to test it just a bit (finally). Thanks for your work.
20:32 bluenemo ze-, thank you for your help :) looks like some redesign for tomorrow. star trek for the evening. wish you a good night / day / whatever at your place :)
20:36 kingel joined #salt
20:42 nahamu johngrasty: I uncovered a small bug in my esky build when trying to test that one.
20:43 nahamu so even so even if I didn't quite fix your bug, at least I found and fixed that one.
20:43 alanpearce joined #salt
20:43 eliasp joined #salt
20:46 bhosmer joined #salt
20:46 fllr joined #salt
20:47 johngrasty There's always another one to fix. :-D
20:47 pled76 joined #salt
20:51 catpig joined #salt
20:53 acabrera joined #salt
20:57 ajolo_ joined #salt
20:59 bluenemo joined #salt
21:02 jensnock_ joined #salt
21:05 dh___ joined #salt
21:06 martoss joined #salt
21:14 jalbretsen joined #salt
21:15 pled76 joined #salt
21:17 oz_akan joined #salt
21:20 alanpearce joined #salt
21:21 fllr joined #salt
21:29 bhosmer joined #salt
21:37 kingel joined #salt
21:37 intellix joined #salt
21:45 eliasp joined #salt
21:48 dN0t How does one specify the local branch to merge with in a git state?
21:49 pled76 joined #salt
21:53 Eugene git will merge into your checkout-ed branch
21:53 Eugene if you want a different one then you need to switch, possibly doing a stash of unfinished stuff
21:54 Eugene See also #git. we're great guys there
21:56 eliasp_ joined #salt
22:02 tkharju1 joined #salt
22:04 fllr joined #salt
22:06 rome joined #salt
22:07 _fllr_ joined #salt
22:09 eliasp joined #salt
22:12 TTimo joined #salt
22:14 oz_akan joined #salt
22:14 acabrera joined #salt
22:16 TheThing joined #salt
22:17 ajolo joined #salt
22:18 oz_akan_ joined #salt
22:24 tmh1999 joined #salt
22:31 martoss joined #salt
22:36 alanpearce joined #salt
22:37 kingel joined #salt
22:39 kingel joined #salt
22:41 kingel joined #salt
22:45 llovelock joined #salt
22:46 n8n joined #salt
22:52 Outlander joined #salt
22:52 n8n_ joined #salt
22:54 xsteadfastx joined #salt
22:59 DaveQB joined #salt
23:02 jensnockert joined #salt
23:08 jalaziz joined #salt
23:11 yomilk joined #salt
23:13 jkaye joined #salt
23:18 bhosmer joined #salt
23:20 dvestal joined #salt
23:27 ninkotech__ joined #salt
23:31 schimmy joined #salt
23:33 elfixit joined #salt
23:33 oz_akan joined #salt
23:35 oz_akan_ joined #salt
23:36 thayne joined #salt
23:36 oz_akan_ joined #salt
23:44 kingel joined #salt
23:46 jalaziz joined #salt
23:48 kingel joined #salt
23:49 yomilk joined #salt
23:53 mosen joined #salt

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