Perl 6 - the future is here, just unevenly distributed

IRC log for #salt, 2017-05-16

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

All times shown according to UTC.

Time Nick Message
00:00 hemebond Why didn't they submit changes to the main saltstack-formulas? Maybe lack of attention?
00:00 prg3 joined #salt
00:00 whytewolf i don't know. you would have to ask them
00:01 hemebond > This project is successor of OpenStack-Salt project which under OpenStack Big Tent initiative provided resources for installing and operating OpenStack deployments.
00:01 hemebond Now I see.
00:08 hoonetorg joined #salt
00:10 woodtablet left #salt
00:13 DEger joined #salt
00:19 iggy which should have never been under the big tent
00:27 swills joined #salt
00:28 sp0097 joined #salt
00:31 jibba-jabba joined #salt
00:33 jibba-jabba Does anyone have experience using the Pip state with extras? ex: Pip.installed('airflow[async]')
00:34 jibba-jabba When I try to use the result as a requisite for another package, it says it can't find the requisite.
00:35 jibba-jabba Seems to work fine when I don't use extras though. ex: Pip.installed('airflow')
00:36 iggy did you check the issue tracker?
00:36 iggy this sounds familiar
00:38 aldevar left #salt
00:38 jibba-jabba I have not, let me go do that...
00:43 jibba-jabba Looking around still, haven't found anything yet. I'm using Pyobjects to describe my state file, not sure if that's the "best" Python integration module, or if I should be using the Py module instead.
00:43 iggy it shouldn't make a difference... it's just outputting a data structure... it's not actually running anything
00:44 iggy you could check the show_highstate and show_lowstate differences between the two, but I'd suspect it's either the pip salt module or pip itself being stupid
00:44 iggy (my money is on pip... for reasons)
00:45 jibba-jabba Yep, that's my assumption as well, based on the other behavior that I'm getting.
00:46 jibba-jabba Sorry, still new at Salt...how would I check the show_highstate and show_lowstate differences?
00:48 iggy !salt modules.state.show_highstate
00:48 saltstackbot https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.state.html#salt.modules.state.show_highstate
00:48 iggy and show_lowstate is right there too
00:52 jibba-jabba Cool, I'll look at that...I've poked around in the issues tracker (I'm assuming that's the one in GitHub), but couldn't find anything about pip extras...
00:56 fxhp joined #salt
00:57 whytewolf iirc it does not. mainly because the installed pip module doens't have the extras bit
01:00 raspado joined #salt
01:01 jibba-jabba Oh. You mean the Python "pip" module, or the Salt Pip state?
01:02 asyncsec joined #salt
01:04 whytewolf salt pip module is going to check if it installed. but when an extra requires is installed it goes by a different name then what was used to install it
01:05 whytewolf so like airflow[s3] doesn't install a module called airflow[s3] it installs what is required for airflow s3
01:06 jibba-jabba Oh, I see. Well that's awkward. :)
01:07 whytewolf yes
01:07 jibba-jabba Okay, so the Salt pip module does know about pip extras, and can even install them properly, but it makes requisites awkward...
01:07 whytewolf yeah it will install them. and try to install them everytime
01:07 whytewolf see the conversation at the end of this https://irclog.perlgeek.de/salt/2017-01-24
01:08 whytewolf between t_o and myself
01:10 thinkt4nk joined #salt
01:11 jibba-jabba Ah, yeah, I see. So not only are requisites a problem, even the pip.installed will continually re-install extras because it can't tell if they're there or not. Which probably means there's slim chance that I'd be able to do something about it from outside pip.installed.
01:11 whytewolf yes
01:11 jibba-jabba Well this is all a big bag of disappointment. :)
01:11 jibba-jabba Do you know if there's some other way I could work around this?
01:12 jibba-jabba ie how to ensure that those pip.installed actually ran successfully before starting up the services that depend on them?
01:12 whytewolf well tell the writters of pip to have a better way of telling if things are installed.
01:12 jibba-jabba :)
01:13 whytewolf you could just install what the extras would install anyway
01:13 jibba-jabba Yeah, I guess I'll have to dig into the airflow package and see what it's doing.
01:13 jibba-jabba But if those change over time, then my state module will be broken.
01:14 whytewolf well, blame pip for coming up with such a broken system and then airflow for using it
01:14 jibba-jabba Yeah I was surprised about the nature of the open bugs around the Pip module when I was perusing the bugtracker.
01:14 jibba-jabba Well stated. :)
01:16 whytewolf everyother system that trys something like this at least puts in virtual modules that track the install state of th "extra" module
01:17 masuberu joined #salt
01:20 jibba-jabba Alright, well thanks for your help. That cleared up what's going on big-time. I'll have a think about what to do about it now.
01:23 asyncsec joined #salt
01:30 darvon joined #salt
01:32 asyncsec joined #salt
01:32 jalaziz joined #salt
01:47 noobiedubie joined #salt
01:47 c_g joined #salt
01:48 ilbot3 joined #salt
01:48 Topic for #salt is now Welcome to #salt! <+> Latest Versions: 2016.3.6, 2016.11.4 <+> Support: https://www.saltstack.com/support/ <+> SaltStack Webinar on Carbon, Nitrogen, and Enterprise 5.1 on May 18, 2017 https://goo.gl/PvsOvQ <+> Logs: http://irclog.perlgeek.de/salt/ <+> Paste: https://gist.github.com/ <+> See also: #salt-devel, #salt-offtopic <+> We are volunteers and may not have immediate answers
01:49 onlyanegg joined #salt
01:56 evle1 joined #salt
02:03 hahuang65 joined #salt
02:13 DEger joined #salt
02:18 zerocool_ joined #salt
02:18 zerocool_ joined #salt
02:25 raspado joined #salt
02:29 jas02 joined #salt
02:33 noobiedubie joined #salt
02:45 hahuang65 joined #salt
02:50 DEger joined #salt
03:13 Tantagel surrender
03:13 Tantagel https://www.youtube.com/watch?v=mZGzu6oI9b4
03:13 Tantagel you have 46 minutes
03:13 DEger joined #salt
03:20 asyncsec joined #salt
03:29 DEger joined #salt
03:37 Praematura joined #salt
03:41 sp0097 joined #salt
03:46 gnomethrower joined #salt
03:48 ahrs joined #salt
03:59 c_g joined #salt
04:12 zer0def joined #salt
04:13 PatrolDoom joined #salt
04:19 hahuang65 joined #salt
04:30 auzty joined #salt
04:37 sp0097 joined #salt
05:03 sh123124213 joined #salt
05:08 hasues joined #salt
05:13 Elsmorian joined #salt
05:14 attente joined #salt
05:17 attente is there a way i can run salt-master on my laptop behind a nat firewall with a linode vps as my minion?
05:18 hemebond attente: Yes, as long as the minion can find connect to the your laptop on ports 4505 and 4506
05:19 whytewolf or, you could just setup either salt masterless, or use salt-ssh
05:19 hahuang65 joined #salt
05:19 attente hemebond: but doesn't that assume that my laptop is always from the same static ip address?
05:19 hasues I'm having a problem understanding  why my include directive is bad.  Can someone take a peek? https://paste.pound-python.org/show/glZF3iMM5dUoBodjafK7/
05:19 hemebond Depends on your setup.
05:19 attente i can't assume a static ip for my laptop at any time unfortunately
05:20 hasues attente: I'd probably look into salt-ssh.
05:20 hemebond Well if it can't be found using DNS either then no, you can't have you laptop as a master.
05:21 hemebond hasues: Does pillar.get('video:driver') actually resolve to something?
05:21 Elsmorian joined #salt
05:21 hasues hemebond: Yes.
05:21 impi joined #salt
05:22 hasues hemebond: virtualbox
05:22 attente whytewolf, hasues: thanks, does salt-ssh set up some tunnel or something? or is it just doing some basic masterless python execution via ssh?
05:22 attente nvm, i ought to just read the docs
05:23 whytewolf attente: salt-ssh sshes into the system and setups up a tmp pyton salt enviroment
05:23 whytewolf and yes read the docs
05:23 attente whytewolf: ok, thanks
05:23 hemebond hasues: Remove your jinja and see if that fixes it.
05:23 hemebond Oh
05:23 hasues hemebond: Okay, I'll temporarily yank it for a sec
05:23 hemebond pillar.get() is NOT the same as salt['pillar.get']()
05:24 whytewolf yeah i was wondering about that
05:24 rdas joined #salt
05:24 hemebond pillar.get() uses regular Python dict method.
05:24 whytewolf wasn't sure if pillar.get accepts : seperated pillar
05:24 hasues I tried the salt['pillar.get'] and it caused errors all throughout my formula,  I replaced it back with that through out and it just worked
05:25 hemebond hasues: If you had issues with salt['pillar.get'] the issues are elsewhere.
05:25 hasues I did read that salt['pillar.get'] was what one should consider, but I was having no luck with it in other stuff.
05:26 hasues Okay, I replaced it with salt['pillar.get'] and I had the same results.
05:26 hasues Still complains about the - character in vanilla-sources
05:27 hemebond Paste new code pls
05:27 hasues Np
05:27 whytewolf try - 'vanilla-sources' or move vanilla-sources to vanilla_sources
05:27 hasues whytewolf: I will try _...
05:28 hasues Wasn't sure if I read you could use _ or not
05:28 hasues https://paste.pound-python.org/show/BY0IzqYRpFHl6Bkdm8he/ <- update
05:28 whytewolf _ is more likely to work then something that is explicitly part of yaml
05:28 jhauser joined #salt
05:29 hemebond You've still got pillar.get() in your code/
05:29 hemebond Fix them all.
05:29 hasues You mean throughout all of the things being called from top.sls in its entirety?
05:29 hemebond Yes.
05:30 hemebond or at least the ones we can see in that paste.
05:30 hemebond Pretty sure it's the reason for the pkg.installed error listed at the bottom.
05:30 hasues ugh
05:31 hemebond (also, your pillar.get() is invalid so it has to be replaced)
05:32 hasues If I comment out that particular state from top.sls, there are no errors.  I guess I don't follow how that being changed throughout would make a difference
05:32 hemebond Using pillar.get('blah:blah') is invalid. Won't work. Has to be changed.
05:33 hasues Why does it work in other states?
05:33 hemebond It doesn't.
05:33 iggy it actually does work in newer versions
05:34 hemebond eeeeh?
05:34 iggy I don't know when it started, but yeah
05:34 hasues I thought it was in the docs
05:34 iggy took me by surprise as well
05:34 iggy it didn't historically
05:34 iggy I think they changed something in the lazy loader to allow it
05:34 hemebond That's not good.
05:34 hemebond Overloading basic accessors is naughty.
05:35 Elsmorian joined #salt
05:35 hemebond Well, if it is working (still not sure it is) then I don't know the problem.
05:35 hasues I'd rather do "Best practice", so if you are telling me to replace it everywhere, I will, but it seemed to cause problems last time.
05:35 hemebond Shouldn't be causing any problems.
05:35 iggy least surprise for who though? python people... certainly would be surprised by that
05:36 iggy salt (non-python) people... not so surprised I suspect
05:36 whytewolf hasues: what kind of problems?
05:36 hasues whytewolf: I've reverted all the changes so I'll tell you when I put them back in.
05:36 iggy that error message says to me you've got bad unicode chars in your sls
05:36 whytewolf ^
05:37 iggy i.e. a emdash instead of a regular dash
05:37 inad922 joined #salt
05:37 iggy so, tell your Mac to stop being smart with replacing characters and then fix that
05:38 hasues Mac?
05:38 whytewolf what editor are you using and are you copying and pasting from something else
05:38 hemebond Microsoft Word?
05:38 iggy typically people that hit this are running osx
05:38 hasues kwrite
05:39 hasues hemebond: Word?  reaaaally?
05:39 iggy tell it the file is ascii
05:39 hasues smh
05:39 iggy and then delete that char and type in a -
05:39 whytewolf kwrite. the note pad of kde
05:39 hasues whytewolf: Yeah, it's the base unit of Kate, which is the base editor of Kdevelop, etc.
05:39 iggy there's a one liner to check for unicode chars
05:40 whytewolf hasues: it is a horrable code editor
05:40 iggy grep --color='auto' -P -n "[\x80-\xFF]" file.sls
05:40 hasues whytewolf: I like it well enough.
05:40 iggy see if that shows anything
05:42 hasues iggy: it does not.
05:43 whytewolf hasues: on a minion use cp.get_template and look at it. does it look like valid yaml
05:45 hasues whytewolf: what two arguments am I passing to get_template?
05:46 hasues the init.sls and some new random destination?
05:46 whytewolf salt-call cp.get_template salt://path/to/file <place to put output>
05:46 hasues Okay.
05:47 iggy what does `pillar.get video:driver` return for that minion?
05:47 hasues Before I get into that, I looked in the editor and I see the Encoding set to UTF-8
05:47 hasues iggy: virtualbox
05:48 hasues Should I set encoding on the editor to Western European?
05:49 iggy for future reference, you can indent your jinja completely independently of the yaml
05:49 iggy it makes it much easier to read
05:50 whytewolf iso-8859-1
05:50 zerocool_ joined #salt
05:50 hasues whytewolf: done.
05:50 hasues iggy: Oh good, I think.  I am quite weak in all of this, so I wasn't sure what the best practice was there.
05:51 iggy I mention it because I had to read through it a couple of times to match tags ;)
05:51 hasues iggy: Sorry :(
05:51 iggy a lot of people don't realize that, it's all good
05:52 hasues I'm all ears for better practice.  I need to re-read the purpose of {% %} vs using {%- .. etc in there, as I think it handles where the next line appears or some such...
05:52 whytewolf {% = start tag {%- = start tag delete whitespace
05:53 whytewolf - is just a whitespace controll
05:53 whytewolf http://jinja.pocoo.org/docs/2.9/templates/#whitespace-control
05:54 iggy unless you are just super anal about the white space being in the rendered output (you shouldn't be) just avoid the {%- -%} versions
05:54 iggy unless you have some specific use case
05:54 hasues whytewolf: Ah, that wasn't the one I read.  This one looks a bit better, thanks!
05:54 iggy which you'll probably know when you hit that problem
05:54 hasues iggy: Well, this would be the state where that would matter as I was practicing with it to generate xorg configuration.
05:55 iggy I have a coworker that uses the whitespace killing versions everywhere because the extra lines bother her that much
05:55 Elsmorian joined #salt
05:55 iggy I stopped trying to fight her, but to me it's less readable
05:56 iggy yeah, it's used more in file templates (less so in the actual sls files)
05:56 whytewolf and to be fair iggy pocoo doesn't really go out of there way to let people know jinja templateing can be indapendet of the code. :P
05:56 xet7 joined #salt
05:56 iggy neither does salt
05:56 whytewolf very true
05:57 iggy what version of salt is this?
05:57 Bock joined #salt
05:57 druonysus joined #salt
05:58 hasues cp.get_template: https://paste.pound-python.org/show/EZAnIPtECqUjAlssuKh3/
05:58 hemebond :-)
05:58 hasues salt-call 2016.11.2 (Carbon)
05:59 rawzone joined #salt
05:59 hasues Hm, so the lines are problematic
06:00 Bock joined #salt
06:00 whytewolf okay, so video:driver is niether virtualbox or nvidia
06:01 hemebond Then it wouldn't have printed out "  - virtualbox "
06:01 hasues whytewolf: I was basing it on this: https://paste.pound-python.org/show/zZrDHW7VVTyzphjlAR5q/
06:01 hemebond But those top two pillar.get are the only ones fixed.
06:02 hemebond hasues: Do you still have `{% if pillar.get('video:driver') == 'virtualbox' %} ` in your file?
06:02 whytewolf ahh, so the ones with salt['pillar.get'] worked. [which gave - virtualbox]
06:02 whytewolf and pillar.get did not
06:02 golodhrim|work joined #salt
06:03 fracklen joined #salt
06:03 iggy oh wait, `{% salt.pillar.get('nested:lookup') %}` is the one that works
06:03 hasues hemebond: No, I replaced them earlier.  I think I posted the change up there somewhere
06:03 hemebond The one you pasted only had two instances changed.
06:03 iggy pillar.get() not so much
06:03 whytewolf oh yeah salt.pillar.get is just a shortcut to salt['pillar.get']
06:03 whytewolf that came in 2014.x.x
06:04 iggy my bad for saying that wrong earlier
06:04 hasues hemebond: Yeah, I had not finished the changes as I was trying to keep up with convo and requests as I was doing it.
06:04 hasues Okay, well, I'll start globally changing it.
06:05 hemebond 👍
06:05 Elsmorian joined #salt
06:05 hasues So I'll drop looking at this issue and take it from the top :)
06:06 iggy so yeah, you can either change them all to salt['pillar.get']() or salt.pillar.get()
06:06 hasues Hm, so that I'm not accused of being naughty or some such, is there a preference?
06:07 jeddi joined #salt
06:07 whytewolf which ever you like. it is a style choice
06:07 salty joined #salt
06:07 whytewolf they mean pretty much the same thing
06:07 salty hey yall
06:07 hasues I guess I'll go with salt.pillar.get
06:08 salty if I add a new grain on my minion from my minion how do I make my master aware about the change ?
06:08 hasues Do I use salt.pillar.get in {{  }} as well?
06:09 whytewolf hasues: you can yes
06:09 whytewolf I do all the time
06:09 zerocool_ joined #salt
06:09 hasues whytewolf: Do I use grains.get() or salt.grains.get() in {{ }} as well?
06:10 whytewolf hasues: if you are using salt.pillar.get i would also switch to salt.grains.get
06:10 iggy use the salt. version for consistency (imo)
06:10 hasues Okay.
06:10 hasues Just making sure.
06:11 salty can someone please tell me if I add a new grain on my minion from the minion itself, how do I make my master aware about the change ?
06:13 iggy no clue
06:13 iggy not sure why you'd need to though
06:14 hasues Does saltutil.sync_grains do that?
06:14 hemebond Don't you just restart the minion?
06:14 whytewolf the minion should do it with in the normal time frame of 60 seconds
06:14 whytewolf a sync_grains would do it. as it kind of forces the update
06:15 whytewolf so does a highstate
06:15 hasues salty: I'm guessing mind you as I just read this https://docs.saltstack.com/en/latest/topics/grains/
06:15 hasues Bottom section is "Syncing Grains"
06:16 whytewolf hasues: that mostly is about _sync
06:16 whytewolf err i mean _grains
06:16 whytewolf custom grains
06:17 hasues Oh, I thought that is what he was discussing when he was saying he added a grain.
06:18 whytewolf well it does force update
06:18 hasues whytewolf: well, according to that, so does the highstate that you mentioned
06:18 hemebond I just assumed they edited the minion config.
06:18 hemebond Which would require a restart.
06:19 whytewolf oh yeah if they edited the minion config [and not say added to /etc/salt/grains] then yeah
06:20 salty The minion is doing all sort of computing and in the process adds additional grains to itself. It has to tell the master about the new grains it has so that the master can take appropriate actions. 60 sec time frame makes the process slow. Thats why I am looking for a forced update from Minion to Master
06:20 hemebond sync_grains
06:21 do3meli joined #salt
06:21 do3meli left #salt
06:25 salty but sync_grains runs on master
06:25 whytewolf salty: no, it doesn't
06:25 hemebond then salt-call saltutils.sync_grains
06:26 whytewolf salty: the states run on the minion
06:26 raspado joined #salt
06:27 salty ok. lets start over. Can someone please give me the command that I can run on Minion so that the master becomes aware about the newly added grains on the minion
06:27 whytewolf salt-call saltutils.sync_grains
06:28 salty it says 'saltutils.sync_grains' is not available.
06:28 hemebond oops
06:28 whytewolf -s
06:28 whytewolf salt-call saltutil.sync_grains
06:29 salty Ok. Now it works. but no True or False after the command execution.
06:30 salty is that normal
06:30 whytewolf yes
06:30 hasues Well, my head is killing me, so I'm off.  whytewolf, hemebond, iggy...thanks for your help
06:30 salty all I got was local:
06:30 hasues whytewolf: also, what editor do you prefer?
06:30 hemebond salty: Yes, normal.
06:30 salty ok. Thanks you guys
06:30 whytewolf hasues: I like vim [gvim] but if you need something like kwrite sublime2 isn't wtf
06:31 hasues Vim is handy, but I'm not a fan of it
06:31 hasues The people who love it seem to like neovim, so you may want to check it out if you haven't.
06:31 whytewolf I have
06:32 hasues kwrite can act like vim for that matter.
06:32 hasues Anyway, thanks again.
06:32 hasues left #salt
06:34 rawzone joined #salt
06:46 dixienormouz joined #salt
06:48 jas02 joined #salt
06:49 dixienormouz left #salt
06:52 concerti joined #salt
06:53 feld joined #salt
06:54 rdas joined #salt
06:58 zerocool_ joined #salt
07:11 aldevar joined #salt
07:14 adelcast joined #salt
07:16 o1e9 joined #salt
07:19 ProT-0-TypE joined #salt
07:19 fracklen joined #salt
07:24 krymzon joined #salt
07:30 cro joined #salt
07:31 geomacy joined #salt
07:33 penguinpowernz joined #salt
07:35 ProT-0-TypE can I suppress the output for an http.query state?
07:37 glyf joined #salt
07:38 coredumb Is it possible to declare 2 branches - base and dev for example - from the same git formula ?
07:38 felskrone joined #salt
07:40 hemebond Declare?
07:41 hemebond Oh, you mean mount multiple different branches?
07:43 coredumb hemebond: yep
07:43 hemebond Does gitfs let you specify a branch?
07:43 hemebond (gitfs or whatever it is that people use for formulas)
07:44 impi joined #salt
07:47 coredumb hemebond: yes but I'm not sure you can specify two at once
07:47 coredumb well gotta test I guess ^^
07:47 hemebond I know you can change mount points with gitfs.
07:47 hemebond Not sure if that can also be used for formulas.
07:50 coredumb well isn't formula just a state directory on git anyway ?
07:51 zerocool_ joined #salt
07:51 hemebond ....yes?
07:51 hemebond I guess it is.
07:51 hemebond But it's invisible.
07:51 hemebond I don't use gitfs for anything so I'm not particularly familiar with it.
08:01 fredvd joined #salt
08:01 oida_ joined #salt
08:03 mikecmpbll joined #salt
08:06 candyman88 joined #salt
08:08 krymzon coredumb: you may want to try a simple git clone+checkout into two directories
08:08 DEger joined #salt
08:11 __number5__ joined #salt
08:14 evle1 joined #salt
08:15 coredumb krymzon: na I don't wanna have to clone on FS
08:16 pbandark joined #salt
08:18 k_sze[work] joined #salt
08:20 coredumb https://docs.saltstack.com/en/latest/topics/tutorials/gitfs.html#per-saltenv-configuration-parameters seems like it should just work actually :)
08:23 Rumbles joined #salt
08:24 akbarali joined #salt
08:24 akbarali Hi I have salt 2015.5.8 (Lithium) server every where,
08:25 akbarali I wanna upgrade this to the latest salt version
08:25 akbarali appreciate if there is any link
08:27 babilen Link for what?
08:28 akbarali I mean URL : to upgrade the salt server
08:29 babilen How did you install it?
08:29 akbarali It was installed through yum
08:30 babilen In that case you would configure a suitable repository and use yum to upgrade. I'd strongly recommend to upgrade the master first before you upgrade the minions
08:30 Mattch joined #salt
08:31 babilen See http://repo.saltstack.com/ for information on available packages. I would personally track the latest major version (→ "Pin to Major Version")
08:31 akbarali Cool. Thanks Babilen
08:34 zerocoolback joined #salt
08:48 fracklen joined #salt
08:49 fracklen joined #salt
08:49 fracklen joined #salt
08:49 linovia what books (recent if possible) would you recommend to an average salt user ? I'm lacking some resource to figure out how to make a state act like a "function".
08:50 linovia I mean I'd like to setup lets encrypt but in order to do that I have to configure a temporary nginx configuration to get the initial certificate and then discard that configuration with the durable one
08:50 haam3r_ linovia: what about "certbot --standalone"?
08:52 linovia haam3r_: doesn't it require to turn off the web server which means other sites are going offline ?
08:52 haam3r_ yes it does...I misunderstood you. I thought you were setting up a new machine
08:53 flughafen left #salt
08:53 Kelsar linovia: you want to alter your "normal" configuration anyways, or do you want to make this manually every 2-3 months?
08:54 glyf joined #salt
08:54 N-Mi joined #salt
08:54 N-Mi joined #salt
08:54 linovia Kelsar: I could do with the --standalone, but this won't help me get the solution I'm looking for since I may use it in other cases
08:54 babilen linovia: We are happily using https://github.com/saltstack-formulas/dehydrated-formula
08:55 ProT-0-TypE anyone having an issue with "batch" using it in a salt.state inside an orchestration sls?
08:56 krymzon Jinja/pillar question: how do I supply a default value (None) to a missing key for Jinja dict? (I'm looking for similar behaviour to python dict.get())
08:56 babilen ProT-0-TypE: I'm using batch inside orchestration just fine
08:56 ProT-0-TypE mmm
08:56 ProT-0-TypE I noticed if I add it if fails
08:56 babilen ProT-0-TypE: What is the problem you encounter and which version of salt do you use?
08:58 ProT-0-TypE babilen: https://pastebin.com/241RVDuB
08:58 dstensnes beacons with logging to influxdb: i'm trying to figure out how to feed beacon data to influx. Anyone have some clues for me?
08:58 ProT-0-TypE 2016.11.4
08:58 ProT-0-TypE with that batch the orchestration fails
08:59 krymzon ok, I think I've found filter 'default', I'll try it out
09:00 babilen Repasted at http://paste.debian.net/932678/
09:00 babilen ProT-0-TypE: How does it fail?
09:02 ProT-0-TypE babile: I've redacted salt master/minion names: http://paste.debian.net/932679/
09:02 ProT-0-TypE so it basically succeed, but the orchestration job itself fails
09:02 ProT-0-TypE but there are actually no errors
09:02 Kelsar linovia: just a redirect include to your vhosts, run the client somewhere else. LE follows redirects
09:02 ProT-0-TypE if I remove the batch, it works
09:03 linovia Kelsar: thanks
09:03 ProT-0-TypE babilen witch version do you use?
09:03 babilen ProT-0-TypE: I'm still not sure why you think that the orchestration job fails
09:04 ProT-0-TypE cause it says "Failed: 1 " in red
09:04 babilen (fyi: Most IRC clients support tab completion. Try "bab<TAB>")
09:05 babilen ProT-0-TypE: Could you run the salt-master in debug mode and paste the log one you trigger the orchestration?
09:05 babilen I'm on 2016.11.4 like you
09:06 ProT-0-TypE well
09:06 ProT-0-TypE I can actually reproduce it in a very easy way
09:06 ProT-0-TypE I noticed that it doesn't really depend on the content of the sls file
09:17 ProT-0-TypE babilen it fails even with this: http://paste.debian.net/plain/932680
09:17 ProT-0-TypE note that the state run itself doesn't fail
09:18 babilen ProT-0-TypE: Could you run the salt-master in debug mode and paste the log once you trigger the orchestration?
09:19 ProT-0-TypE well, there may be some "confidential" stuff, so I need a little bit of time to do that
09:19 ProT-0-TypE anyway
09:19 ProT-0-TypE if you run it the same way
09:19 ProT-0-TypE you don't have any issue, right?
09:19 preludedrew joined #salt
09:22 babilen ProT-0-TypE: I can reproduce your issue
09:23 ProT-0-TypE so it looks like a bug
09:23 ProT-0-TypE I'll open an issue in github
09:24 krymzon Is there any way to check the existence of a key in Jinja in pillar? Whichever way I try, I am getting "'dict object' has no attribute". I've tried .get, |default, if k in d, if d[k] is defined; all give the same error
09:25 glyf joined #salt
09:26 pewpew joined #salt
09:34 Praematura joined #salt
09:43 federico3 how can I trigger jenkins to rerun on a PR on GitHub?
09:45 zerocoolback joined #salt
09:50 Tantagel joined #salt
09:50 zerocoolback joined #salt
09:51 zulutango joined #salt
09:54 Kelsar joined #salt
09:55 hlub joined #salt
09:56 hlub Running orchestrate fails: OSError: [Errno 2] No such file or directory: '/var/cache/salt/master/file_lists/hgfs/.feature/salt-orchestrate.w'
09:56 zerocoolback joined #salt
10:17 evle joined #salt
10:20 babilen hlub: Can you reproduce that without hgfs?
10:28 raspado joined #salt
10:36 hlub I cannot test that now :(
10:37 hlub salt-run fileserver.clear_cache did not help.
10:37 hlub the problem is that the directory /var/cache/salt/master/file_lists/hgfs/.feature does not exist
10:40 zerocoolback joined #salt
11:01 zerocoolback joined #salt
11:10 zerocoolback joined #salt
11:10 auzty joined #salt
11:11 mavhq joined #salt
11:12 zerocoolback joined #salt
11:12 yannisps joined #salt
11:13 yannisps hey everyone! good afternoon. I am using the external git_pillar today and our project release flow uses a new Git branch on every release. I'm wondering how I can select a different Git branch via the external pillar... since this is hardcoded in the master configuration?
11:16 yannisps do you think that's possible to do, without having to write my own external pillar module?
11:21 hlub yannisps: why don't you use an additional branch which is the active state?
11:22 yannisps hlub: Hi! So the issue is that in every release the branch name changes. it goes like release/v0.20.0 and release/v0.21.0
11:23 yannisps but the branch in the salt master configuration seemingly has to be hardcoded
11:24 prg3 joined #salt
11:25 yannisps Seems to me that a solution such as http://stackoverflow.com/questions/26944235/creating-aliases-for-git-branch-names would be needed
11:29 hlub babilen: workaround for me, creating directories /var/cache/salt/master/file_lists/hgfs/.feature and /var/cache/salt/master/file_lists/hgfs/feature
11:31 hlub yannisps: I don't know if I understood the situation but.. You can use pillar data to configure salt. therefore you can use pillar data to define that.
11:32 hlub If I understood correctly I would suggest a branch name that always points to the current release branch.
11:41 Xenophon1 joined #salt
11:42 yannisps hlub: Correct, but that branch name in the external pillar is configured in the Salt master configuration rather than anywhere that it can be templated
11:43 yannisps as far as I can see the way to customise this per release (since each release branch has a new name) would be to use a Git tag called "active-release", for example
11:43 Tantagel https://www.youtube.com/watch?v=ivbO3s1udic
11:45 Tantagel have a Blessed day everyone, God loves you all very much
11:50 Praematura joined #salt
11:58 c_g joined #salt
12:00 hlub yannisps: salt master's config can be templated as any other config file.
12:04 jeddi joined #salt
12:04 yannisps hlub: whaaaat? woah. So I could use a pillar variable in there?
12:04 candyman88 joined #salt
12:05 nutcase_ joined #salt
12:05 thinkt4nk joined #salt
12:06 maxw joined #salt
12:07 yannisps hlub: it doesn't look like it. It goes crazy when I use {{ pillar['branch'] }} :p
12:07 hlub yannisps: of course, if you manage salt's installation. See https://github.com/saltstack-formulas/salt-formula
12:08 thinkt4n_ joined #salt
12:08 hemebond left #salt
12:09 DEger joined #salt
12:10 yannisps understood
12:10 yannisps ok this is not going to solve my problem though. I'll try to use a Git alias and see where I get to. Thanks!
12:12 hlub yes, just pointed it out although it is not the solution for that.
12:18 rgrundstrom-home Good afternoon
12:19 rgrundstrom-home Anyone that can help me out here... Some kind of syntax problem i think. https://justpaste.it/16q80
12:25 hlub Is it possible to query data from minion pillars within a runner template?
12:27 hlub rgrundstrom-home: remove that ' before ) in salt['pillar.get']('set_dns:search',) }}
12:29 rgrundstrom-home hlub: Rendering SLS error
12:30 hlub yeah, that is
12:34 hlub Jinja is not Python, Python would allow that syntax but Jinja does not.
12:35 rgrundstrom-home IS this how you wanted it? {% for test in {{ salt['pillar.get']('set_dns:dns_server ,)}}.items() %
12:36 hlub hmm, I just read the first line of your template and corrected that.
12:37 rgrundstrom-home hlub the search part os working... Its the {% for thats not working.
12:38 hlub rgrundstrom-home: {% for test in salt['pillar.get']('set_dns:search') %}
12:40 rgrundstrom-home That worked :)
12:41 rgrundstrom-home hlub: Awsome. Thnx
12:42 hlub np
12:45 numkem joined #salt
12:45 Joy what would be the reason for grains.get nodename to lag after normal hostname(1) output for a few minutes with salt-ssh? thin dir cache?
12:46 Joy ah, there it is, running_data/var/cache/salt/minion/grains.cache.p
12:47 noobiedubie joined #salt
12:48 Joy guessing i should run saltutil.refresh_grains
12:53 nicksloan joined #salt
12:56 edrocks joined #salt
13:05 impi joined #salt
13:08 asyncsec joined #salt
13:10 bennabiy joined #salt
13:10 babilen Joy: Thanks for the report
13:11 bennabiy SneakyPhil: ping
13:11 ssplatt joined #salt
13:12 edrocks joined #salt
13:13 Joy babilen: ah, you noticed the subsequent https://github.com/saltstack/salt/issues/41274 ?
13:13 saltstackbot [#41274][OPEN] salt-ssh thin dir contains grains cache which is updated at an unknown interval and ignored by saltutil.refresh_grains | Hi,...
13:17 promorph_ joined #salt
13:21 _JZ_ joined #salt
13:22 babilen Joy: I have :)
13:35 SaucyElf joined #salt
13:37 Xenophon1 rgrundstrom-home: {% for test in salt.pillar.get('set_dns:dns_server')|dictsort %} is how I'd write that code nowadays
13:38 toastedpenguin joined #salt
13:40 DEger joined #salt
13:42 smkelly joined #salt
13:44 overyander joined #salt
13:48 hlub XenophonF: except that it was not a dict
13:49 VR-Jack-H joined #salt
13:52 Praematura joined #salt
13:55 Brew joined #salt
13:56 rgrundstrom-home i know there is a - onlyif option you can pass in a lot of situations. Is there a counterpart option as well?
13:57 keldwud joined #salt
13:57 dunz0r rgrundstrom-home: I guess you could reverse the expression you're evaluating with or something?
13:57 keldwud joined #salt
13:57 candyman88 joined #salt
13:58 rgrundstrom-home Ill show you my code and write a larger explanation. One moment
14:00 brousch__ joined #salt
14:00 ahrs joined #salt
14:02 aldevar left #salt
14:05 rgrundstrom-home Here: https://justpaste.it/16q80
14:06 Sketch joined #salt
14:08 PatrolDoom joined #salt
14:09 PatrolDoom joined #salt
14:09 Tantagel joined #salt
14:16 fredvd joined #salt
14:18 impi joined #salt
14:28 justanotheruser joined #salt
14:28 prg3 joined #salt
14:34 Zaunei_ joined #salt
14:34 KingOfFools1 joined #salt
14:34 evle2 joined #salt
14:37 mikecmpb_ joined #salt
14:38 k4kvm joined #salt
14:42 hlub rgrundstrom-home: onlyif and unless
14:43 rgrundstrom-home hlub: Thnx.
14:45 hlub rgrundstrom-home: this doc is quite descriptive https://docs.saltstack.com/en/latest/ref/states/all/salt.states.cmd.html
14:45 okie_dokie joined #salt
14:45 okie_dokie goodmorning salt people
14:46 okie_dokie any up and willing to offer some help
14:47 zerocoolback joined #salt
14:52 cyteen joined #salt
14:54 sarcasticadmin joined #salt
14:54 Inveracity joined #salt
15:00 ahrs joined #salt
15:00 filippos joined #salt
15:07 crash0181 joined #salt
15:07 crash0181 hi, good day
15:07 crash0181 can someone please tell me the difference between state.apply and state.sls
15:07 crash0181 thanks in advance
15:09 raspado joined #salt
15:13 babilen crash0181: state.apply subsumes state.highstate and state.sls, but not state.sls_id
15:13 babilen (depending on the number of arguments you call it with)
15:14 rdas joined #salt
15:14 crash0181 i usually do it something like salt 'target' state.apply salt.state
15:14 babilen That would be state.sls
15:15 crash0181 or salt 'target' state.sls salt.state
15:16 crash0181 but, as i observe, both commands' output is the same.. given that there is no errors with my state as well as pillars
15:16 babilen Use whatever you prefer .. state.apply is newer and I'd consider it "best practice" at the moment, but as long as it doesn't provide the state.sls_id functionality it isn't a complete replacement
15:17 crash0181 ok, thanks for your advise :)
15:25 sp0097 joined #salt
15:28 jespada joined #salt
15:30 mikecmpbll joined #salt
15:33 candyman88 joined #salt
15:34 coredumb joined #salt
15:36 hasues joined #salt
15:37 dezertol joined #salt
15:37 onlyanegg joined #salt
15:45 mpanetta joined #salt
15:46 Pulp joined #salt
15:46 Praematura joined #salt
15:47 PatrolDoom joined #salt
15:54 gmdlx joined #salt
15:54 GMAzrael is it possible to do a base: 'Hostname glob' Grain match in top.sls?
15:55 gmdlx Hi. I'm wondering if anyone here has any experience using the Orchestrate Runner over Salt SSH? From searching around, it seems as though it _should_ be possible, but I'm having no luck getting it to work.
16:00 hashwagon joined #salt
16:02 SaucyElf joined #salt
16:13 hasues gmdlx: I would probably pastebin how you are invoking it so people can see what it's doing.
16:17 woodtablet joined #salt
16:19 whytewolf GMAzrael: if you can do it on the command line you can do it in the top.sls https://docs.saltstack.com/en/latest/topics/targeting/grains.html
16:19 gmdlx hasues: Good idea. I'll most likely create a GitHub repo example, as I've had to use a lot of trial and error to get things working; the steps outlined in the official basic salt-ssh tutorial using Vagrant at https://docs.saltstack.com/en/getstarted/ssh/system.html don't work at all (at least with version 2016.11.5). Perhaps I've done something completely wrong, although calling standard salt-ssh target state.apply some-state works fine
16:19 whytewolf 2016.11.5 isn't released yet
16:20 whytewolf unless i missed something last night
16:20 gmdlx whytewolf: pip install -U salt-ssh gave me 2016.11.5?
16:21 whytewolf https://pypi.python.org/pypi/salt
16:21 whytewolf shouldn't have
16:21 prg3 joined #salt
16:22 gmdlx Weird! pip search salt-ssh shows...
16:22 gmdlx INSTALLED: 2016.11.5
16:22 gmdlx LATEST: 2016.11.4
16:23 whytewolf strange. well you are running a dev version. that should be released soon anyway
16:23 whytewolf doubt the dev version is your issue though
16:24 kshlm joined #salt
16:25 gmdlx I doubt so too. I'm probably doing myself no favors by attempting to run in a self-contained directory, rather than the default /etc/salt, however it really should be possible for salt-ssh projects, and as mentioned, the official tutorial attempts to do so too, even though it seems to be completely outdated.
16:25 sergeyt joined #salt
16:26 whytewolf humm, i see nothing about orchestration in the tutorial
16:27 whytewolf and it doesn't matter where your base is. salt basicly trys to best guess what the minion will need and tarballs it up pushes it to the salt-ssh minion then runs it there
16:28 gmdlx I know, I just meant the basic salt-ssh setup in the tutorial isn't functional. Either way, even though I've managed to get standard salt-ssh calls working, I can't get salt-run state.orchestrate to work at all. There doesn't seem to be any official documentation on this either, but I've seen mention of an ssh: true value in the orchestrate sls files.
16:29 gmdlx There's some weirdness around directories still... even though I've duplicated the salt-ssh block under salt-run in the Saltfile, it still seems to look for /etc/salt/roster rather than ./etc/salt/roster (which salt-ssh picks up fine).
16:30 whytewolf ahhh, so what do you have. how are you targetting your minions in your orchestration?
16:30 gmdlx And when I duplicate the roster file under /etc/salt/roster, it complains about a 'None' env.
16:31 whytewolf okay, then we will need to see your master config
16:31 whytewolf and best practice would be salt-ssh and salt to use the same roster file exactly. so salt-ssh should use the /etc/salt/roster file also
16:32 gmdlx The master config under ./etc/salt/master simply consists of root_dir: ./file_roots:   base:     - srv/salt
16:33 gmdlx Sorry, https://paste.ubuntu.com/24587870/
16:33 whytewolf ... don't use relative paths
16:34 gmdlx So portable project based salt-ssh usage is completely unsupported?
16:35 whytewolf ;if you want portable you need to use virtualenv
16:36 gmdlx Yup, it's installed in a virtualenv.
16:38 whytewolf https://docs.saltstack.com/en/latest/topics/development/hacking.html#running-a-self-contained-development-version
16:39 whytewolf and no, salt is not a portable
16:41 snarfy^ joined #salt
16:41 asyncsec joined #salt
16:43 gmdlx Interesting, I'll give those instructions a run-through and report back tomorrow. Thanks whytewolf, much appreciated.
16:46 impi joined #salt
16:55 hahuang65 joined #salt
17:01 censorshipwreck joined #salt
17:03 hahuang65 left #salt
17:12 mikecmpbll joined #salt
17:13 brd hmm, does file.directory's clean option not work with require_in?
17:15 whytewolf humm. i would think it would. as long as the file.directory ended up requireing the other state
17:15 whytewolf maybe a bug?
17:16 brd yeah
17:16 whytewolf is the other staate a file.recurse or file.directory??
17:16 brd I have a Jinja for loop that creates other states which is why I am trying to use require_in..
17:16 brd neither, just file.managed
17:17 whytewolf humm. okay. i would say file a bug report cause i would think it should work.
17:17 nixjdm joined #salt
17:17 brd yeah
17:19 brd I'll poke at the tests and see if there is one and if not try to write one :)
17:21 swills joined #salt
17:27 ChubYann joined #salt
17:36 nicksloan joined #salt
17:38 Xenophon1 joined #salt
17:46 swills joined #salt
17:50 swills joined #salt
17:55 nbuchanan joined #salt
17:59 jmedinar joined #salt
18:01 exegesis joined #salt
18:02 jmedinar Question: I am getting this while starting a salt-minion
18:02 jmedinar ERROR: Unable to look-up config values for /etc/salt
18:03 jmedinar it runs fine when running debug mode and cannot see any reference to an error
18:03 englishm_work joined #salt
18:04 nicksloan joined #salt
18:05 VR-Jack2-H joined #salt
18:10 sjorge joined #salt
18:15 snarfy^ joined #salt
18:18 iggy jmedinar: did you search for that error already?
18:18 iggy there's an issue open in the saltstack tracker that talks about a bad minion config
18:18 PatrolDoom joined #salt
18:19 jmedinar yes I found the open issue but didn't see anything related to config
18:19 iggy and you aren't targetting in your pillar top file using other pillars?
18:19 iggy running as a different user?
18:19 dlloyd joined #salt
18:20 jmedinar no is running as root
18:21 hashwagon joined #salt
18:25 jmedinar I already checked permissions, the content of the minion file minion.d folder etc etc... even the init.d script
18:25 jmedinar if I start it as salt-minion -d works fine
18:25 jmedinar but cannot initiate it as a service
18:26 iggy did it ever work?
18:26 jmedinar yup has been working for about a year now
18:29 iggy did something change recently? Do you have backups of the configs?
18:31 jmedinar https://github.com/saltstack/salt/issues/40529
18:31 saltstackbot [#40529][OPEN] salt-minion fails to start "ERROR: Unable to look-up config values for /etc/salt" | Description of Issue/Question...
18:31 jmedinar that's the only reference I have found
18:32 jmedinar I don't have backups of the config is very simple master and id
18:32 jmedinar and I have more than 100 minions just this one is failing
18:33 iggy tried clearing the cache?
18:34 nixjdm joined #salt
18:34 jmedinar no I have not tried that
18:34 jmedinar let me check
18:35 VR-Jack-H joined #salt
18:36 jmedinar didn't help
18:36 MajObviousman so this is interesting: https://gist.github.com/anonymous/66199ba32bef396b509e2a88200b0680
18:37 MajObviousman --out=no_out fails. Apparently it's declared as quiet in the file instead?
18:37 * MajObviousman adds to list of docs to patch
18:39 MajObviousman also, hwat: https://docs.saltstack.com/en/latest/ref/output/all/salt.output.pony.html   ?
18:40 * rewbycraft facedesks
18:41 hackel I'm trying to figure out the best way to use salt to create and manage LXD containers.  Are the LXC states compatible?  Should I be using salt-cloud, or lxc.init?  lxd-formula?  Just hoping someone can help me weed through the myriad of options...
18:47 cscf hackel, the lxc.init runner is working great for me, but I'm not using LXD.  Afaik, LXD is just a different CLI front-end to the LXC libraries.
18:50 cyborg-one joined #salt
18:52 hackel cscf: That's what I thought. Is there a way for the runner to be used in a state configuration, though?  Maybe I'm just missing something here.  How would this configuration be preserved?
18:57 noobiedubie joined #salt
18:58 cscf hackel, like, you want to run a state on a host to ensure some containers exist?
18:59 hackel cscf: Right, at least, I want to commit configuration that wil ensure the containers (saltified minions) exist before I configure them.
18:59 cyteen joined #salt
19:00 cscf hackel, that sounds like orchestratio
19:00 cscf *n
19:01 cscf hackel, personally I've been just calling salt-run lxc.init from the command line, I don't consider container creation to be a configuration, as such.
19:03 hackel cscf: Perhaps not, or maybe I'm just using the wrong terminology.  Since I started using salt, my mantra has justb been to never make any kind of manual change to a system, so they were 100% reproducible.  I have my master also configured as a minion.
19:04 cscf hackel, same, however I haven't been treating the creation of containers as being something who's state is tracked.  If you regard containers existing as part of the host's configuration, you might want to use Orchestration to handle that
19:04 GMAzrael_ joined #salt
19:04 cscf ie, ensure that the container exists before applying it's state.
19:04 hackel I mean, I could just put the lxc.init commands in a shell script to use if I ever had to rebuild everything.  Maybe that's the easiest thing to do.
19:06 hackel cscf: By orchestration, do you mean the state.orchestrate salt runner, or just in general?
19:07 cscf hackel, in general. I don't use orch myself, tho.
19:09 hackel cscf: Okay, thanks.  Looks like I should be using salt-cloud for this, which also uses the lxc runner.
19:09 cscf hackel, I tested salt-cloud, I didn't notice much more functionality over lxc.init, given the extra work.  But maybe I did it wrong.
19:10 nicksloan joined #salt
19:12 hackel cscf: Yeah, from what I can tell, the only additional "functionality" it might have is that the configuration can be saved.
19:22 CrummyGummy joined #salt
19:26 aldevar joined #salt
19:27 nicksloan joined #salt
19:29 GMAzrael joined #salt
19:29 armyriad joined #salt
19:31 rgrundstrom-home Good evning
19:31 GMAzrael joined #salt
19:31 rgrundstrom-home Correct me if im wrong but Salt reads configuration in the order its is written?
19:33 nixjdm joined #salt
19:34 XenophonF joined #salt
19:34 cmarzullo what configuration? the states or the minion / master config
19:35 rgrundstrom-home states and pillars
19:36 cmarzullo pillars are merged in the top file.
19:36 cmarzullo states are generally processed in order, but can have stuff happen with the global requisites
19:38 cmarzullo salt \* state.show_highstate will show order if you are trying to troubleshoot something
19:39 rgrundstrom-home Im my case I have a pillar that is defined default as the first thing in pillar/top.sls and further down in the top file is a another pillar file that has the same pillar but a diffrent value. So I wanted the last pillar value defined is the one that it should use
19:40 rgrundstrom-home But it does not seem to work
19:44 cscf rgrundstrom, that works for me
19:44 cscf rgrundstrom, what happens?  You get just the default one?
19:47 rgrundstrom-home seems so
19:48 fracklen joined #salt
19:51 cmarzullo check your pillar_source_merging_strategy in /etc/salt/master
19:53 Elsmorian joined #salt
19:55 rgrundstrom-home I changed my pillar_source_merging_strategy to overwrite .... It was commented out.  Lets see what we get....
19:57 SneakyPhil bennabiy: regarding reactors/beacons/mines, I have not used them just yet. I have a thing I plan to use eventually, but haven't had the time just yet.
19:57 bennabiy SneakyPhil: thank you for getting back to me
19:57 SneakyPhil bennabiy: regarding formulas/states using grains, that's a day to day task now
19:57 SneakyPhil bennabiy: sorry it took so long
19:58 bennabiy SneakyPhil: What was the most useful tool you used to learn / transfer from conventional to salt?
19:58 SneakyPhil bennabiy: A good place to check out is https://github.com/saltstack-formulas
19:58 SneakyPhil it's a collection of community formulas
19:58 SneakyPhil a formula is a collection of states (.sls files)
19:58 bennabiy SneakyPhil: that is helpful
19:58 SneakyPhil bennabiy: what I would do (because I've done it in the past and it worked for me)
19:59 SneakyPhil configure a salt master and configure a single node to be a salt minion
19:59 SneakyPhil and then use salt as an arbitrary command runner
19:59 SneakyPhil use it to start replacing tasks that would have you ssh'ing to a specific node and running abitrary commands
20:00 SneakyPhil I do things like, `sudo salt '*' cmd.run "systemctl status mysqld"` or `sudo salt '*' cmd.run "yum install vim -y"`
20:00 SneakyPhil from there take a look at formulas
20:00 SneakyPhil formulas are a way to do all the complex manual stuff for you
20:01 bennabiy SneakyPhil: will look into that
20:01 SneakyPhil but being able to see the power in just running arbitrary commands against a fleet of servers is a good intro
20:01 bennabiy I think I probably try to bite off more than I can chew, and get overwhelmed
20:01 SneakyPhil don't we all :)
20:01 SneakyPhil welcome to the club
20:01 bennabiy thanks :)
20:02 SneakyPhil you can do it!
20:02 bennabiy SneakyPhil: where are you located?
20:02 SneakyPhil slowly over time all these concepts will begin to make sense, just gotta things slowly at first
20:05 * bennabiy waves...
20:05 bennabiy off to the mine
20:19 DEger joined #salt
20:19 justan0theruser joined #salt
20:20 DEger_ joined #salt
20:25 stomith joined #salt
20:32 aldevar left #salt
20:32 nixjdm joined #salt
20:33 onlyanegg joined #salt
20:38 Elsmorian joined #salt
20:39 rgrundstrom-home Ha got it working.... It was an incorrect [% if.... The if was working but was missing a little bit extra code :)
20:44 ujjain joined #salt
20:44 ujjain joined #salt
20:47 shanth joined #salt
20:48 shanth how can i insert the hostname of a machine using a grain and jinja templating?
20:49 snarfy^ {{ grains['fqdn'] }}
20:49 shanth thanks snarfy^, i saw that before but couldn't find it in the docs again
20:50 shanth c_g: the state.sls_id thing worked great
20:53 schemanic joined #salt
20:54 schemanic Hi. I have a question about local and remote pillars matching the same state - Say I have a pillar in /srv/pillar and also in my git repo via ext_pillar, do I get configuration settings from both of them or will I have a problem?
20:54 shanth snarfy^: can i do the same for pillar? {{ pillar['mypillar'] }}
20:55 schemanic Specifically in regard to this formula: https://github.com/saltstack-formulas/salt-formula
20:55 snarfy^ yup :) you can also use the salt to set variables with a default
20:55 snarfy^ so like {{ salt['pillar.get']('foo', 'bar') }} would look in pillar for the value of the key "foo"
20:55 schemanic My issue is that the formula doesn't seem to support specifying ext_pillar, though it will install dependencies for gitfs, so I want to drop an sls in /etc/salt/master.d
20:56 snarfy^ and if it didn't find it, it would set that {{ }} as "bar"
20:56 whytewolf schemanic: ext_pillar and pillar stored on the system are merged together. they all are just accessed by pillar
20:56 snarfy^ like a fallback string
20:57 schemanic whytewolf: so If I'm bootstrapping my salt master using the formula, and I manually place a minimal pillar in /srv/pillar but also commit a more elaborate one to my ext_pillar, they wont collide problematically?
20:58 ProT-0-TypE joined #salt
20:58 ProT-0-TypE is it possible to hide the output (body) of the http.query state?
20:59 DEger joined #salt
20:59 whytewolf schemanic: they very well could. https://docs.saltstack.com/en/latest/ref/configuration/master.html#pillar-merging-options https://docs.saltstack.com/en/latest/ref/configuration/master.html#ext-pillar-first
21:00 c_g joined #salt
21:00 shanth thanks snarfy^
21:02 schemanic I see, so I have to pick the pillar merging strategy
21:07 prg3 joined #salt
21:12 schemanic huh
21:13 schemanic okay so apparently the repo I'm pointing to DOES have external pillars as part of it, just no example for how they're supposed to be written up in the pillar
21:13 raspado joined #salt
21:16 whytewolf what do you mean schemanic? git_pillar [the ext_pillar that does a gitfs style pillar] is exactly like normal /srv/pillar in that it is structured exactly the same.
21:16 whytewolf only it sits in git instead of the filesystem
21:17 whytewolf as far as states go. they don't care if the pillar is comeing from ext_pillar or pillar
21:17 schemanic whytewolf, you mean that for https://github.com/saltstack-formulas/salt-formula I should just use normal notation and it should work like I had made it myself?
21:18 whytewolf schemanic: that has no default pillar. that is just states
21:18 whytewolf pillar.example is just an example of what you would structure the pillar like.
21:20 whytewolf schemanic: ext_pillar is compleatly seperate config. that has nothing to do with file_roots
21:21 schemanic whytewolf: I'm afraid I don't understand you. I am trying to use https://github.com/saltstack-formulas/salt-formula to set up my salt master. The formula uses an example pillar, but that file doesn't describe how an ext_pillar should be specified. The formula I mentioned DOES handle ext_pillar, but I don't know if I need to write anything special in the formula's own pillar file to make it work
21:21 ranna joined #salt
21:21 whytewolf it doesn't use it.
21:21 whytewolf it only has it so you know how to structure your pillar
21:22 schemanic Are you saying that I cannot specify external pillars with this formula?
21:23 schemanic Or are you saying that there are no states that handle external pillar and that I may specify them as I normally would, were I not using https://github.com/saltstack-formulas/salt-formula
21:23 whytewolf I'm saying that ext_pillar has no bearing on states/formulas. ext_pillars just get merged into the pillar dict
21:23 schemanic Yes but that's not the question I'm asking
21:24 schemanic I am asking for instructional information as to how to accomplish specifying what my external pillars are using the formula I linked to
21:24 whytewolf so what are you asking?
21:24 schemanic ^
21:24 whytewolf ahh one sec
21:25 schemanic I'm asking so because it's not clear how I'm supposed to specify external pillars
21:25 schemanic but I found a conf file that gets rendered with Jinja that explicitly looks for ext_pillar in the formula pillar
21:26 schemanic so I have a feeling that the repo maintainer just didn't put in an ext_pillar example
21:26 schemanic but I don't know if thats because they were lazy and didn't specify what format they wanted the YAML in for that, o
21:26 bigjazzsound joined #salt
21:26 schemanic OR if they set it up so one can just write it the way you normally would
21:30 whytewolf looks like you can just put normal ext_pillar settings in the master setting and have it work. honestly i don't use formulas much so hate having to dig into their crappy code. personally i would just grab the pillar data for master and use the file.serialize function since the master config is just yaml.
21:33 nixjdm joined #salt
21:35 schemanic Thanks whytewolf. I'm leaning on formulas right now so I can cover more ground. My company is JUST now letting me work on config management after wasting my time for about a year so I'm not super dangerous yet.
21:40 snarfy^ left #salt
21:40 puzzlingWeirdo joined #salt
21:42 whytewolf wow, lots of wtf in this formula. why bother with all this heavy rendering in salt config files. they are bloody yaml files. use a map.jinja to generate your seperate config files. and just serialize ... so much extra coding that just slows the system down. the only reason i think they did it this way is that that the config comments are there.
21:43 schemanic Maybe I'll come back and ask after it once I've got something up and running
21:45 whytewolf sorry, just going off on the design of it. but looking at it you should be able to just pop it in like you think it would go.
21:45 whytewolf they just have all sort s of little tweeks that really don't do much
21:48 schemanic mmm
21:48 schemanic No problem
21:49 schemanic I had a great conversation a few months ago with cmarzullo about how to properly reference formulas from other formulas and apparently no one utilizes the technique.
21:52 jalaziz joined #salt
21:54 shanth salt is kinda hard sometimes schemanic
21:54 shanth i just setup 5 formulas but i know they are less than ideal. feels bad
21:54 fracklen joined #salt
21:56 jeddi joined #salt
21:58 SneakyPhil is there anyway to print non-minified (condensed) output via the "{{ some_object | json() }}" jinja filter?
21:59 schemanic shanth: tell me about it. I think that the formulas are a great idea though. When they work they work well
21:59 whytewolf SneakyPhil: json(False) iirc
22:00 whytewolf if it works like the yaml filter anyway
22:01 SneakyPhil whytewolf: no dice
22:01 rgrundstrom-home My pillar/top.sls has a bit of code that matches host to pillar/<host>.sls How ever... I just discovered that if that file does not exist salt wont run cleanly. Normally I would fix this with an file.exists but that dont seem to work with pillar files. Any suggestions on how to solve this?
22:01 SneakyPhil I see someone talking about file.serialize and outputting that as json
22:01 SneakyPhil seems... alrighty I guess
22:02 schemanic Hey, a little to the side, but, does anything bad happen when you run sudo command while you're already the root user?
22:02 schemanic sudo commands*
22:02 whytewolf schemanic: no
22:02 SneakyPhil ^
22:02 schemanic Thanks
22:03 schemanic I've adapted the setup script that the formula sends to the Vagrantfile to set up a test box so I can get it running on AWS Linux
22:03 schemanic usually we elevate first and run all of our commands from there
22:04 schemanic so I wanted to know what would happen if I left all of my sudo-ery in the script
22:05 whytewolf shouldn't be an issue and is a valid test even and it will still run it as if a user ran it. with sudo. only thing is that root doing sudo won't ask for a password
22:10 thinkt4nk joined #salt
22:14 sarcasticadmin joined #salt
22:15 whytewolf SneakyPhil: not sure if this will work but try json(indent=True)
22:17 whytewolf looks like the json filters has 2 settings sort_keys and indent
22:19 whytewolf ohhh. indent=1
22:19 whytewolf If indent is a non-negative integer (it is None by default), then JSON array elements and object members will be pretty-printed with that indent level. An indent level of 0 will only insert newlines. None is the most compact representation.
22:21 onlyanegg joined #salt
22:24 Praematura_ joined #salt
22:26 cyteen joined #salt
22:27 Rumbles joined #salt
22:33 nixjdm joined #salt
22:34 SneakyPhil whytewolf: can I ask where you found that information?
22:34 SneakyPhil I searched and searched
22:35 whytewolf SneakyPhil: a. the code. and b. https://docs.python.org/2/library/json.html
22:35 whytewolf https://github.com/saltstack/salt/blob/5dee0b48041826858386b10703bbe64fa0e285d5/salt/utils/jinja.py#L758
22:39 onlyanegg joined #salt
22:42 whytewolf deifnlty not an easy thing to find.
22:42 SneakyPhil +++
22:43 perfectsine joined #salt
22:51 N-Mi joined #salt
22:53 hemebond joined #salt
22:59 colegatron joined #salt
23:10 amcorreia joined #salt
23:26 hemebond joined #salt
23:33 nixjdm joined #salt
23:40 raspado joined #salt
23:44 onlyanegg joined #salt
23:50 Tantagel joined #salt

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