Perl 6 - the future is here, just unevenly distributed

IRC log for #salt, 2018-02-15

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

All times shown according to UTC.

Time Nick Message
00:02 KolK joined #salt
00:03 deuscapturus joined #salt
00:10 pipps joined #salt
00:58 exarkun joined #salt
01:43 pipps joined #salt
01:45 pipps joined #salt
01:46 deuscapturus joined #salt
01:48 deuscapturus joined #salt
01:55 Whissi joined #salt
01:58 gnomethrower joined #salt
02:30 snakegums joined #salt
02:38 exarkun joined #salt
02:41 tiwula joined #salt
02:56 frew /join/1
02:56 frew woops
02:58 ilbot3 joined #salt
02:58 Topic for #salt is now Welcome to #salt! <+> Latest Versions: 2016.11.9, 2017.7.3 <+> Support: https://www.saltstack.com/support/ <+> Logs: http://irclog.perlgeek.de/salt/ <+> Paste: https://gist.github.com/ <+> See also: #salt-devel, #salt-offtopic, and https://saltstackcommunity.herokuapp.com (for slack) <+> We are volunteers and may not have immediate answers
03:00 pbandark joined #salt
03:12 zerocoolback joined #salt
03:23 jsmith0012 joined #salt
03:24 jsmith0012 joined #salt
03:25 jsmith0012 joined #salt
03:27 jsmith0012 Question.  still relatively new to salt stack.  i was looking over the established connections on the salt master and noted the connections for each minion.  is there a way to determine what minion is what connection?
03:28 pipps99 joined #salt
03:31 pipps joined #salt
03:37 MTecknology with ss perhaps?
03:37 jsmith0012 ss?
03:37 zerocoolback joined #salt
03:37 MTecknology "man ss"
03:38 MTecknology or netstat if you prefer
03:39 jsmith0012 yea just looked at it.  it would require me to know the public ip of the minion,  may not work if multiple minions are behind a single ip
03:40 jsmith0012 was just looking into using dig in the mine to report back the ip from time to time
03:41 jsmith0012 but it is a good start.
03:41 jsmith0012 ps.  i like the description of ss...... "ss - another utility to investigate sockets"
03:43 hemebond So you're not after the minion IP, but the socket it's using?
03:45 jsmith0012 yes.  think of it this way.  i can test if a minion is active via test.ping for example but that takes time.  just looking at the list of sockets is faster
03:47 pipps joined #salt
03:47 MTecknology with about 1/10th the accuracy?
03:47 MTecknology test.ping really isn't the thing to use anyway. Runners are much more betterer.
03:48 jsmith0012 ahhh still new.  have not gotten into runners yet
03:50 MTecknology don't fall into the trap of over-engineering things that could be done simply
03:50 jsmith0012 ok i just reviewed them.  i still dont see there value. my goal is to know in advance if a series of actions will work on a minion.
03:51 tiwula joined #salt
03:52 MTecknology their*
03:52 hemebond jsmith0012: That's probably a better question to ask.
03:53 jsmith0012 if that sounds stupid. my excuse is still new to salt. :) seriously love this platform
03:53 hemebond Actually that's a completely different question.
03:53 tiwula joined #salt
03:53 hemebond If you explain what you want, people can offer solutions.
03:56 MTecknology I'm curious about this concept of deciding if states will execute correctly based on sockets existing.
03:58 jsmith0012 ok,  i am trying to determine the state of a minion before sending it a series of commands to execute.  it is more of a optimization than anything.  if the minion is not there then do not send anything.
03:59 MTecknology If that makes sense to someone, it's not me.
04:00 MTecknology what actual optimization are you trying to achieve?
04:00 jsmith0012 i come from a networking background.  i noticed a pattern of tcp connections of a minion that is fully connected vs one that not complacently connected based on how many sockets are used.  the issue comes from when 2 or more minions share the same public ip via nat
04:02 jsmith0012 not attempting to send something that will not work.  hate to say this again. i am very new to salt
04:03 MTecknology 21:50 < MTecknology> don't fall into the trap of over-engineering things that could be done simply
04:03 MTecknology You can either take my advice, or continue trying to tweak/tune/optimize something your not familiar with...
04:03 jsmith0012 give me another direction then
04:03 MTecknology I don't think 0mq works the way you think it does.
04:03 MTecknology another direction for what?
04:03 MTecknology 22:00 < MTecknology> what actual optimization are you trying to achieve?
04:04 * hemebond doesn't know what the goal is
04:04 jsmith0012 ok.  so what i am gathering is i need to understand 0mq.
04:04 hemebond For what?
04:04 MTecknology hemebond: to do mage
04:05 hemebond You mean "magic"?
04:05 MTecknology nah, I meant to leave it sounding dumb :)
04:05 hemebond LOL
04:05 hemebond Mission accomplished I guess :-D
04:05 MTecknology woot!
04:05 MTecknology another woot- I finished chemo today!
04:05 hemebond What? You did? Like... actual chemo?
04:06 jsmith0012 so no one has ever wondered how many minions are actually connected at any given moment with out running a command?
04:06 MTecknology yup, next up is a short break, then radiation, then a longer break, then surgery, then recovery, and hopefully a final surgery
04:06 hemebond jsmith0012: That's what test.ping tells me.
04:06 jsmith0012 a command in salt.
04:06 MTecknology I like the runner so it only tells me in a pretty list what is either available or unavailable.
04:07 hemebond MTecknology: Well done! Congrats.
04:07 MTecknology thanks :)
04:07 lkthomas heh, since a lot of people around, let me ask again:  pkg.installed with sources pointing at URL to download rpm, it works fine but everytime it will fetch that URL again and again when I run high state, any way to avoid redownload process ?
04:07 hemebond lkthomas: Hash?
04:07 MTecknology jsmith0012: like I said... you're trying to optimize something you don't understand for reasons that don't exist. Good luck.
04:07 hemebond MTecknology: Which runner do you use? manage.up?
04:08 MTecknology typically I only care about what's down, but ya
04:11 lkthomas hemebond, how does a file hash before it could download and verify ?!
04:11 hemebond jsmith0012: What is your overall goal?
04:11 hemebond jsmith0012: What is the reason you're looking at connections?
04:11 hemebond lkthomas: Sorry, I meant a hash argument on the state.
04:11 hemebond If it supports it.
04:11 hemebond pkg.installed might not.
04:11 lkthomas sorry, I don't get it
04:12 hemebond Okay, state functions like file.managed can take a hash which will (should) prevent them downloading files every time when the source is, e.g., http://google.com/blah.txt
04:12 hemebond So Salt checks the local cached file hash against what you've written in the state.
04:13 hemebond If they're different it will download the file again.
04:13 hemebond So if you want to prevent Salt downloading the file every highstate, you either need to specify the hash (if the state function supports it) or work around it by using other state functions to download the file yourself.
04:13 MTecknology better yet... don't use pkg.installed w/ remote URL's and instead suck them into a local repo! :D
04:14 lkthomas MTecknology, well... that is possible, but I am worrying open up another can of worms :P
04:15 MTecknology depends, but it sounds like you've been taking the hard approach to many things (just from watching you in here)
04:15 lkthomas MTecknology, KISS :P
04:15 lkthomas well, trying hard first, then move to simple way
04:15 MTecknology KISS => no formulas!
04:15 hemebond MTecknology: Don't you go bad-mouthing formulas.
04:16 lkthomas MTecknology, yeah, my pull request got rejected within my company because I have been using formula, shit
04:16 lkthomas on Puppet, I used to download those modules and mod it as I needed
04:16 hemebond If you put the files in Salt it handles the hashing and checking automatically.
04:17 hemebond (since the master already knows the hash)
04:17 lkthomas you mean putting it into salt-master file server ?
04:17 hemebond Yeah.
04:17 lkthomas let me think about what to do with it
04:17 hemebond Otherwise just add another simple state that downloads the file for you and keeps it locally on the minion.
04:18 lkthomas yeah
04:18 lkthomas perhaps download once first on /tmp folder
04:18 lkthomas at least it wouldn't download again for a while
04:18 MTecknology long as it's not tmpfs
04:18 lkthomas it's real hdd
04:18 lkthomas so not worrying the memory will blow up
04:19 lompik joined #salt
04:20 exarkun joined #salt
04:20 MTecknology uhm... that's not at all what I meant
04:21 lkthomas hmm ?
04:21 MTecknology I don't think tmpfs lets you create infinitely growing mounts, does it?
04:21 hemebond Probably doesn't get restarted often.
04:21 hemebond So the file will survive a few reboots.
04:21 hemebond er
04:21 hemebond a few highstates
04:21 lkthomas yeah that's kind of the point of it
04:22 lkthomas MTecknology, I forgot in exact, haha
04:22 MTecknology it'll still be needlessly re-downloaded at every restart if it's tmpfs.
04:25 hemebond Oh, you could put your own "unless" requisite on the pkg.installed.
04:26 lkthomas MTecknology, shit, tmp file wouldn't work, system reboot every week, blah
04:26 MTecknology it's almost as if I've seen things!!
04:26 hemebond teeeerrible thiiiiiings
04:27 lkthomas LOL
04:27 MTecknology well... I /have/ seen the inside of my rectum.
04:27 hemebond LOL
04:30 MTecknology It's the end of valentine's day and this was relatively funny, gotta share- http://www.cracked.com/blog/the-sad-reality-christian-pick-up-artist/
04:31 hemebond That's an amazing opening-sentence :-D
04:31 hemebond *paragraph
04:33 masber joined #salt
04:40 pipps joined #salt
04:42 hemebond jsmith0012: How are you going?
04:43 MTecknology we've been chatting via pm
04:44 MTecknology basically- I still know what you know
04:44 K0HAX joined #salt
04:44 pipps99 joined #salt
04:46 hemebond Ah
04:48 pipps joined #salt
04:53 pipps99 joined #salt
05:01 pipps joined #salt
05:05 pipps99 joined #salt
05:15 pipps joined #salt
05:51 xcrot joined #salt
06:00 exarkun joined #salt
06:06 xcrot left #salt
06:16 pualj joined #salt
06:32 ahrs joined #salt
06:43 LocaMocha joined #salt
06:50 raptelan joined #salt
06:51 LocaMocha joined #salt
06:56 zulutango joined #salt
06:56 hoonetorg joined #salt
07:03 onslack1 joined #salt
07:23 sayyid9000 joined #salt
07:39 exarkun joined #salt
08:06 raptelan joined #salt
08:08 Tucky joined #salt
08:12 aldevar joined #salt
08:15 Hybrid joined #salt
08:19 aviau joined #salt
08:19 taylorbyte i know this is not an official salt formula: https://github.com/salt-formulas/salt-formula-docker but i can't find any help. The readme seems to lack detail, I cant figure out which pillar examples i need to get docker to work. ive tried docker-formula and salt-formula-docker and this one, the first 2 have some kind of error either jinja or just not working. ive droped them and this one seems more advanced with swarm and would like t
08:19 taylorbyte it out but the documentation is poor. can someone make heads or tails with this formula ^^ ?
08:24 hemebond taylorbyte: I don't understand the question.
08:24 hemebond You want a Docker swarm using that formula?
08:25 hemebond Or are you just trying to run a container?
08:27 taylorbyte i am trying to setup a gitlab docker container via saltstack, none of the formulas work for me they have problems, i forget what they were as iv uninstalled them each time and moved on to a new formula, now i am trying the one i linked above and it looks promising with new features of swarm and would like to try it out but the readme is just a bunch of pillar stuff with no explainations on how they relate to each other or what it doe
08:28 taylorbyte and i just need someone to point me in the right direction, maybe look at the guts of the formula, i can't follow it, ive made a docker compose before without salt so i sort of know the basics but i can't adapt what i know of docker to this formula. i found https://dev.to/livioribeiro/deploying-gitlab-on-docker-swarm-1fb1 might have some info on how to do a gitlab swarm
08:28 hemebond The pillar examples are for different things.
08:29 hemebond If you're just trying to run a Docker container you probably want the Docker Client example.
08:29 taylorbyte do i always need a host?
08:29 hemebond I would assume Docker Host is the main Docker daemon.
08:30 hemebond So if you were running the Docker daemon (and not using some dedicated Docker runner thingy) then yeah I would assume you need the host pillar too.
08:31 hemebond I'm not that familiar with Docker (thankfully) so I'm not too familiar with the terms used in that formula.
08:32 taylorbyte yeah same, i know docker compose, this swarm thing is new to me, stack i think is just a yaml file i think
08:33 taylorbyte ok so i thought id try do this with a swarm but only on 1 machine, and then once i know how to do that maybe i can scale it some otherday
08:42 swa_work joined #salt
08:44 inad922 joined #salt
08:52 losh joined #salt
09:03 pbandark joined #salt
09:07 mikecmpbll joined #salt
09:19 exarkun joined #salt
09:28 Mattch joined #salt
09:32 saltnoob58 joined #salt
09:42 saltnoob58 hello
09:42 hemebond Hello.
09:42 saltnoob58 i seem to be unable to find the correct documentation myself, can someone direct me how to confgure salt-ssh minions?
09:43 saltnoob58 so i can do fancy stuff like this https://groups.google.com/forum/#!topic/salt-users/0D0fUjmFxAU https://github.com/bigg01/salt-sudo-wrapper/tree/master/module
09:43 saltnoob58 but for the thin minions inside the tmp of ssh-connected targets
09:43 BarBQ joined #salt
09:44 hemebond uh
09:45 saltnoob58 exactly
09:45 hemebond I mean...
09:45 hemebond Neither of those seem to be Saltstack things.
09:45 hemebond Like... they're people hacking Salt to do something crazy.
09:46 hemebond Can you clarify what documentation you're after?
09:46 pualj joined #salt
09:46 saltnoob58 well, they're still hacking saltstack, and the crazy things are quite reasonable that many people, me including, seem to need. I'm trying to find out where i would hack crazy things in case of salt-ssh
09:47 hemebond Uh. In the source.
09:47 saltnoob58 where the salt minion config is that would get copied into the thin minion, where i can write crazy wrappers like these people did
09:47 hemebond Clone the github repo and go nuts.
09:47 saltnoob58 so salt-ssh does not have a convenient way to configure the minion like regular salt?
09:47 saltnoob58 aww :(
09:47 hemebond What do you mean?
09:48 hemebond Neither of these things are "configure the minion".
09:48 hemebond I don't understand.
09:48 saltnoob58 I've solved this by adding a parameter to my minion configuration:  cmd.wrapper: /var/lib/salt/wrapper/maybesudo
09:48 saltnoob58 is what the first guy writes
09:49 saltnoob58 as i understand part of the crazy things is writing somethign to the minion configuration
09:50 hemebond Well, is writing to the "minion config" just writing the config files?
09:50 GrisKo joined #salt
09:51 hemebond Are you talking about "/etc/salt/minion.d/sudo.conf"? That's just a file...
09:51 saltnoob58 well for a regular minion, i would write things in /etc/salt/minion and /etc/salt/minion/* , but what about salt-ssh minions?
09:52 hemebond It's the same as far as I know.
09:52 hemebond Lemme have a search
09:53 hemebond Do you have salt-ssh setup and configured and tested?
09:54 saltnoob58 in a way i have salt-ssh running commands on some targets in a roster file, though the roster will be changed to something dynamic so it probably wont be a good spot to configure some default conf that applies to all minions
10:14 florian3 joined #salt
10:16 florian__ joined #salt
10:17 florian__ left #salt
10:17 Waples_ joined #salt
10:17 Waples_ Hello
10:18 Waples_ Hello, it's me florianb
10:19 Waples_ saltnoob58: https://docs.saltstack.com/en/latest/topics/ssh/#minion-config
10:19 Freeaqingme joined #salt
10:21 saltnoob58 thanks
10:26 Waples_ joined #salt
10:26 Waples_ saltnoob58: some peeps on the SaltStack Community Slack were commenting on you, but IRC chat cannot see messages from there ;)
10:27 Waples_ app integration and stuffs
10:29 msmith joined #salt
10:36 saltnoob58 oh no i made a new community mad at me :o
10:37 zerocoolback joined #salt
10:38 msmith not mad. not commenting "on" you, merely commenting by way of suggesting that help link. which didn't work from slack because the bridge is down
10:40 saltnoob58 oh my. Lets hope that bridge gets unburned
10:40 saltnoob58 so the bridge was working only one way?
10:41 msmith it'll be a few hours before it gets restarted
10:41 msmith exactly
10:42 msmith it was easy enough to login to freenode via webchat so i jumped over
10:43 Waples_ well, if yer on linux, just install weechat ^^
10:44 msmith nope, windows desktop
10:45 inad922 joined #salt
10:46 saltnoob58 just install ubuntu for windows and realize that it's horrible and doesnt work
10:51 jrenner joined #salt
10:54 mattfoxxx joined #salt
10:59 exarkun joined #salt
11:02 Cadmus It's okay, it's not a linux system, but it does give you some of your tools. I switched to Bash on Ubuntu on Windows on Hearty Italian from cygwin and overall I'd say it's a little better.
11:15 saltnoob58 i just wanted a screen on my own computer because we arent allowed to keep screens or anything on the hopper, but because workstations get only allowed software i still get the beta ubuntu for windows where half the stuff doesnt work, screen doesnt pass ssh keys or TERM
11:15 saltnoob58 and the terrible terrible scrollback
11:22 mikecmpb_ joined #salt
11:29 mianosm is there no .screenrc that gets sourced at time of execution?
11:46 saltnoob58 i tried hacking it according some guides on google but it needs more hacking than i bothered in the end, and definitely more than a screen on a real linux system
11:47 saltnoob58 even basic things seem to have problems in the windows linux
12:01 mikecmpbll joined #salt
12:05 mikecmpbll joined #salt
12:14 inad922 joined #salt
12:26 saltnoob58 is it possible to give to salt-ssh roster=scan several networks/netmasks, not just one?
12:29 ghovat joined #salt
12:39 exarkun joined #salt
13:26 armin joined #salt
13:27 armin hi, is it possible to run salt-ssh as a non-root user (on the master)?
13:29 rockey yes, look at saltfile and its structures
13:30 saltnoob58 salt-ssh questions are multiplying
13:31 rockey mm
13:31 Nahual joined #salt
13:36 dev_tea joined #salt
13:40 dev_tea joined #salt
13:48 armin https://paste.fedoraproject.org/paste/IQkJ6Bs-D9drLpDS0zIpXw
13:48 armin any help?
13:52 saltnoob58 are you trying to salt-ssh connect with ssh keys? are you using the default ones in /etc/salt/pki with root ownership? would setting custom keys in a directory where your user has permission to read-write help?
13:53 armin saltnoob58: yes. no, i don't, because i already have ssh public key authentication configured for my hosts in ~/.ssh/ . well i could try with a copy of my ~/.ssh/ folder for the keys that are used to authenticate.
13:54 armin oh, when doing that i get a nice traceback telling me about a permission denied on /var/cache/salt/master
13:54 Rumbles joined #salt
13:55 XenophonF joined #salt
13:58 armin https://github.com/saltstack/salt/issues/9474
13:58 armin ouch.
14:18 racooper joined #salt
14:20 exarkun joined #salt
14:32 gh34 joined #salt
14:33 DammitJim joined #salt
14:33 deuscapturus joined #salt
14:38 saltnoob58 should i make a feature request that the scan roster should take a list of networks? i've never done any github contributing before
14:40 oida joined #salt
14:42 rockey armin: you need a "Saltfile" specifying where it should get diviated default values for running salt-ssh, which by default requires root
14:42 XenophonF joined #salt
14:48 gmoro joined #salt
14:49 pualj joined #salt
14:51 raptelan joined #salt
14:55 Nahual Can one load the core grains from a custom grain? If I utilize the example in https://docs.saltstack.com/en/latest/ref/clients/#salt.loader.grains as some posts have suggested, when the salt-minion loads it just continuously loops getting the configuration information.
14:56 saltnoob58 Why wouldn't one be able to?
14:56 onslack joined #salt
14:56 Nahual Because I am ending up in an infinite loop.
14:56 doubletwist joined #salt
15:00 saltnoob58 do you mean your custom grain calls all possible grains, which include your custom grain, and that again calls all possible grains? that kind of loop?
15:07 Nahual saltnoob58: That'd be a fair assessment. What ends up happening is the configuration just continuously loads as you need to setup __opts__ prior to loading the grains and it just reaches a maximum recursion. That is why I was curious if what I am even attempting to do is possible or if I should just re-implement the functions locally, I just need virtual and manufacturer.
15:09 mpanetta joined #salt
15:16 saltnoob58 well i failed to even get stuck in a loop in the short time i tried testing, so it's more complicated than it seems. Sorry I couldn't help. Hopefully someone smarter will know if it's possible at all, but considering it's possible to use grains in other python code, my assumption was that same should apply to grains
15:17 Nahual Yup, I have a workaround for now but just want to clean it up.'
15:17 Nahual If the call is initiated from outside of the grains infrastructure, the script works fine. It's only when it is being loaded as a grain do you hit the loop.
15:20 cgiroua joined #salt
15:23 pualj joined #salt
15:31 schemanic joined #salt
15:31 onslack <gtmanfred> you could use the loader to load the grains functions, and then run the specific function that you need, but you cannot use salt.loader.grains inside of a custom grain, because like you have experienced, it will end up in an infinite loop
15:34 Nahual gtmanfred: If I loaded the grains functions with loader, I was getting empty string returns, I can revisit debugging that though.
15:44 snakegums joined #salt
15:44 teclator joined #salt
15:48 Naresh joined #salt
15:49 cro joined #salt
15:51 teclator left #salt
15:51 DammitJim joined #salt
15:52 tiwula joined #salt
16:00 exarkun joined #salt
16:04 inad922 joined #salt
16:06 oida joined #salt
16:10 pualj joined #salt
16:53 DammitJim joined #salt
16:56 aldevar left #salt
17:06 stash joined #salt
17:18 pualj_ joined #salt
17:18 raptelan whytewolf: are you around?
17:20 K0HAX joined #salt
17:40 exarkun joined #salt
17:43 swa_work joined #salt
17:46 snakegums joined #salt
17:49 swa_work joined #salt
17:54 raptelan I have a machine with 1024MB of memory, but grains['mem_total'] = 992 - why is this?
17:59 onslack <mts-salt> what does the os say is total memory?
18:03 raptelan mts-salt: 1024MB
18:03 raptelan oops, free -m does show 992, I wonder why...
18:03 onslack <mts-salt> perhaps because something is reserving the other 32mb. maybe dedicated graphics
18:04 raptelan nah, it's a virtualbox VM.
18:04 raptelan it has a video memory setting, but I think that uses separate allocation, and it's set to 8MB besides
18:04 raptelan 1024 - 992 = 32, not 8
18:05 onslack <mts-salt> i said /maybe/ graphics. obviously something is
18:05 raptelan I checked a VMWare VM with 4096MB, and it shows 3951.
18:06 raptelan oh well...
18:08 motherfsck joined #salt
18:09 motherfsck Does anyone here have a working Dockerfile for salt-minions and centos 6.X?
18:09 motherfsck The salstack one in docker hub errors out
18:12 stash__ joined #salt
18:20 kukacz_ joined #salt
18:46 _JZ_ joined #salt
18:51 raptelan {{ (grains['mem_total'] * 0.001) | int }} is resulting in 0 when mem_total is 992.  How can I instead make it round up the 0.992 to 1?
18:52 MTecknology is there a round fister?
18:52 MTecknology filter*
18:53 raptelan how would I find out?
18:54 MTecknology look it up in the manual?
18:55 raptelan where?
18:55 raptelan if I know where to look I wouldn't be asking here
18:57 babilen http://jinja.pocoo.org/docs/dev/templates/
18:57 MTecknology there's also this- http://lmgtfy.com/?q=jinja+filters
18:58 raptelan ah, so it's something in jinja docs not saltstate
18:58 raptelan I searched for saltstate round filters and my search engine said "including results for above ground pools", LOL
19:01 oida joined #salt
19:01 raptelan well, I see round in the docs, but I end up getting Unable to manage file: Jinja variable 'round' is undefined
19:01 raptelan with {{ round(grains['mem_total'] * 0.001) }}
19:02 ymasson joined #salt
19:03 raptelan well, the docs say round (value, precision=0, method='common'), but it turns out I needed to do value | round
19:04 raptelan and |int after that otherwise it gets .0
19:16 babilen It would be |round(...)
19:17 stash__ left #salt
19:19 stash__ joined #salt
19:20 stash__ left #salt
19:20 stash__ joined #salt
19:21 stash__ left #salt
19:21 stash joined #salt
19:21 MTecknology kinda the exact same as you were already doing... just with a different filter
19:24 stash left #salt
19:30 rburkholder joined #salt
19:32 aldevar joined #salt
19:39 raptelan why does it say the first argument in parentheses should be "value" then?
19:39 raptelan I can make it work fine, just don't understand why it doesn't work in the format the docs show it
19:40 raptelan looking at the examples I see that all the examples do value|func(other, params)
19:47 Edgan raptelan: This isn't python it is jinja. Jinja uses filters, so |filter.
19:47 Edgan raptelan: The fun one in salt jinja is methods work like in python. Which is super powerful.
19:52 scooby2 Is publisher_acl the proper way to limit what hosts a user can push to? Where does publisher_acl get set?
19:53 Edgan raptelan: {{ grain.host_id|int }} is a filter, and like int(). {{ details.get('fullname') }} uses the get method, and will fill in whatevery details.fullname is. The advantage of .get over {{ details.fullname }} is .get allows an empty value if details.fullname doesn't exist.
19:54 emerson joined #salt
19:57 Edgan raptelan: {% set domain_list = domain_text.split(".") %} and {% set root_domain = ".".join(domain_list[3:]) %}  are some more common python method uses in jinja
19:57 DammitJim joined #salt
19:58 babilen You can also use the |split() and |join() filter though
19:58 babilen Jinja is some weird chimera that allows you to use a certain subset of Python, doesn't have access to literal Python blocks or the standard library and does most things via "filters"
19:58 Edgan raptelan: It is also good to know that the methods exist, because you might do something like foo.join.filename and not get the result you expect.
19:59 babilen It's now quite easy to define custom filters in salt, but the is severly undocumented, so I doubt many people use it
19:59 Edgan babilen: I would over to see an example. :)
20:01 tiwula joined #salt
20:03 stash__ joined #salt
20:11 babilen Edgan: https://github.com/saltstack/salt/pull/37952
20:12 babilen https://github.com/saltstack/salt/blob/develop/salt/utils/jinja.py#L201-L575 (for example)
20:13 babilen https://docs.saltstack.com/en/latest/topics/jinja/index.html#filters
20:17 zulutango joined #salt
20:20 aviau joined #salt
20:27 jrj joined #salt
20:27 wongster80 joined #salt
20:39 doubletwist so i have a list of something in pillar [virus definitions] in init.sls that gets applied to all hosts. I want to add more items to that list [say in dbservers.sls]
20:40 doubletwist Currently the list in dbservers.sls is over-riding the common list completely. How can I make it add to the list instead?
20:41 inad922 joined #salt
20:41 rewbycraft joined #salt
20:44 raptelan I have a config file with some jinja in it, thus several lines in {% %} blocks.  They all become empty lines in the final file.  How can I make those lines not appear instead?
20:45 doubletwist raptelan: {%-
20:45 raptelan does each line need it's own {%?
20:45 raptelan or can I put several lines in one block?
20:46 doubletwist I think you can put as many lines as you like in a block.
20:49 raptelan it didn't seem to work
20:49 raptelan does this look valid?  http://dpaste.com/39JSXVH
20:49 raptelan it worked with each line encased in the characters
20:49 raptelan oops, I see the mistoke
20:50 doubletwist Oh no I don't think that will work
20:50 raptelan now I get a new error
20:50 raptelan unexpected token 'end of statement block', got 'cluster_name'
20:50 doubletwist each jinja line does need to be in its own {%- %} block
20:50 raptelan I took out the extra %}
20:50 raptelan darn, that's super annoying
20:51 MTecknology jinja is not python!
20:52 raptelan I don't know python anyways
20:52 MTecknology doesn't really matter- point remains the same, don't try to treat jinja like it's a programming language.
20:52 MTecknology It's templating
20:53 raptelan I'm just trying to make the lines more readable by removing the repetitive prefix and suffix characters.
20:53 raptelan I didn't change any language, it was already there and working
20:53 MTecknology ...
20:54 raptelan I asked if it was possible is all
20:54 * MTecknology doubletwists and grabs a booze
20:57 hemebond https://cryptic-cliffs-32040.herokuapp.com/
20:57 doubletwist ok https://paste.fedoraproject.org/paste/LdXUtzhN4BQdY-ef0GkKKw
20:57 doubletwist it doesn't work - I sort of know why but I don't know how to get it to do what I want.
20:58 doubletwist which is ADD the clamav.ignoredefs from odb.sls to the clamav.ignoredefs in init.sls instead of overwriting it
20:59 hemebond You can't.
20:59 hemebond When Salt merges pillars lists are replaced, never merged.
20:59 hemebond Only dicts are merged.
21:00 raptelan how do you add a salt grain?
21:01 hemebond raptelan: It's in the main docs under grains. But two ways are pillars and local config.
21:01 raptelan I'm trying to learn salt with a local VM cluster.  But in our actual salt environment at my work, each VM has a grain present that my local ones do not.
21:01 raptelan not sure where it comes from
21:01 hemebond What is the grain?
21:01 raptelan "environment"
21:02 hemebond I don't have that grain. You would have to check the config.
21:02 doubletwist hemebond: so then what's the best [and simplest] way to accomplish what I need? A list of common items to be ignored, and then the ability to add app-specific items to be ignored?
21:02 raptelan where would that config be?
21:04 raptelan ahh I found it, in /etc/salt/grains
21:04 raptelan but how does that file get there I wonder
21:04 Hybrid joined #salt
21:04 hemebond doubletwist: How extensible do you need it to be?
21:04 hemebond raptelan: They put it there.
21:04 raptelan manually on every machine?
21:04 hemebond Probably.
21:04 raptelan or via some saltstate more likely I guess?
21:04 doubletwist Not hugely I think. Right now the only exception to the common list is the odb servers
21:04 raptelan there are thousands of machines
21:04 hemebond Probably as part of the provisioning.
21:04 raptelan ok, so something outside of salt anyways
21:05 raptelan then for my local work, I'll just make the same thing manually
21:05 raptelan thanks
21:05 doubletwist But that will probably change.
21:05 hemebond doubletwist: load_yaml, yank out the list, print it again and add the extras.
21:06 doubletwist I suppose I could just say 'screw it' and only have a single ignore list that applies to all.
21:06 hemebond raptelan: It
21:06 hemebond is just a guess. They might also use a state or pillar to set it, but that would be silly because then it wouldn
21:06 hemebond wouldn't be there immediately.
21:06 hemebond Also, setting an "environment" grain seems silly to me.
21:07 raptelan why so?
21:07 raptelan it could be parsed from the hostname as well
21:07 hemebond But maybe they have no other way to identify the machine.
21:07 raptelan well, the first letter of the hostname
21:07 hemebond The first letter of the hostname indicates the environment?
21:07 raptelan yes
21:07 hemebond Then they could have just used that.
21:08 raptelan seems cleaner to me, but maybe there are some exceptions.  My local minions are named minion1 and minion2 anyways :P
21:10 raptelan hemebond: I'm still getting the error after creating the grains file...
21:10 raptelan Unable to manage file: Jinja variable 'dict object' has no attribute 'environment'
21:11 hemebond raptelan: How did you create it?
21:11 raptelan root@minion1:~# cat /etc/salt/grains
21:11 raptelan environment: dev
21:11 hemebond Did you restart the minion?
21:11 raptelan ahh, nope
21:12 hemebond You might _also_ need to call saltutil.sync_grains
21:13 raptelan restart did it
21:15 Pomidora My remote execution is insanely slow all of the sudden...
21:16 Pomidora I killed all the jobs on the minons, cleared the job cache on all of them, restarted the salt-minion process
21:16 Pomidora restarted salt-master on the master
21:16 Pomidora no idea ...
21:16 hemebond Pomidora: Are the states themselves taking a long time?
21:16 hemebond Is salt-call fast?
21:16 hemebond Or is it just any command?
21:18 DammitJim joined #salt
21:22 Hybrid joined #salt
21:23 Pomidora hemebond: I figured it out, all my minions have <1 loadavg, my master is ~30
21:24 pualj joined #salt
21:26 hemebond Ah
21:26 hemebond OH!
21:54 pipps joined #salt
21:55 pipps joined #salt
21:59 jeffspeff joined #salt
22:02 pipps99 joined #salt
22:04 pipps joined #salt
22:13 tiwula joined #salt
22:38 pipps99 joined #salt
22:41 pipps joined #salt
22:56 stash__ joined #salt
23:31 stash__ joined #salt
23:42 rstewartatlarge joined #salt
23:49 pipps joined #salt

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