Perl 6 - the future is here, just unevenly distributed

IRC log for #salt, 2016-07-05

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

All times shown according to UTC.

Time Nick Message
00:03 amcorreia joined #salt
00:17 kus joined #salt
00:17 DEger joined #salt
00:19 tristianc joined #salt
00:32 noraatepernos joined #salt
00:53 Nahual joined #salt
00:59 manji joined #salt
01:02 iceyao joined #salt
01:15 anotherOne joined #salt
01:33 catpigger joined #salt
01:39 k_sze[work] joined #salt
02:03 iceyao_ joined #salt
02:05 iceyao__ joined #salt
02:05 nidr0x joined #salt
02:12 iceyao joined #salt
02:14 racooper joined #salt
02:44 kbaikov joined #salt
02:56 Newbie joined #salt
02:59 Newbie Does anyone know some indicative pricings for SaltStack support (with or without enterprise) for a deployment of around 500 nodes?
03:05 Derailed hey everyone, is there a uniqueness guarantee for job ids?
03:06 amcorreia joined #salt
03:19 Slimmons joined #salt
03:20 Slimmons I am having a pretty hard time setting up salt-api, if anybody can help, the issue is listed here http://stackoverflow.com/questions/38133606/why-isnt-salt-api-working-with-this-configuration
03:20 Slimmons I'm about to hit the sack, but I'll check this in the morning.  And message back anyone who was willing to help.
03:23 evle joined #salt
03:23 k_sze[work] Some of my states require a state from another sls file. Usually, if I do state.highstate, all sls files are compiled, and so the dependency is resolved. But if I do state.sls, it fails to resolve the dependency. How can I fix that?
03:54 fannet joined #salt
04:00 dj_goku left #salt
04:01 felskrone joined #salt
04:07 barmaley joined #salt
04:11 hasues joined #salt
04:11 hasues left #salt
04:15 armguy joined #salt
04:23 sjmh joined #salt
04:38 POJO joined #salt
04:38 POJO joined #salt
04:52 Disorganized joined #salt
04:53 manji joined #salt
05:14 onlyanegg joined #salt
05:27 sjmh joined #salt
06:02 impi joined #salt
06:04 traph_ joined #salt
06:09 kawa2014 joined #salt
06:11 onlyanegg joined #salt
06:12 kshlm joined #salt
06:13 tawm04 joined #salt
06:23 scc Was "calling salt functions" removed in 2016.3? It's described in 2015.8 documentation (https://docs.saltstack.com/en/2015.8/ref/renderers/all/salt.renderers.jinja.html#calling-salt-functions), but not in 2016.3
06:23 scc *calling salt functions from jinja
06:31 noraatepernos joined #salt
06:33 KermitTheFragger joined #salt
06:33 fannet joined #salt
06:37 CeBe joined #salt
06:52 ravenx joined #salt
07:07 babilen scc: https://docs.saltstack.com/en/latest/topics/jinja/index.html
07:08 babilen And no, it wasn't removed. That would break a lot of code and wouldn't be a sensible thing to do. Did some of your code break?
07:09 Elsmorian joined #salt
07:10 scc babilen, I am trying to troubleshoot an issue with a custom module showing up as being unavailable
07:10 scc When I came across that page and saw the documentation entry was gone, I wondered if that may be the cause
07:11 scc But looks like it' a incorrectly indentet line in the module.py file
07:11 Exapiper is it possible to use a variable inside a state declaration? (specifically the file.managed source)
07:12 Exapiper so when that file is updated i don't have to manually update the state file
07:13 scc Exapiper, are you thinking env variable?
07:13 Morrolan joined #salt
07:13 scc You should be able to do what you want with jinja
07:14 Exapiper not so much an env variable - just a variable to hold a filename (I am not completely sure how I want to implement yet)
07:14 babilen Exapiper: One very common way is to either reference pillar values in the template or to pass in data as context from the outside
07:15 rdas joined #salt
07:16 k3y-w joined #salt
07:16 Ashald joined #salt
07:16 Exapiper thx :)
07:16 Morrolan Are you aware of any (custom) salt modules to explicitly manage user accounts - i.e only provision those which are specified via salt, and delete all manually created non-system accounts? :)
07:17 iceyao_ joined #salt
07:17 snaggleb joined #salt
07:17 snaggleb joined #salt
07:17 toanju joined #salt
07:17 tcolvin joined #salt
07:18 [dee] joined #salt
07:18 babilen Morrolan: The latter part is the problem. How do you differentiate between manually and non-manually created accounts? (in particular those that have been created from packages)
07:18 Ch3LL joined #salt
07:18 viq joined #salt
07:19 Corey joined #salt
07:19 robbintt joined #salt
07:19 rothsa joined #salt
07:20 jY joined #salt
07:22 twiedenbein joined #salt
07:23 Morrolan babilen: True. Though you should be able to rely on (sensible ;)) packages creating a system user. (with a UUID between SYS_UID_MIN..SYS_UID_MAX)
07:24 garthk joined #salt
07:25 manji joined #salt
07:25 packeteer joined #salt
07:25 jhauser joined #salt
07:27 babilen Morrolan: If you want to remove all users outside a given range then that shouldn't be much of a problem. Just grab info for all users (useradd.list_users / useradd.info), filter users by UID, remove those you consider to be managed by salt and delete the rest
07:28 manji joined #salt
07:28 babilen Probably easiest to write this in Python
07:29 Morrolan Yea, will end up doing that - was mainly curious if there was something existing already. Cheers. :)
07:29 babilen users-formula could serve as starting point
07:29 babilen The "remove everything else" part is the custom one ..
07:30 babilen For that I'm not aware of anything ready made. Might exist though, who knows?
07:30 infrmnt joined #salt
07:37 Rumbles joined #salt
07:39 tawm04 joined #salt
07:40 Rumbles joined #salt
07:45 eseyman joined #salt
07:51 impi joined #salt
07:52 ronnix joined #salt
07:53 Rumbles joined #salt
07:55 krymzon joined #salt
07:59 lero joined #salt
08:08 vilitux joined #salt
08:16 Rumbles joined #salt
08:17 tawm04 joined #salt
08:20 Satyajit joined #salt
08:21 s_kunk joined #salt
08:21 s_kunk joined #salt
08:35 nidr0x joined #salt
09:04 anotherOne joined #salt
09:06 anotherOne left #salt
09:07 NV joined #salt
09:09 Guest57764 joined #salt
09:10 * Exapiper crosses fingers - hope the state goes first time
09:12 fredvd joined #salt
09:18 sknebel joined #salt
09:20 impi joined #salt
09:33 west575 joined #salt
09:34 keimlink joined #salt
09:50 arif-ali joined #salt
09:50 TyrfingMjolnir joined #salt
09:51 ravenx joined #salt
09:51 guedressel joined #salt
09:55 N-Mi joined #salt
09:55 N-Mi joined #salt
10:00 iceyao joined #salt
10:04 ravenx i have a problem with gulp as a cmd.run with salt
10:04 GreatSnoopy joined #salt
10:04 ravenx i need to run gulp on a project, however, when I do it via salt I get an error, when I do it in the project dir via the command line manually, it goes fine:
10:04 ravenx Here is my state.sls, then input and output:
10:04 ravenx https://paste.debian.net/776643/
10:05 ravenx it is a simple, one state gulp deploy.  when I run it, it errors out on that Invalid US-ASCII char.  but on the command line it works fine.
10:12 AndreasLutro that sure is an old node version
10:13 ravenx :/
10:13 ravenx yeah...it's the version we are stuck with
10:17 ravenx is there a awy around this?
10:17 ronnix_ joined #salt
10:18 AndreasLutro around what
10:18 ravenx this gulp failure.
10:18 AndreasLutro you should probably find out why it's failing first
10:18 ravenx the thing is, i can't.
10:18 AndreasLutro my guess would be differences in environment variables
10:18 losh joined #salt
10:18 ravenx and that's because on the command line, when i ssh into the serber and do it manaully
10:18 ravenx it works.
10:19 ravenx though, i did FIND the ascii character that was causing this, i pasted it at the very bottom of the debian paste
10:19 AndreasLutro ah I didn't see that
10:20 AndreasLutro there are ways to convert unicode values to ascii if you're ok with that http://stackoverflow.com/a/10393517
10:20 ravenx gonna need to convince my devs
10:20 ravenx hm..
10:20 ravenx any settings i can set, via salt
10:21 AndreasLutro no there isn't a magic "fix my bug" setting you can set ;)
10:21 ravenx hahahaha
10:21 ravenx darn it.
10:30 POJO joined #salt
10:38 tawm04 joined #salt
10:42 artemz joined #salt
10:46 lietu joined #salt
10:47 lietu is there a way for me to monitor what salt is actually doing during a highstate execution? I've got a vagrant VM that's been stuck in "Calling state.highstate" for quite a while and I assume there's a problem somewhere but I have no idea what it's doing atm, what state it's working on, what command it's trying to run if any, etc.?
10:48 k_sze[work] If I ran a job against multiple minions, how do I make it display the results for a particular minion with `salt-run jobs.lookup_jid`?
10:48 k_sze[work] (I already know the job id)
10:48 AndreasLutro lietu: run `salt-call -l info` on the target minion
10:49 AndreasLutro for a currently running job you'd have to strace
10:49 AndreasLutro or look at salt minion logs, if the log level is high enough
10:49 lietu dang
10:50 sagerdearia joined #salt
10:50 k_sze[work] Right now, if I do `salt-run jobs.lookup_jid`, I see the results for only one minion.
10:50 M-liberdiko joined #salt
10:50 AndreasLutro k_sze[work]: as far as I know, a salt command ran against multiple minions gets one job id per minion
10:51 k_sze[work] AndreasLutro: but --show-jid only ever shows me one job id.
10:55 AndreasLutro nevermind, I was wrong!
11:04 sfxandy joined #salt
11:04 sfxandy hi everybody
11:04 sfxandy i have an interesting little problem and I can't figure out how to do it via Saltstack
11:06 sfxandy the situation is this - for each minion that has a particular item set in pillar, I want to create a file that has a distinct number that starts at 1 and goes up to 'n' where 'n' is the number of minions that are a pillar match for my key:value pair.
11:07 sfxandy i'd offer a prize to the first solution if I had something worthwhile!!
11:11 AndreasLutro sfxandy: mine.get and jinja loops
11:12 sfxandy yeah thought about using Salt mine somehow...
11:12 A||SySt3msG0 joined #salt
11:12 sfxandy obviously that publishes the pillar value I'm interested in (which incidentally is a list of roles assigned to a server)
11:13 amcorreia joined #salt
11:14 sfxandy but how do use a jinja loop to make sure my target file has a distinct number in it...
11:15 M-cpt joined #salt
11:15 M-MadsRC joined #salt
11:16 AndreasLutro jinja loops have variables like {{ loop.index }}
11:16 sfxandy yep ok, can see how that gives me my distinct value
11:17 sfxandy ok will give it a bash
11:17 sfxandy :/
11:24 wm-bot4 joined #salt
12:03 numkem joined #salt
12:07 iceyao joined #salt
12:09 lilvim joined #salt
12:15 Shirkdog joined #salt
12:15 Shirkdog joined #salt
12:20 west575 joined #salt
12:27 infrmnt joined #salt
12:32 garphy joined #salt
12:36 sroegner joined #salt
12:41 gh34 joined #salt
12:45 DammitJim joined #salt
12:50 tongpu joined #salt
12:59 colegatron joined #salt
13:03 subsignal joined #salt
13:10 subsigna_ joined #salt
13:12 _JZ_ joined #salt
13:16 colegatron hello. using "salt-call state.sls setup-website -l info" in a master-minion env displays the states output as they are being run in real time. There is _any_ way to run the state from the master and see the same real-time states execution output?
13:16 DammitJim what is salt-call for/
13:16 felskrone joined #salt
13:18 colegatron to run the state from the minion instead the master, isn't?
13:22 dyasny joined #salt
13:23 colegatron no way to do it?
13:24 DammitJim I don't know... to me, that defeats the purpose of centralized management
13:24 DammitJim but I am very close minded
13:25 colegatron me too, sometimes, no worries :)
13:25 babilen It runs it locally on the minion, but you would still get states from the master (unless the minion is configured masterless)
13:26 colegatron babilen, yep. the states and pillars are in gitfs remotes, therefore being pulled from master by the minions, but I would like to know what my minion is doing when I run (looong) 'highstates'.
13:27 colegatron it is very frustrating to look at the black screen from minutes until the highstate finishes with "failed : n>1"
13:27 babilen You can't get that output on the master
13:27 babilen If you really sit in front of your screen while you roll out highstates, I would just use salt-call on the minion directly
13:29 rem5 joined #salt
13:29 racooper joined #salt
13:30 sfxandy joined #salt
13:34 colegatron babilen, yep, but it was nice to think to not need to ssh to any server without also loosing anything I had in the masterless approach  :-(
13:35 Rumbles can anyone tell me if the file.append state can use contents_pillar as a source for the text to append?
13:35 Rumbles I don't see it in the docs under file.append
13:36 garphy joined #salt
13:36 krymzon joined #salt
13:37 babilen Rumbles: {{ salt['pillar.get']('foo:bar:baz', '') }} should work also
13:37 babilen Did you try it?
13:38 Rumbles I was just about to write it in to my state, but I wanted to check if it's possible first
13:38 Rumbles but I haven't even rolled the pillar out to the salt master yet
13:38 sfxandy joined #salt
13:40 sfxandy AndreasLusto, I tried to implement your mine.get and jinja loop (using loop.index) suggestion but coukdnt get it to work.  Can you give me a hand if I PM you please?
13:40 sfxandy AndreasLustro, I tried to implement your mine.get and jinja loop (using loop.index) suggestion but coukdnt get it to work.  Can you give me a hand if I PM you please?
13:40 sfxandy argh!!! sorry
13:40 lugo joined #salt
13:40 sfxandy AndreasLutro, I tried to implement your mine.get and jinja loop (using loop.index) suggestion but couldnt get it to work.  Can you give me a hand if I PM you please?
13:41 LotR sfxandy: most clients let you tab-complete nicknames..
13:41 sfxandy i never knew that LotR
13:41 sfxandy thankyou
13:41 DEger joined #salt
13:41 sfxandy i only use IIRC now and again but thanks for that
13:42 Rumbles IIRC == if i remember correctly, irc == a messaging client
13:42 Rumbles :)
13:42 sfxandy shall i just get my coat?
13:42 tuxick ok
13:43 sfxandy :/
13:43 AndreasLutro sfxandy: I'm leaving, I'm sure if you share your sls here someone else might be able to help you
13:43 LotR Rumbles: actually, irc is the protocol :P
13:43 * Rumbles hands sfxandy his coat
13:43 Rumbles sorry
13:43 Rumbles yeah
13:43 Rumbles irc = internet relay chat
13:44 sfxandy ok chers AndreasLutro
13:44 sfxandy cheers even
13:44 * Rumbles is a bit of a pedant
13:44 hosttor joined #salt
13:45 LotR being pedantic is fine, provided you get it right :P
13:46 sfxandy now I've been suitably humbled...
13:47 Rumbles hehe
13:48 sfxandy i have an interesting brain teaser which I've been battling with and I would very much appreciate some help.  is there anyway in Salt that I can populate a file with a number from 1 to 'n' where 'n' is the number of minions that match a Pillar expression?
13:50 perfectsine joined #salt
13:51 catpig joined #salt
13:52 sfxandy so for example if there are 4 matching minions, the 4 minons in question would have a file /etc/foo and /etc/foo would be different on each minion
13:53 krymzon sfxandy: jinja allows incrementing variables (and extracting loop indices), so the main question seems to be getting the initial list of minions to iterate over
13:53 sfxandy agreed
13:53 colegatron do anyone knows what would happen if two minions have the same id and private key? do they will run simultaneously when triggered by a salt "minion1" state.highstate?
13:55 sfxandy krymzon, I know you can use loop.index to get a number
13:55 sfxandy but as you say its how to assign that number to a minion in a way that is idempotent
13:57 aryan joined #salt
13:58 krymzon sfxandy: not sure if this will work, but the general idea I'm getting is first getting the list of minions (nodegroup? manually?) and writing a large loop in the state file, with a counter variable (probably needs to be using c = c + 1, and not loop.index), which gets passed to the template of the final config file
14:01 krymzon sfxandy: so iterate over the list of minions (for indepotent, new minions will need to added at the end), and conditionally increase the counter. When you encounter the 'current' minion, push file.managed
14:01 krymzon sfxandy: note I can be completely wrong :)
14:02 kawa2014 joined #salt
14:02 sfxandy i'm not too fussed about new minions as that situation wont happen at the moment
14:02 wangofett joined #salt
14:02 wangofet1 joined #salt
14:03 sfxandy i might take the easier route and get the JSON document my salt-api reactor received and add in a field there
14:04 krymzon sfxandy: that might be easier indeed. However, from what I can see in the docs, you should be able to iterate e.g. over a nodegroup, if you enable pillar_opts
14:04 bowhunter joined #salt
14:06 krymzon sfxandy: so I'm imagining a large loop over the nodegroup, with two conditionals: first increments the counter, the second matches current id to push the file.managed
14:07 mpanetta joined #salt
14:14 aryan hi all, a quick question about salt-cloud. If the VMs are behind NAT and the salt-master can't ssh to them; Is it possible to use the userdata_file to grab the bootstrap and do the basic configuration? Then minions/VMs will connect to the master, instead of the otherway around (ssh from master).
14:15 Rkp yes, it is, you might need to fiddle a bit for it to work but you can initialize your server from the userdata_file
14:16 Rkp you might need the option for salt-cloud --no-deploy
14:17 sfxandy will have a play krymzon
14:17 Rkp I think the behaviour will get might vary wildly depending on which salt version you use
14:17 krymzon sfxandy: good luck!
14:18 aryan Rkp: ty. Is there a docs explaining salt-cloud behavior after a successful ssh? I'd assume it's passing some args to bootstrap-salt.sh
14:18 Rkp the option isn't even in the man page but it's in the help of the command itself on mine
14:19 sfxandy cheers krymzon, will report back!
14:23 hasues joined #salt
14:23 Rkp aryan: no idea, salt-cloud documentation is a bit lacking
14:25 Rkp since salt-cloud can't ssh to servers on my setup I just configure the minion to talk back to the master from the userdata script
14:26 Rkp if not using the --no-deploy option you might run in trouble on your master because salt-cloud might add one key to the salt-key list and the one coming from your minion will be rejected
14:26 ajv joined #salt
14:26 colegatron woooo, was guessing what would happen if two minions have same id and keys.
14:26 colegatron they act simultaneously to the master's requests.
14:27 Rumbles hmmm I tried it bablien and salt wasn't happy with content_pillar being used in file.append :(
14:28 mohae joined #salt
14:32 Brew joined #salt
14:32 hasues left #salt
14:32 autofsckk joined #salt
14:37 lungaro joined #salt
14:39 jesusaur joined #salt
14:43 Number6 anyone have any tips on lowering the memory usage of a salt-master? It's currently eating about 100M on a machine with only 400M of RAM - minion and master on the same machine, with another machine just as a minion. Running Boron on Debian 8
14:43 XenophonF how many minions total?
14:43 Number6 2
14:44 colttt joined #salt
14:44 XenophonF it doesn't sound excessive, to be honest
14:44 XenophonF 100MB for the interpreter, libraries, data
14:44 krymzon Rumbles: I missed most of that conversation, but have you tried {{ salt['pillar.get']('foo:bar:baz', '') }} from babilen's suggestion? It seems to me this one shouldn't require content_pillar
14:45 Number6 XenophonF: Yeah, I know. The master and minion on the same machine are eating about half of all RAM, and with no swap it's invoking OOM killer
14:46 XenophonF hate to be the one to say this but maybe it's too small then?
14:46 XenophonF you could ditch salt-minion for salt-ssh
14:46 kawa2014 joined #salt
14:47 Number6 I was hoping not to migrate master off to a different machine - but I suppose I'll have to :-(
14:49 XenophonF my salt-master is a t2.medium instance, so 4 GiB RAM
14:49 XenophonF i could probably safely run it as a t2.small (2 GiB RAM) without any trouble
14:50 XenophonF my recommendation would be to double the RAM for your master or ditch salt-minion
14:50 XenophonF use salt-ssh to manage the master
14:50 Lee- joined #salt
14:50 XenophonF or add swap
14:50 XenophonF but i think you're under-speccing your master
14:51 Number6 Yeah, I'm gonna move the master off to a machine with 1GB of RAM and see how it goes
14:52 XenophonF you might try running fewer threads or similar tricks, but i haven't measured how much of salt-master's memory utilization comes from python runtime state
14:52 Number6 Altering the threads and workers doesn't affect the memory, sadly
14:52 XenophonF so most of the memory utilization is likely code then
14:53 XenophonF you can investigate this yourself using ps with the right options that escape me at the moment
14:53 XenophonF should be a way to compare text (code) vs data memory utilization
14:53 XenophonF hm, let me man ps real quick
14:54 XenophonF oh yeah, contrast sz with trs
14:55 Xevian_ joined #salt
14:55 Rumbles hmmmm that doesn't seem to work krymzon and babli
14:55 Rumbles hmmmm that doesn't seem to work krymzon and babilen
14:55 Rumbles 1 sec let me pastebin
14:55 babilen http://refheap.com, http://paste.debian.net, https://gist.github.com, http://sprunge.us, …
14:55 XenophonF something like ps -eo pid,sz,trs -C salt-master maybe?
14:56 west575 joined #salt
14:57 Rumbles https://paste.fedoraproject.org/388080/14677306/
14:57 TooLmaN joined #salt
14:57 dfinn joined #salt
14:57 Rumbles it ignores the whitespace at the start for the second line
14:57 Rumbles do I have to break each line in to a seperate pillar item, or can I work around that soemhow?
14:58 babilen |indent(8) maybe?
14:58 Rumbles in the pillar?
14:58 babilen no
14:58 babilen In jinja
14:59 babilen http://jinja.pocoo.org/docs/dev/templates/#indent
15:00 Rumbles yep
15:00 babilen {{ salt['pillar.get']('mailgun:demo-app-portal')|indent(8) }} in case that wasn't clear
15:00 Rumbles that works
15:00 babilen cool
15:00 Rumbles thanks both babilen and krymzon  :)
15:01 babilen yw
15:01 Rumbles oh, wait... :/
15:03 Rumbles https://paste.fedoraproject.org/388082/73099914/
15:03 Rumbles still not happy, says I'm missing a colon :/
15:04 babilen You are using 6 not 8
15:04 Rumbles I tried with indent(8) and it was not the right level of indent, 6 is the right level but gives the same error
15:04 Rumbles I got the same error with 8
15:04 lero joined #salt
15:04 Rumbles oh wait
15:04 Rumbles no that was complaining about 2 lines below
15:04 Rumbles 1 sec
15:05 * babilen ♥ jinja
15:05 babilen This would be trivial in Python
15:05 Rumbles https://paste.fedoraproject.org/388083/67731150/
15:06 babilen You'd have to set indent(8, true) or start with two spaces more
15:06 Rumbles but there is nothing there in the state file, or in the pillar
15:06 Rumbles ok
15:06 Rumbles 1 sec
15:06 babilen Not sure if that helps something .. does it work if you paste the text in there verbatim?
15:06 babilen Or is a parsing error due to the content you are trying to set?
15:07 babilen Maybe try that first and *then* investigate the pillar approach
15:07 Rumbles render error
15:07 babilen When you do what?
15:07 Rumbles uh, 1 sec
15:08 babilen It's okay .. you can take your time :)
15:08 babilen But I have to leave soon
15:09 N-Mi joined #salt
15:15 Number6 XenophonF: Moved the master off - it was fairly easy, got back about 150M of RAM in the process
15:16 Rumbles sorry, I have other people coming to me with poblems
15:17 Rumbles even if I put the text in without the pillar it doesn't work
15:17 Rumbles Rendering SLS 'base:users.user_dev' failed: could not found expected ':'
15:20 Rumbles so, if I use test: | then the lines it doesn't work
15:20 Rumbles if I have test: then start each line below with a - it is fine
15:20 Rumbles sorry text: not test:
15:20 Rumbles :/
15:20 maettu joined #salt
15:23 ALLmightySPIFF joined #salt
15:24 Rumbles babilen, https://paste.fedoraproject.org/388086/46773225/
15:24 ALLmightySPIFF joined #salt
15:24 Rumbles am I doing something wrong there, as far as I can see that is the correct syntax :/
15:28 Rumbles I'm going to break the pillar down in to two items, username and password and include them seperately
15:28 Rumbles appending multiline text seems to be broken in 2015.5.3
15:29 onlyanegg joined #salt
15:39 tapoxi joined #salt
15:42 XenophonF Rumbles: you aren't indenting the text enough
15:43 brent_ joined #salt
15:43 XenophonF try indenting those lines two more spaces
15:44 XenophonF if you have multi-line text in pillar, then when you need to reference in a state, you need to serialize it appropriately
15:45 XenophonF i.e., use the |yaml filter like this: {{ salt['pillar.get']('foo:bar', '')|yaml }}
15:45 kshlm joined #salt
15:45 XenophonF otherwise jinja inserts the contents of "foo:bar" in the state file verbatim instead as yaml-encoded data
15:46 Slimmons joined #salt
15:46 XenophonF https://docs.saltstack.com/en/latest/ref/renderers/all/salt.renderers.jinja.html
15:46 Slimmons Any idea why when i run  salt '*' test.ping it returns nothing, but if I specify the target it works?  I only have one minion
15:47 Slimmons so salt 'myminion' test.ping works
15:47 Slimmons using boron
15:47 Slimmons ok, but now it's working.....Aliens.
15:47 XenophonF look, i'm not saying it's aliens, Slimmons
15:48 dendazen joined #salt
15:48 Slimmons I wish I could post the meme here
15:48 * XenophonF points to his "the truth is out there" poster
15:48 Slimmons love that guy
15:48 Slimmons lol, nice
15:48 XenophonF i'm greek american so hopefully that's close enough for you ;)
15:49 XenophonF don't have the crazy hair tho
15:50 XenophonF babilen: manually managing indentation in jinja, down that path, the dark side lies
15:51 * XenophonF waves hands
15:51 XenophonF indent() is not the jinja function you are looking for
16:00 fxhp joined #salt
16:01 Rumbles XenophonF, then why doesn't it work when I'm not importing it, I'm following the documentation on file.append nd it doesn't work
16:01 Rumbles in my last example I was just telling it to append multiline text, not importing from pillar
16:02 Edgan joined #salt
16:04 iggy Rumbles: pyyaml is weird
16:04 iggy you have to indent multi-line string literals an extra 2 spaces
16:04 Rumbles so is this wrong: https://docs.saltstack.com/en/latest/ref/states/all/salt.states.file.html#salt.states.file.append
16:04 Rumbles look at the Multi-line example
16:04 iggy (and nested data structures sometimes)
16:04 Rumbles it doesn't over indent
16:05 iggy no, but if you notice the text is all lined up under the "x" whereas in yours it under the "t"
16:06 Rumbles ergh ffs
16:06 Rumbles ok fine
16:06 Rumbles sensibe error messages would be nice
16:08 iggy sadly, the error is in an outside library, so it's hard to catch all the way up in salt
16:09 iggy so then yeah, if you pull it from pillar, use {{ pillar.varname | indent(8) }}
16:11 manji joined #salt
16:12 fxhp joined #salt
16:15 XenophonF no no no
16:15 XenophonF use {{ pillar.varname | yaml }}
16:16 XenophonF don't roll your own string serialization method
16:20 ajw0100 joined #salt
16:22 manji joined #salt
16:22 fxhp joined #salt
16:27 NaCL__ joined #salt
16:27 lugo__ joined #salt
16:27 NaCL__ hello
16:28 netjak joined #salt
16:29 netjak hi all
16:29 NaCL__ hey guy!
16:30 netjak iggy: still having issuses with that useres state from yesterday
16:30 netjak https://paste.debian.net/776719/
16:31 netjak Rendering SLS 'base:users' failed: Jinja variable 'user' is undefined
16:34 krymzon joined #salt
16:35 bowhunter joined #salt
16:40 woodtablet joined #salt
16:42 inad922 joined #salt
16:43 iggy XenophonF: does | yaml do the indentation for you as well?
16:43 Fiber^ joined #salt
16:54 netjak still banging my head with this
16:55 iggy sadly, I haven't thought of anything else to try since the other day
16:59 netjak https://paste.debian.net/776725/
16:59 netjak i changed state name, created new one..
16:59 ecdhe joined #salt
16:59 ecdhe_ joined #salt
17:01 netjak hm
17:01 netjak ok, ran from minion with debug again
17:02 ecdhe_ joined #salt
17:02 XenophonF iggy: the |yaml filter serializes the data as a YAML object, so it handles indentation, escaping, etc.
17:02 ronnix joined #salt
17:03 netjak https://paste.debian.net/776727/
17:03 netjak [DEBUG   ] No dest file found
17:03 netjak wtf
17:05 impi joined #salt
17:05 XenophonF that's not the error
17:05 iggy that just means it isn't cached yet and it needs to grab it from the master
17:05 XenophonF this is the error: Jinja variable 'user' is undefined
17:05 XenophonF sorry did you post your sls file, netjak?
17:05 netjak yeah
17:05 XenophonF add_users/init.sls?
17:05 XenophonF what's the url?
17:06 netjak https://paste.debian.net/776719/
17:09 permalac joined #salt
17:09 netjak i can see pillar data from minion
17:10 netjak https://paste.debian.net/776730/
17:12 XenophonF i would pare this down to a simple jinja template in a text file
17:13 XenophonF just the for loop with {{user}} in the text
17:13 netjak it was working
17:13 XenophonF deploy with file.managed
17:13 XenophonF see where that goes
17:13 XenophonF i feel like i'm missing something looking at the sls file
17:14 XenophonF you could try removing the call to pillar
17:14 XenophonF i'm just speculating wildly at this point
17:15 XenophonF hang on let me see if i can render this as a file template
17:22 XenophonF hm, i dunno
17:23 br joined #salt
17:24 rem5 joined #salt
17:32 tapoxi joined #salt
17:36 mapu joined #salt
17:38 amcorreia joined #salt
17:40 GreatSnoopy joined #salt
17:42 Slimmons I'm using file.directory, to move a directory to a minion, and when I run it, it takes a long time to run, which is fine b/c it's a lot of stuff, but it doesn't appear to be checking to see if it already exists on the minion, because if I run it twice in a row, it takes the same amount of time to deploy either way.
17:43 Slimmons Is there a way to make sure it only runs if the files don't exist?
17:43 Slimmons I thought it would already do that, so it's possible there's another issue
17:45 tapoxi anyone know what "Defaults must be formed as a dict" means when using file.managed? I'm using it as defined
17:47 tapoxi - defaults:
17:47 tapoxi - app: "test"
17:51 debian112 joined #salt
17:59 s_kunk joined #salt
18:00 tapoxi my bad! four spaces and no -
18:01 fannet joined #salt
18:13 Trauma joined #salt
18:14 felskrone joined #salt
18:17 dmaiocchi joined #salt
18:19 netjak okk, so i commented everything in the state file and it still throws that error, users undefined
18:20 netjak is there any error cache or smth?
18:22 netjak this is what i have in sls file
18:22 netjak my-admin:
18:22 netjak user.present
18:22 netjak when i apply that state jinja rendering error is still there
18:23 netjak so probably smth messed up with master
18:27 netjak geez
18:31 netjak hm
18:31 netjak https://paste.debian.net/776745/
18:31 netjak check this out
18:31 netjak when i remove all from state it works, but when i put commented stuff inside it braks again
18:31 netjak iggy: any idea?
18:32 cliluw joined #salt
18:32 iggy Slimmons: file.directory? or file.recurse?
18:33 Slimmons sorry, file.recurse
18:34 iggy netjak: because commenting like that doesn't keep it from being rendered use jinja comments if you are trying to keep something being rendered ( {# ... #} )
18:34 netjak oh
18:35 iggy Slimmons: that's sadly the way it works... it's especially bad if you are using jinja to render everything in there
18:35 Slimmons iggy: alright, well, luckily it's not tooooo big.  It takes less than a minute still, just surprised me the first time it happened.  Thought it had frozen on me.
18:36 linjan joined #salt
18:36 iggy Slimmons: I would probably move it into a tar file and use extract it instead... probably faster
18:37 Slimmons iggy: thanks, I'll try that
18:38 lero joined #salt
18:43 numkem joined #salt
18:43 onlyanegg joined #salt
18:46 noraatepernos joined #salt
18:53 whitenoise joined #salt
18:53 barmaley joined #salt
18:57 traph_ joined #salt
19:01 ronnix_ joined #salt
19:02 dmaiocchi joined #salt
19:13 netjak joined #salt
19:14 mikzaq joined #salt
19:15 mikzaq yo
19:15 mikzaq I have a question
19:16 west575 joined #salt
19:21 lero joined #salt
19:22 Shirkdog joined #salt
19:22 Shirkdog joined #salt
19:28 gimpy2938 joined #salt
19:30 forrest_not_logg joined #salt
19:30 forrest_not_logg jfindlay: Are you around?
19:31 gimpy2938 I have a file (dhcpd.conf) which needs hundreds of multi-line stanzas each of which I would like to manage in separate sls files ... any pointers to the best way to do that?  file.blockreplace maybe?
19:31 forrest_not_logg I guess someone else could answer, a while ago I added a `warning` to the docs here about the leading zero not being wrapped in quotes (https://docs.saltstack.com/en/latest/ref/states/all/salt.states.file.html)
19:32 forrest_not_logg Was this ever fixed so salt would handle this automatically?
19:32 forrest_not_logg I can't find a PR for it.
19:33 iggy I don't think that's fixable by salt... it's more of a consequence of yaml
19:34 iggy or maybe just a quirk of pyyaml
19:34 iggy in any case, no, not fixed
19:34 forrest_not_logg iggy: Yeah that's what I thought, I just hopped on a box that had a leading value and wasn't negatively impacted so I wanted to check, tanks for confirmng
19:34 forrest_not_logg *thanks
19:47 rem5 joined #salt
19:47 manji gimpy2938, maybe you could make it a jinja template and import each content
19:51 POJO joined #salt
19:57 bluenemo joined #salt
19:58 toddnni joined #salt
19:59 bluenemo hi guys. I want to build custom grains to use as "bait" for my monitoring system (list of mounted disks for the disk check and so on..). I could put them in grains['disk'] (disk is a list here) or I could build up a dictionary (imho would be cooler) in which I put all my grains then. Now when I export "monitoring" in every py it will overwrite and not merge the existing ones, right? If so, can I access existing grains from inside a /srv/salt/_grai
19:59 bluenemo ns/mygrain.py to merge the dict myself?
20:01 stanchan joined #salt
20:01 Ahlee bluenemo: You can write custom grains, and feed them out of _grains.
20:01 Ahlee bluenemo: https://docs.saltstack.com/en/latest/topics/grains/#loading-custom-grains
20:02 Ahlee save your python to _grains/bait.py,  salt \* saltutil.sync_grains; salt \* grains.items and look for your new grain
20:03 bluenemo aaah. I see
20:03 bluenemo yes, this I got. Ok doc answers my question, thank you! :)
20:04 brandon joined #salt
20:04 ekristen joined #salt
20:06 bluenemo everything wo an underscore will automatically called by salt when I sync_grains?
20:10 Lee- joined #salt
20:14 west575 joined #salt
20:17 Slimmons is there a way to retain the permissions of files when using file.recurse?
20:19 debian112 joined #salt
20:19 west575 joined #salt
20:22 Slimmons nevermind, found the answer here https://github.com/saltstack/salt/issues/2707
20:22 saltstackbot [#2707][OPEN] Recursive directory management doesn't preserve permissions | OS: Centos 6.3...
20:32 BlackBishop joined #salt
20:32 BlackBishop I have a couple of minions around the world .. it seems that some of them ( even if they are online ) take some more to reply than needed ( I think ) and return  [Not connected]
20:32 bilal80 joined #salt
20:32 BlackBishop any counter I should increase ?
20:33 ALLmight_ joined #salt
20:35 Eugene BlackBishop - through trial-and-error I have found that the minion-master connection can suffer a TCP timeout without being noticed by the minion(and thus, not receive the message). Periodicly calling 'test.ping' seems to alleviate it
20:36 Eugene My nagios monitoring system calls `state.apply test=True` once an hour, and it rarely/never times out
20:38 Eugene master_alive_interval is probably a good place to test, but I'm too lazy
20:40 BlackBishop thanks.
20:41 BlackBishop Now to figure out what's broken in amazon's linux ( removing network manager fails to boot the machine, probably some messed up startup scripts .. dhclient eth0 works just fine )
20:45 Eugene Everything; amazon linux is a bag of shit
20:45 Eugene Excising cloud-init is not really possible
20:46 Eugene If you want a clean system start with the CentOS AMIs instead
20:46 BlackBishop well, given that they don't offer a clean centos box ..
20:46 BlackBishop for a free tier
20:46 Eugene https://wiki.centos.org/Cloud/AWS
20:47 Eugene AFAICT that should qualify for the free tier just fine; it's tied to the Instance type, not the AMI
20:47 Eugene And no PMs, please
20:47 BlackBishop sorry, thought this is off-topic and thought that PM would be better.
20:47 Eugene And even these AMIs are based off of "Minimal", whch includes such gems as wpa_supplicant. Why? No clue.
20:47 Eugene It is, but we also don't care very much
20:48 BlackBishop not amazon's fault, wpa_supplicant is by default in centos
20:48 BlackBishop for some reason
20:49 onlyanegg joined #salt
20:49 Eugene The actual reason is because that's very tightly wound into NetworkManager, which is also useless for servers
20:49 BlackBishop hmm, seems google's centos image has the same issue
20:49 BlackBishop ( google's cloud compute )
20:50 Eugene 7.x?
20:50 BlackBishop yep
20:50 Eugene At a guess, it's because of the dumb udev / systemd device naming. It doesn't make any sense in a virtualized environment, but that's the new default.
20:50 BlackBishop no, it's eth0
20:50 Eugene I don't think you'll be able to get that cleaned-up in the AMI without some serious surgery
20:51 BlackBishop nothing about the naming ...
20:51 Eugene Oh, that's at least sane then
20:53 toabi any idea how I could scale `salt.states.postgres_user.present` better? I have 100 of them… each as separate ID and it takes ages (minutes) to check them… it takes longer the more users are already present on the host?
20:54 BlackBishop google's issue is that if the network isn't up .. their scripts go crazy and keep 1 cpu in 100% .. which in a micro instance with shared cpu ... is bad..
20:55 BlackBishop they have some kind of while true loop in the python scripts they use to get metadata and set stuff up or report or whatever they do
21:00 autofsckk joined #salt
21:01 BlackBishop Eugene: https://paste.fedoraproject.org/388151/14677524/ notice the " Device  does not"... 2 spaces, that's where the ifup script says the device name should appear
21:01 Eugene Huh. Neat.
21:02 Eugene No idea, sounds like a sysstemd issue TBQH
21:02 BlackBishop I'm sure there's some kind of broken shell script somewhere
21:12 pprkut joined #salt
21:27 ALLmightySPIFF joined #salt
21:29 ALLmightySPIFF joined #salt
21:29 autofsckk joined #salt
21:30 onlyanegg joined #salt
21:41 brent_ joined #salt
21:43 subsignal joined #salt
21:44 s_kunk joined #salt
21:47 renaissancedev joined #salt
21:47 renaissancedev Is it possible to import a Jinja file in a pyobjects state?
21:49 renaissancedev In particular, I have a Jinja map file and I would like to access one of its attributes in a pyobjects rendered state file.
21:49 flowstate joined #salt
21:59 sjorge joined #salt
22:00 deus_ex joined #salt
22:15 Slimmons so, to fix my salt-api stuff, I had to use the local.cmd.run instead of cmd.run.  I can't seem to find any documentation on the local. stuff.  When I google it, I get lots of local master/minion machines, but nothing on prepending normal states with local.
22:15 Slimmons can anyone post me to some docs?
22:15 Slimmons point*
22:18 rem5 joined #salt
22:24 onlyanegg joined #salt
22:24 tpaul joined #salt
22:31 TyrfingMjolnir joined #salt
22:35 zenlot joined #salt
22:49 joesusecom joined #salt
22:52 joesusecom Hi! Is there a way of figuring out the absolute paths of an SLS file or other resource from the Salt state system? This is what I have in mind:
22:54 JPT joined #salt
22:55 joesusecom With state.highstate or state.lowstate I can get __sls__ attributes that show me the path from the configured file root. E.g., if I have a folder "webservers" in /srv/salt and I'm using an SLS file called mystate.sls in that folder, I'll see __sls__: webservers.mystate.
22:55 joesusecom Could I also get the actual full path (in this case /srv/salt/webservers/mystate.sls)?
22:56 joesusecom I would like to create a dependency graph that shows where my states are coming from (for debugging purposes).
23:07 hemebond joesusecom: What about state.show_top
23:07 hemebond or state.show_sls
23:07 hemebond https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.state.html
23:12 joesusecom To really debug things I'd need to have the physical path on disk. All those state.show_* calls don't give me that path.
23:13 hemebond Ah okay.
23:13 joesusecom And I fear that that's a design issue. ;-)
23:13 joesusecom Because the salt minion may not even know about how the master merges the file roots.
23:13 hemebond That's true.
23:19 jhauser joined #salt
23:41 mosen joined #salt
23:43 netjak joined #salt
23:47 johnkeates joined #salt

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