Perl 6 - the future is here, just unevenly distributed

IRC log for #salt, 2016-05-18

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

All times shown according to UTC.

Time Nick Message
00:00 ssplatt joined #salt
00:07 estahn joined #salt
00:08 estahn Is there a particular reason why the scheduled job wouldnt be deleted when calling schedule.delete?
00:10 cilkay Hello. I'd like to get the output of a shell script "foo" and put it into a variable "bar" in a masterless minion in a state file. {% set bar = salt['cmd.run']('/path/too/foo') %} returns 'salt.loader.LazyLoader object' has no attribute 'cmd.run ' Any ideas how I can do this?
00:10 cilkay I'll use {{ bar }} later on the state file.
00:11 iggy did you look through the issue tracker already?
00:11 tracphil joined #salt
00:11 iggy There are known masterless issues (some have fixes pending, etc)
00:11 cilkay https://github.com/saltstack/salt/issues/9032 <== That's about a year old.
00:11 saltstackbot [#9032]title: running cmd.script removes source file in file_roots of standalone windows minion  (v17.2) | I tried this is my state file:...
00:22 kus joined #salt
00:25 iggy cilkay: also, are you using the latest version?
00:28 dendazen joined #salt
00:30 kus joined #salt
00:33 Nahual joined #salt
00:49 cilkay iggy: 2015.5.3, which is the default on Debian stable. I'll add the SaltStack.com repos and upgrade.
00:52 zzzirk joined #salt
00:55 estahn for some reason i cant get the schedule on a minion deleted. i deactivated it but it doesnt go away
00:55 estahn any ideas why?
00:59 berserk joined #salt
01:01 ssplatt joined #salt
01:02 estahn "Deleted Job {0} from schedule. Minions may need a refreshed pillar. Run saltutil.refresh_pillar."
01:02 estahn found it... very annoying
01:09 ashmckenzie joined #salt
01:11 ssplatt joined #salt
01:14 cilkay It seems that 2015.5.3 is the latest packaged for Debian Jessie on the SaltStack.com repo.
01:15 anotherZero joined #salt
01:15 cilkay I'll have to use the jessie-backports repo, apparently.
01:17 ssplatt joined #salt
01:17 anotherZero Hey guys, I'm trying to refactor my salt states to make things more manageable, but I'm having a little problem.  I'm using a modified version of the users formula to iterate over a users pillar.  I can't quite figure out how to make differing lists of users based on server roles
01:19 anotherZero previously the users state was simply looping through all the users in the users pillar and I had some big IF structures in there to prevent some users from being defined under certain circumstances... that seems incorrect
01:19 ws2k3 joined #salt
01:21 iceyao joined #salt
01:22 ssplatt joined #salt
01:23 anotherZero I think I finally found the answer.  Explaining it to an empty room gave me inspiration for some new search keywords :)  https://clinta.github.io/Salt-User-Management/
01:23 cilkay iggy: Updating to 2015.8.8 made no difference.
01:23 kevinquinnyo if it makes you feel any better i was listning
01:23 cilkay quack
01:23 kevinquinnyo i just havent used the forumula so i couldnt help
01:24 iceyao_ joined #salt
01:29 catpigger joined #salt
01:30 anotherZero kevinquinnyo: Wasn't complaining :) I realize it could sound that way, but I was simply noting what happened
01:31 anotherZero kinda like when you can't figure out a bug in the code, then you show another developer and it becomes so apparent, because you're explaing it to someone else
01:31 kevinquinnyo happens to me literally every single day
01:33 estahn_ joined #salt
01:33 estahn_ sorry disconnected
01:34 estahn_ is it possible to schedule remote executions?
01:36 anotherZero kevinquinnyo: is there a good way to store specific information to be used for a single minion?  like a /srv/pillars/servers.sls with something like "server-X": address: 34.32.23.43  ?
01:36 estahn_ anotherZero: put that into grains
01:36 iceyao joined #salt
01:36 estahn_ anotherZero: /etc/salt/grains
01:36 anotherZero ::mind_blown::
01:37 kevinquinnyo well if it's an ip address
01:37 kevinquinnyo it's already in grains
01:37 kevinquinnyo if you need to expose a grain from one minion to another (or more minions) the saltmine is made for that
01:37 anotherZero yeah yeah yeah... but that was an uber general example.  I need to store info like slave address, firewall exceptions etc
01:38 kevinquinnyo then yes, grains
01:38 Adam__ joined #salt
01:38 anotherZero thanks all
01:39 cilkay anotherZero: The phenomenon you described above is called "rubber duck programming", hence my quack above. https://en.wikipedia.org/wiki/Rubber_duck_debugging
01:39 saltstackbot [WIKIPEDIA] Rubber duck debugging | "Rubber duck debugging is an informal term used in software engineering for a method of debugging code. The name is a reference to a story in the book The Pragmatic Programmer in which a programmer would carry around a rubber duck and debug their code by forcing themselves to explain it, line-by-line..."
01:39 anotherZero so, that's not centrally managed?
01:39 anotherZero grains, that is
01:39 kevinquinnyo grains exist on the minion
01:39 skeezix-hf joined #salt
01:39 estahn_ anotherZero Pillars are centrally managed, grains on the minion
01:40 anotherZero ah, but I see that I can get/set from the master, correct?
01:40 estahn_ yes
01:41 jerredbell joined #salt
01:41 rojem joined #salt
01:41 ssplatt joined #salt
01:41 iceyao_ joined #salt
01:41 anotherZero would it be super weird to come up with a pillar that matched by minion IP so I could centrally manage, and easily re-create the grain info in case of server loss?
01:42 johnkeates joined #salt
01:46 anotherZero er.. may as well match by minion-id, but still
01:46 estahn_ ok, so i'm still trying to solve my cronjob dilemma in that a job can run only on a single minion across a group of nodes. i tried to run in cron "salt * --subset=1 cmd.run" which doesn't work fully because it cant execute multiple cmd.runs at the same time. now i was thinking of using reactor with events somehow. would that make sense?
01:46 rojem joined #salt
01:46 cilkay estahn_: I'm setting up a crontab for root in a masterless minion by using file.managed to copy the file which I then use cmd.run to install. That could work for you, too.
01:48 ilbot3 joined #salt
01:48 Topic for #salt is now Welcome to #salt! | Latest Versions: 2015.5.10, 2015.8.8, 2016.3.0rc3 | Support: https://www.saltstack.com/support/ | Logs: http://irclog.perlgeek.de/salt/ | Paste: https://gist.github.com/ (please don't multiline paste into channel) | See also: #salt-devel, #salt-offtopic | Ask with patience as we are volunteers and may not have immediate answers
01:51 cilkay Have that state be applied only for that role.
01:52 estahn_ but the role has 100 nodes
01:52 cilkay Oh, you'd need to be able to isolate that particular node somehow.
01:52 cilkay Hostname perhaps?
01:54 estahn_ no, thats not scalable. i dont want to manage any hostnames or single nodes. i just want to say "here this is a group of nodes, run job X on one of them"
01:54 estahn_ but i think i got it now
01:55 k_sze[work] joined #salt
01:55 estahn_ or not :) ... i thought --async helps
01:56 estahn_ i tried something like this /usr/bin/salt --async -G 'roles:app_foobar' --subset=1 state.sls $1 saltenv={{ saltenv }}
01:56 mapu joined #salt
01:56 estahn_ still getting "The function "state.sls" is running as PID 751 and was started at"
01:57 mpanetta_ joined #salt
02:02 rihannon joined #salt
02:08 estahn_ how can i pass arguments on the cli?
02:08 estahn_ salt * cmd.run 'whoami' user=www-data
02:08 estahn_ doesnt work
02:09 fracklen joined #salt
02:10 cilkay salt-call --local cmd.run 'ls -l /etc' works for me
02:10 cilkay You can substitute salt * for salt-call --local
02:11 estahn_ cilkay i want to execute it as a certain user
02:11 cilkay You mean the cmd.run?
02:11 estahn_ yes
02:12 estahn_ if i do cmd.run whoami / fofofo www-data
02:12 estahn_ it works ... but i would like to specify the argument with name=value to make it more obvious
02:13 estahn_ otherwise it looks like hocus pocus
02:13 cilkay salt-call --local cmd.run 'su -l -c whoami cds'
02:14 cilkay that will return "cds"
02:14 cilkay salt-call --local cmd.run 'whoami' <== returns root
02:15 estahn_ you can do  salt-call --local cmd.run 'whoami' runas=www-data ... but i thought you can use the cmd.run parameters
02:17 estahn_ never mind ... rtfm i guess, look in the wrong spot https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.cmdmod.html#salt.modules.cmdmod.run
02:19 anotherZero anybody know if there's a good way I could have a state.sls reference a config file ie. salt://configs/{{ minion_id }}.conf  or have pillars named by minion_id that I could dynamically pull from?
02:19 anotherZero I'm basically trying to find a way to store all my grain data on the master and set the grains from there
02:20 johnkeates left #salt
02:27 RandyT joined #salt
02:29 anotherZero joined #salt
02:29 anotherZero whoops
02:29 berserk joined #salt
02:32 nmadhok joined #salt
02:34 pipps joined #salt
02:35 quasiben joined #salt
02:37 nmadhok joined #salt
02:39 ajw0100 joined #salt
02:39 writtenoff joined #salt
02:49 ssplatt joined #salt
02:54 racooper joined #salt
02:59 tristianc joined #salt
03:00 pipps joined #salt
03:12 Vishvendra joined #salt
03:22 pipps joined #salt
03:22 ramteid joined #salt
03:24 estahn_ anotherZero why would you want to store grain data on the master. you can use pillars for that.
03:25 estahn_ anotherZero but you can manage to set the grains via states.
03:25 anotherZero estahn_: example?
03:25 anotherZero I'm hacking my way through right now, but I'm not sure I'm doing a good thing...
03:27 dfinn joined #salt
03:27 estahn_ https://docs.saltstack.com/en/latest/topics/targeting/grains.html#precedence
03:27 estahn_ for managing a certain line in the grain file you can use salt.states.file.line i think
03:27 estahn_ https://docs.saltstack.com/en/latest/ref/states/all/salt.states.file.html#salt.states.file.line
03:30 anotherZero thanks
03:30 anotherZero good night!
03:31 dfinn1 joined #salt
03:32 estahn_ not that late here yet :)
03:49 mpp joined #salt
03:53 onlyanegg joined #salt
03:57 zzzirk joined #salt
03:59 ageorgop joined #salt
04:02 Ayo joined #salt
04:16 Sylvain31 joined #salt
04:19 justanotheruser joined #salt
04:31 saltstackbot joined #salt
04:38 GreatSnoopy joined #salt
04:41 hasues joined #salt
04:44 hasues left #salt
04:45 gtmanfred joined #salt
04:45 lazybear joined #salt
04:53 macheck joined #salt
04:57 cilkay It turned out to be quite easy to set a variable to be the results of a cmd.run. I did: {% set secret_key = salt.cmd.run('/usr/local/bin/create-django-secret-key.sh') %}
04:57 cilkay It turned out to be quite easy to set a variable to be the result of a cmd.run. I did: {% set secret_key = salt.cmd.run('/usr/local/bin/create-django-secret-key.sh') %}
04:58 cilkay I then use file.blockreplace to replace the entire SECRET_KEY line in local_settings.py
05:01 Sylvain31 hi, what is the recommanded way to remove logic from sls template? jinja is not a programming language and is making logic reading difficult.
05:03 cilkay Are you talking about "if this, then something"?
05:05 macheck left #salt
05:05 Phil-Work joined #salt
05:06 macheck joined #salt
05:07 djinni`_ joined #salt
05:07 Sylvain31 cilkay: for, set, salt['pillar.get']('more:awful:stuff:%s'|format('here')) … and like yes!
05:07 rdas joined #salt
05:08 cilkay I guess I'm used to that. I don't find that hard to follow.
05:08 upb_ joined #salt
05:08 upb_ joined #salt
05:08 tmmt_ joined #salt
05:08 Hetman_ joined #salt
05:08 __alex_ joined #salt
05:08 wangofet2 joined #salt
05:08 TyrfingM1olnir joined #salt
05:08 jgelens_ joined #salt
05:08 Heartsbane_ joined #salt
05:08 cilkay You can write your state files in Python I think if you prefer that.
05:08 atmosx_alt joined #salt
05:08 mariusv_ joined #salt
05:08 Heartsbane_ joined #salt
05:08 cilkay I've read about it but never had any reason to do it.
05:08 Sylvain31 cilkay: so you're a warrior… ;)
05:09 snaggleb_ joined #salt
05:09 cilkay No, I'm a polyglot. :)
05:11 v0rtex_ joined #salt
05:11 iceyao joined #salt
05:11 stupidni` joined #salt
05:11 Sylvain31 cilkay: I feel it more than climbling Everst nude. Templating language are designed to discourage embbeded logic. It's really obvious to me, when I read all {% ‰} tags for logic. I will produce a wanted example of what Id
05:11 samed_ joined #salt
05:11 Sylvain31 I'd like to have
05:11 Sylvain31 May be I'm too new to salt, and I missed some steps…
05:11 Nebraskka_ joined #salt
05:11 jacksontj_ joined #salt
05:11 ThomasJ|d joined #salt
05:12 manfred joined #salt
05:12 cilkay https://docs.saltstack.com/en/latest/ref/renderers/all/salt.renderers.jinja.html#salt.utils.jinja.SerializerExtension
05:12 totte_ joined #salt
05:13 tehsu joined #salt
05:13 JohnnyRun joined #salt
05:13 cliluw joined #salt
05:13 SubOracle joined #salt
05:13 GreatSnoopy joined #salt
05:14 spaceSub joined #salt
05:14 StolenToast joined #salt
05:14 iceyao__ joined #salt
05:15 cilkay Sylvain31: This is a better resource: https://docs.saltstack.com/en/latest/ref/renderers/all/salt.renderers.py.html
05:15 mavhq joined #salt
05:15 cilkay A pure Python renderer so that it doesn't offend your sense of purity. :)
05:16 rojem joined #salt
05:16 monokrome joined #salt
05:16 babilen Make would also have been nice as it allows literal Python blocks for the "heavy lifting" -- Jinja was essentially designed as a templating language in which *all* logic resides in the backend, so it wasn't necessarily the best fit for salt.
05:16 impi joined #salt
05:17 babilen But there are a number of renderers you can use: https://docs.saltstack.com/en/latest/ref/renderers/
05:20 cilkay There is a Mako renderer. See: https://docs.saltstack.com/en/latest/ref/renderers/all/salt.renderers.mako.html
05:20 Sylvain31 cilkay: is not related to purity, but readability. ;)
05:21 rojem joined #salt
05:23 iceyao joined #salt
05:29 Sylvain31 cilkay: after some hours reading doc and template I'm able to basically follow and write some stuff, but I wont see a lot people I know, that would have enough courage to step into. I was just playing with formulas and they require expert level to tune… I'm gonna deliver and working salt rules for my customer, I want them to be able to manage it. For now (with my current salt knowledge) it seems difficul to
05:29 Sylvain31 explain someone how he can customize the formula, without breaking it… as babilen mentioned, jinja is a templating renderers, logic must be outside. I don't know how to accomplish that for now.
05:32 sauvin joined #salt
05:32 cilkay I don't know how feasible that would be regardless of the renderer or technology you use if your customer isn't technically adept.
05:34 iceyao_ joined #salt
05:37 onlyanegg joined #salt
05:43 viq joined #salt
05:45 felskrone joined #salt
05:55 Sylvain31 thanks for the links I'm reading and writing code. ;)
05:57 teatime Sylvain31: for formulas, the idea is generally that configuration goes into pillar data
05:57 teatime formula turns pillar data into state definitions
05:57 teatime but the whole system is very flexible... Salt endeavours to provide users' with plenty of rope :)
06:01 Sylvain31 teatime: #!py + mixin sound a good compromise. I'm learning…
06:09 duncanmv joined #salt
06:11 keimlink joined #salt
06:17 iceyao joined #salt
06:19 mschiff Hi! Is there a way to abort executing a state if some pillar data has errors (e.g. duplicate key, or syntax error)?
06:19 babilen cilkay: I know, but the de-facto standard is jinja|yaml .. Unfortunately salt didn't enforce the need to specify the renderer shebang either, so just setting a different default renderer would break lots of SLSs (namely those that rely on the default renderer being "jinja|yaml"
06:20 babilen mschiff: You could test the data and then use one of the following states https://docs.saltstack.com/en/latest/ref/states/all/salt.states.test.html maybe?
06:22 manji joined #salt
06:23 mschiff babilen: thanks, test.check_pillar: - present sounds like what I am lookign for!
06:26 iceyao_ joined #salt
06:35 mschiff babilen: I yet have to find out whether it support nested keys to test, e.g. "- 'foo:bar:baz'"
06:36 iceyao joined #salt
06:40 teatime babilen: it had never before occurred to me to specify the renderer shebang on jinja|yaml files... you just helped me discover a new personalS.O.P.
06:40 jhauser joined #salt
06:41 babilen teatime: It really is a shame that it isn't mandatory as it renders https://docs.saltstack.com/en/latest/ref/configuration/master.html#renderer pointless
06:41 Sylvain31 babilen: #!py works just fine for me, with minimal config.
06:42 babilen Sylvain31: Sure, but you couldn't set that as default renderer as it would break all those SLS files that rely on it being "jinja | yaml"
06:43 babilen Which is, in the end, not too much of a problem, but mandatory shebangs would have been good :)
06:43 Sylvain31 babilen: nope, you're right, shebang #!rules ;)
06:43 KermitTheFragger joined #salt
06:45 Sylvain31 as cilkay said, salt writer have to be polyglot. ;)
06:45 teatime babilen: fwiw, if shebang were mandatory, default-renderer config setting would be meaningless :)
06:45 kshlm joined #salt
06:46 babilen teatime: True :)
06:46 Sylvain31 teatime: it happens that some behaviors becomes meaningless ;)
06:46 babilen haha, it is pointles either way :)
06:49 evle1 joined #salt
06:51 jxm_ joined #salt
06:52 Sylvain31 is it possible to define stuff (variables, code?, etc.) in #!py for #!jinja, or to be more precise: jinja could call (import, source, what ever) a #!py that could provide some exported values dic, list, more?
06:52 iceyao_ joined #salt
06:54 keimlink joined #salt
07:01 iceyao joined #salt
07:03 babilen Sylvain31: For this you would normally write a custom filter in jinja, but you can't do that in salt at the time being. One way to achieve this would be to write a custom execution module and call that from within your jinja templates
07:05 dmaiocchi joined #salt
07:06 Elsmorian joined #salt
07:13 dmaiocchi joined #salt
07:36 Sylvain31 I've written a prototype, of syntax, not working of course. which supposes that a logic and some functions to exists outside. Some renders may provide some behaviors… The idea, describes some templates for managing mysql users (remove, create, grants, etc.) Then run the template only logic in very obvious syntax, for readability. http://paste.debian.net/686998
07:37 onlyanegg joined #salt
07:43 Vishvendra joined #salt
07:46 JohnnyRun joined #salt
07:50 losh joined #salt
07:50 duncanmv joined #salt
07:52 dgutu joined #salt
07:54 manji joined #salt
07:59 mpanetta_ joined #salt
07:59 rim-k joined #salt
08:00 lero joined #salt
08:01 Rumbles joined #salt
08:03 TheNutter joined #salt
08:04 totte_ joined #salt
08:06 impi joined #salt
08:06 TheNutter Hello
08:06 TheNutter I am working on a salt-state for PSAD, that can be found on this link here https://gist.github.com/RichardLaing/63a754ee5bd9895c9aca1ca3fbe084b4
08:07 TheNutter however when salt restarts the service for PSAD for some reason it trys to run the program in the forground, how can I fix this issue?
08:10 fracklen joined #salt
08:11 RandyT joined #salt
08:11 TyrfingMjolnir joined #salt
08:25 mage_ can I - watch: - sls: my.sls.file ?
08:25 mage_ or is it only allowed with - require ?
08:25 tuxx joined #salt
08:26 rrei joined #salt
08:27 babilen mage_: As in "watch every state in there for changes" ?
08:28 s_kunk joined #salt
08:28 babilen TheNutter: That sounds like a problem with the init script .. does a "normal" "salt 'foo' service.restart psad" work?
08:29 mage_ babilen: yep!
08:38 Miouge joined #salt
08:40 TheNutter Hi Babbilen yes that works
08:40 thehaven_ joined #salt
08:41 TheNutter babilen: Yes I can restart other services fine, psad is effected in this manner
08:41 jhujhiti_ joined #salt
08:41 robawt1 joined #salt
08:42 bbbryson joined #salt
08:43 hacks_ joined #salt
08:43 tcolvin_ joined #salt
08:43 trave_ joined #salt
08:43 wiqd_ joined #salt
08:43 supermike_ joined #salt
08:43 ramblinpeck_ joined #salt
08:44 bVector_ joined #salt
08:44 bmcorser_ joined #salt
08:44 bbhoss_ joined #salt
08:44 JamieH_ joined #salt
08:44 karlthane_ joined #salt
08:44 nahkiss_ joined #salt
08:44 jgelens joined #salt
08:44 futuredale_ joined #salt
08:44 rideh- joined #salt
08:44 opdude joined #salt
08:44 duckfez_ joined #salt
08:44 foundatron_ joined #salt
08:44 mephx_ joined #salt
08:44 rubenb__ joined #salt
08:45 lz-dylan_ joined #salt
08:45 rreboto joined #salt
08:45 wych_ joined #salt
08:45 wangofett joined #salt
08:45 rogst_ joined #salt
08:45 Yoda-BZH` joined #salt
08:45 muep_ joined #salt
08:45 rdas_ joined #salt
08:45 Micromus_ joined #salt
08:45 mattl__ joined #salt
08:45 kidneb_ joined #salt
08:45 izrail_ joined #salt
08:45 ze-_ joined #salt
08:46 esharpmajor joined #salt
08:46 workthrick joined #salt
08:46 Ludo- joined #salt
08:46 gnord_ joined #salt
08:46 WildPikachu joined #salt
08:46 codehotter joined #salt
08:46 ZombieTwiglet joined #salt
08:46 bdrung_work joined #salt
08:46 bonezed joined #salt
08:46 Qwazerty2 joined #salt
08:46 aboe joined #salt
08:46 llua joined #salt
08:46 danielcb joined #salt
08:46 izibi joined #salt
08:46 aboe joined #salt
08:46 CustosLimen joined #salt
08:46 jav joined #salt
08:46 schinken joined #salt
08:47 bryguy joined #salt
08:47 Edgan joined #salt
08:47 fl0w0lf joined #salt
08:48 seblu joined #salt
08:49 phtes joined #salt
08:49 jwon joined #salt
08:50 opdude joined #salt
08:52 alexlist joined #salt
08:53 Eugene joined #salt
08:53 fl0w0lf left #salt
08:55 Rumbles joined #salt
08:56 eliasp joined #salt
08:57 shawnbutts joined #salt
08:57 linovia joined #salt
08:58 munhitsu_ joined #salt
08:58 smakar joined #salt
08:59 serverascode joined #salt
09:00 onlyanegg joined #salt
09:04 m0nky joined #salt
09:04 antonw joined #salt
09:05 ToeSnacks joined #salt
09:05 JonGretar joined #salt
09:11 felskrone could someone with a recent salt-version run this on a minion and paste me the full output somehwere? salt-call test.arg g=01 p=1
09:12 Ssquidly joined #salt
09:12 felskrone in 2014.7.x the parser seems to turn digit-only parameters to integer, im just wondering if that is still the case in more recent versions
09:14 AndreasLutro felskrone: they are ints in 2015.8 as well
09:15 AndreasLutro g='"01"' seems to be the only way to enforce ints
09:15 felskrone AndreasLutro: could you paste me the output somewhere so i can report a bug?
09:15 AndreasLutro enforce strings, I mean
09:15 felskrone ah ok, thats good to know
09:15 AndreasLutro why not use your own output?
09:16 felskrone you're right, if the behaviour is the same, i can very well use my own, thx :-)
09:16 felskrone also thx for the hint with the single quotes, that already fixes it for me, i will still report a bug though
09:22 GreatSnoopy joined #salt
09:24 sjorge joined #salt
09:37 Qwazerty joined #salt
09:39 MadHatter42 joined #salt
09:41 aqua^c joined #salt
09:46 helpneeded joined #salt
09:47 helpneeded hi. I installed a devel version with bootstrap over the CentOS package and now I'm getting: AttributeError: 'module' object has no attribute 'BASE_THORIUM_ROOTS_DIR'
09:48 helpneeded I tried uninstalling and installing from repo but same error comes still.
09:48 helpneeded I read here (https://irclog.perlgeek.de/salt/2016-03-04) of the .pyc files removal but whitch ones?
09:54 helpneeded got it. thanks anyway :)
10:00 devster31 how can I use the file.line state to make sure a line is present in a file, and replace the original match if it isn't? something along these lines: https://bpaste.net/show/1a01b41f67c3 but that doesn't execute every time
10:00 fracklen joined #salt
10:01 impi joined #salt
10:01 Miouge joined #salt
10:01 onlyanegg joined #salt
10:04 favadi joined #salt
10:06 fracklen joined #salt
10:16 fracklen joined #salt
10:17 Rumbles hello, I've written a state that creates a symlink for each user in a list in pillar: https://paste.fedoraproject.org/367874/
10:17 Rumbles my colleague has complained that is the user listed in the pilllar isn't on the system you get 2 failures reported when applying the state
10:18 Rumbles can anyone suggest a better way to do this so I don't get the failure messages when the user isn't there, or a way to supress the fail message?
10:23 iceyao_ joined #salt
10:23 nmadhok joined #salt
10:25 teatime Rumbles: I gotta run, but look up the section that is titled like 'requisites and other global state {something}'
10:26 teatime Rumbles: I beleive one of the requisites is basically 'run after ___ applies successfully'
10:26 teatime (and otherwise skip.)
10:26 fracklen joined #salt
10:31 Rumbles thanks teatime, but wouldn't I still get a failure when the user doesn't exist on the system?
10:32 fracklen joined #salt
10:32 Miouge joined #salt
10:37 fracklen joined #salt
10:43 gmoro joined #salt
10:45 fracklen joined #salt
10:47 tcolvin joined #salt
10:48 quup joined #salt
10:50 quup Hi, did "onchanges" change between 2015.5.9 and 2015.8.8? With 2015.5.9 the state with onchanges doesn't trigger if only one requirement has changed: https://paste.fedoraproject.org/367895/63568610/
10:52 quup nevermind, found the issue on github (24703)
10:52 Yoda-BZH joined #salt
10:56 Rumbles changed the atch to an onlyif and I now only get 1 failre, because the file doesn't exist, the state that watched the file.exists now returns True...
10:57 Rumbles is there any way to supress the result of file.exists if it returns False?
10:57 Rumbles So we don't get "Failed" reported in the highstate ?
10:59 inire joined #salt
11:01 amcorreia joined #salt
11:24 punkoivan joined #salt
11:26 rdas joined #salt
11:27 quasiben joined #salt
11:29 kshlm joined #salt
11:33 Vishvendra joined #salt
11:37 impi joined #salt
11:38 mage_ are there "best practices" for - include ?
11:39 linjan joined #salt
11:41 mage_ also I have a lot of config files which are only key: value, or key="value" .. is there any real benefit to put those key: value in the pillar ?
11:41 mage_ (assuming no sensitive data)
11:43 fracklen joined #salt
11:44 babilen mage_: The benefit is that you configure your states and configuration in a single place (i.e. the pillar pertaining to that service)
11:46 mage_ mmh
11:46 mage_ when I look at https://github.com/saltstack-formulas/haproxy-formula/blob/master/haproxy/templates/haproxy.jinja I don't find this very readable
11:47 fracklen joined #salt
11:49 mage_ also, is it possible to add/remove pillar data for minions in a reactor sls ?
11:51 dgutu joined #salt
11:51 evle1 joined #salt
11:54 babilen mage_: Yes, that isn't very readable
11:55 babilen But that is an implementation detail and not required just because you keep configuration in your pillar. I like to generate configuration files using suitable Python modules
11:56 babilen That makes it easy if a generator/parser exist for that configuration file language to generate it without all that jinja madness
11:57 josuebrunel joined #salt
12:00 mpanetta_ joined #salt
12:02 babilen mage_: And you could call an execution module that tinkers with the pillar data (e.g. makes changes to /srv/pillar) and calls saltutil.refresh_pillar .. but in a way it would be better to handle this in an external pillar
12:02 onlyanegg joined #salt
12:03 babilen I mean you can do a lot of things .. write Python code and call that via reactors. The best approach really depends on what you want to achieve and why. My feeling is that "add/remove pillar data for minions in a reactor" is better addressed elsewhere (e.g. database entries when a new minion is created)
12:03 babilen But *shrug*
12:08 jad_jay joined #salt
12:08 fracklen joined #salt
12:13 fracklen joined #salt
12:13 renaissancedev joined #salt
12:15 mage_ babilen: thanks..! in fact I have a local DNS server (unbound) and a formula that generates unbound.conf A and PTR entries. I have another state file that creates jails (freebsd) on the fly, and I would like to regenerate the unbound.conf file when the jail is created and launched, with the jail ip and dns name
12:16 mage_ the idea is to let some colleagues here to create jails on the fly to launch test envs ..
12:18 mage_ I have created a custom jail/created of jail/removed event, and I'm use that one with a wheel module to automatically accept/remove key
12:18 fracklen joined #salt
12:19 mage_ but I don't see the best manner to say "hey, regenerated unbound.conf file on machine A with the new ip/dns name" .. but I'll take a look at external pillars maybe
12:19 TooLmaN joined #salt
12:23 babilen mage_: Might work similar to https://docs.saltstack.com/en/latest/topics/reactor/#passing-event-data-to-minions-or-orchestrate-as-pillar → refresh_pool.sls
12:27 fracklen joined #salt
12:29 rgrinberg joined #salt
12:30 favadi joined #salt
12:32 mage_ babilen: thanks
12:33 fracklen joined #salt
12:35 tracphil joined #salt
12:35 fracklen joined #salt
12:37 zzzirk joined #salt
12:42 jad_jay joined #salt
12:44 toastedpenguin joined #salt
12:44 ssplatt joined #salt
12:47 pipps joined #salt
12:48 Miouge joined #salt
12:48 dendazen joined #salt
12:54 nmadhok joined #salt
12:59 numkem joined #salt
12:59 fracklen joined #salt
13:00 toastedpenguin joined #salt
13:06 subsignal joined #salt
13:07 tristianc joined #salt
13:09 DanyC joined #salt
13:11 _JZ_ joined #salt
13:12 fracklen joined #salt
13:13 subsigna_ joined #salt
13:14 toastedpenguin joined #salt
13:15 DanyC hi all, having an issue with salt-cloud provider, anyone able to have a look and see if they spot anything? http://hastebin.com/usebedepad.vhdl
13:16 DanyC looked in the code itself and i can't work out what is missing/ wrong... Any help much appreciated
13:16 pipps joined #salt
13:17 drawsmcgraw joined #salt
13:18 bhosmer_ joined #salt
13:18 mapu joined #salt
13:22 gh34 joined #salt
13:22 RoGryza joined #salt
13:23 catpig joined #salt
13:24 pipps joined #salt
13:24 drawsmcgraw joined #salt
13:26 rojem joined #salt
13:30 squishypebble joined #salt
13:30 DanyC anyone ?
13:33 racooper joined #salt
13:33 tristianc joined #salt
13:37 tvinson DanyC: i think driver: saltify should be provider: saltify, trying to confirm
13:38 TaiSHi DanyC: it is 'provider' in earlier versions
13:39 tvinson hmm...it should be driver in this version
13:39 DanyC tvinson: TaiSHi unfortunately the issue is not there. I can use either one or the other. For my version should be driver
13:39 AndreasLutro are you sure it's your provider and not your profile that's screwing up?
13:40 AndreasLutro my guess would be you have a profile with no provider defined
13:40 DammitJim joined #salt
13:41 TaiSHi Could be an empty profile
13:41 TaiSHi Oh wait
13:41 TaiSHi list-providers
13:41 TaiSHi Shouldn't be list-drivers now?
13:41 DanyC AndreasLutro: i do have a profile defined,check this one http://hastebin.com/icuhirunuq.vhdl
13:42 TaiSHi (haven't actually seen any doc but since we're going for the name change)
13:42 DanyC as per the documentation
13:42 TaiSHi What he means DanyC is that you might have ANOTHER config file that might be breaking
13:42 DanyC TaiSHi: there is no command like the one you mentioned
13:43 DanyC TaiSHi: i'd love to know which oen is it, the trace gives me no info
13:43 TooLmaN joined #salt
13:43 TaiSHi DanyC: that looks like a salty one
13:45 tapoxi joined #salt
13:46 AndreasLutro DanyC: replace "driver" with "provider" in your profile config file?
13:48 Heartsbane joined #salt
13:48 hasues joined #salt
13:49 iceyao joined #salt
13:50 DanyC AndreasLutro: you are a STAR mate, much thanks !
13:50 TaiSHi You serious?
13:50 zzzirk joined #salt
13:50 TaiSHi Didn't we mention that earlier ?
13:51 DanyC TaiSHi: my bad, sorry for wasting your time guys, i was looking in the wrong file
13:51 TaiSHi Dude you're not wasting our time
13:51 DanyC thanks all for reply
13:52 TaiSHi People that helps, helps because they want to
13:52 drawsmcgraw joined #salt
13:52 TaiSHi It's understandable, glad you got it sorted out
13:53 hasues left #salt
13:54 ferbla joined #salt
13:54 Miouge joined #salt
13:55 losh joined #salt
13:56 DanyC TaiSHi: thanks !
13:56 hal58th joined #salt
13:58 mohae_ joined #salt
14:00 jab416171 joined #salt
14:00 jerredbell joined #salt
14:00 Miouge joined #salt
14:01 mpanetta_ joined #salt
14:02 mpanetta_ joined #salt
14:03 jhujhiti joined #salt
14:03 nmadhok joined #salt
14:08 turbofluxinator joined #salt
14:08 turbofluxinator left #salt
14:12 tristianc joined #salt
14:13 Tanta joined #salt
14:13 rojem joined #salt
14:13 kaptk2 joined #salt
14:14 kus joined #salt
14:15 rdas joined #salt
14:15 andrew_v joined #salt
14:18 pipps joined #salt
14:19 mowntan joined #salt
14:19 mowntan joined #salt
14:19 mowntan joined #salt
14:23 fracklen joined #salt
14:25 nick79 joined #salt
14:26 onlyanegg joined #salt
14:31 jad_jay joined #salt
14:31 fredvd joined #salt
14:33 jad_jay joined #salt
14:34 Brew joined #salt
14:34 johnkeates joined #salt
14:36 deus_ex joined #salt
14:40 Cadmus joined #salt
14:42 rojem joined #salt
14:45 MadHatter42 joined #salt
14:45 deberon joined #salt
14:48 anotherZero joined #salt
14:48 SheetiS joined #salt
14:58 fracklen joined #salt
14:58 dfinn joined #salt
15:00 hal58th joined #salt
15:02 cyborg-one joined #salt
15:02 iceyao joined #salt
15:03 dgutu joined #salt
15:04 gcorey joined #salt
15:05 hal58th_ joined #salt
15:07 berserk joined #salt
15:08 aqua^c joined #salt
15:10 debian112 joined #salt
15:11 quup left #salt
15:12 DammitJim joined #salt
15:12 berserk joined #salt
15:20 viq joined #salt
15:21 Humsie joined #salt
15:23 jimklo joined #salt
15:24 Humsie evening, can i ask a question about SDB's in salt-stack? trying to figure out where to store the sdb profiles, added a sdb.conf to master.d, but a sdb.get sdb://a/b just returns de sdb uri
15:24 Humsie feeling like a noob again :)
15:27 fracklen joined #salt
15:28 devster31 is there a way to use perl-style regexes to replace a line in a file?
15:28 dezertol joined #salt
15:32 Humsie_ joined #salt
15:34 Humsie devster31: if on linux, try sed
15:35 Humsie_ joined #salt
15:39 jmedinar joined #salt
15:39 rylnd joined #salt
15:40 jmedinar How can I force a SLS from within to run only for certain minions? To avoid team mistakes if they attempt to run it manually and not from a HighState ?
15:41 Phil-Work jmedinar, probably if statement on a relevant grain
15:42 jmedinar what if is not a grain but a minion id?
15:42 Phil-Work can do
15:43 jmedinar something like the 'tgt' on reactors ?
15:45 rrei hey guys
15:45 onlyanegg joined #salt
15:46 rrei does anyone know what default context is passed to a template for example with file.managed?
15:46 rrei if I pass no context explicitly, does it pass the context of the sls file?!?
15:46 rrei while I was writing this i realize this doesn't make much sense
15:46 rrei nevermind :D
15:46 Phil-Work jmedinar, I was thinking just a jinja if statement
15:47 jmedinar I was thinking on something like this
15:47 jmedinar {% if 0 == salt['cmd.retcode']('grep *_db_* /etc/salt/minion') %}
15:49 ageorgop joined #salt
15:49 Phil-Work seems a bit heavy/prone to error
15:49 Phil-Work why can't you just match on the minion id in grains?
15:49 jmedinar but then I think I am not using the actual minion ID but wasting time getting into the minion itself
15:49 jmedinar mmm that will work too :)
15:50 jmedinar thanks Phil-Work
15:58 Rookie_ joined #salt
15:59 majikman joined #salt
16:03 tmclaugh[work] joined #salt
16:04 Miouge joined #salt
16:07 devster31 Humsie_: file.sed ? it tells me it's been deprecated
16:08 rrei file.replace?
16:08 rrei https://docs.saltstack.com/en/latest/ref/states/all/salt.states.file.html#salt.states.file.replace
16:08 Ayo joined #salt
16:09 Miouge joined #salt
16:10 Humsie_ That one is better i guess :)
16:16 Humsie_ Anyone got an idea about where to place sdb profiles? /etc/salt/master.d/sdb.conf doesn't seem to work
16:16 Humsie_ (Debian server)
16:16 devster31 rrei: file.replace uses python regexes though
16:17 Humsie joined #salt
16:19 rrei devster31: is that a deal breaker for you?
16:25 Humsie devster31: i use a cmd.run with an unless structure for such cases, bit less salt minded but works great
16:26 rihannon joined #salt
16:26 Humsie (on linux/unix servers with sed)
16:30 bltmiller joined #salt
16:31 onlyanegg joined #salt
16:31 rrei yeah, that's another good option, then you can use sed syntax
16:32 writtenoff joined #salt
16:33 nmadhok joined #salt
16:35 Hivlaher joined #salt
16:37 mohae joined #salt
16:43 Humsie_ joined #salt
17:01 rgrinberg joined #salt
17:07 edrocks joined #salt
17:10 fracklen joined #salt
17:17 rgrinberg joined #salt
17:20 impi joined #salt
17:22 DammitJim joined #salt
17:22 lompik joined #salt
17:23 hasues joined #salt
17:23 hasues left #salt
17:26 kawa2014 joined #salt
17:26 s_kunk joined #salt
17:31 viq joined #salt
17:32 nmadhok joined #salt
17:33 tracphil joined #salt
17:35 GreatSnoopy joined #salt
17:39 UtahDave joined #salt
17:41 aswini joined #salt
17:42 aswini how to provide external auth for runners?
17:43 garphy joined #salt
17:44 tracphil Hi all. Are minion grains stored on the salt-master between state.highstate runs?
17:47 aw110f joined #salt
17:57 cableninja joined #salt
17:57 cableninja Is there a jinja variable that determines the hostname of the minion it is currently applying?
17:58 cableninja having problems finding one
17:59 felskrone joined #salt
17:59 ry joined #salt
18:00 jfindlay cableninja: you should have access to grains in jinja
18:01 jfindlay {% if grains.get('host') == 'my_host' %}
18:01 cableninja thanks
18:02 punkoivan joined #salt
18:10 DammitJim should I be pushing a grain from my master so I know what servers are development?
18:10 DammitJim or if they belong to a particular domain?
18:13 mapu joined #salt
18:14 lero joined #salt
18:19 cnk joined #salt
18:22 cnk left #salt
18:22 SheetiS joined #salt
18:23 function07 joined #salt
18:23 tristianc joined #salt
18:25 s_kunk joined #salt
18:25 s_kunk joined #salt
18:25 function07 does anyone know where I can find an example on how to add data to a start event?
18:29 cableninja_ joined #salt
18:30 ajw0100 joined #salt
18:34 edrocks joined #salt
18:38 RoGryza joined #salt
18:40 devster31 rrei: in some cases it is, python regex doesn't support possessives for example, the cmd.run is a good enough solution
18:42 manji joined #salt
18:43 teatime possessives?
18:44 DammitJim possessives like: mine, yours
18:45 cableninja Not sure whatI'm doing wrong here.. http://pastie.org/10842718 Salt is not applying collectd.servers. I think its because of line 44, but I verified that grains['fqdn'] matched the section in services.lax_base pillar
18:45 cyborg-one joined #salt
18:46 ageorgop joined #salt
18:47 UtahDave DammitJim: Setting a grain to mark a server as a certain domain is pretty common
18:48 UtahDave cableninja: you don't need the  {{ }} around your variables when you're already inside the jinja environment.
18:51 snergster joined #salt
18:51 bltmiller joined #salt
18:52 cableninja UtahDave, that helped that, not sure about this now though, http://pastie.org/10842726 same pillars, etc
18:53 UtahDave cableninja: is   args['enable']  a dictionary?
18:54 cableninja args['enable'] is supposed to be the block 'enable' at line 29: http://pastie.org/10842718
18:58 UtahDave ok, well that's a list.
18:58 UtahDave This code:  {% for service, service_options in args['enable'] %}      is expecting a list. you're extracting "service" and "service_options"  when  args['enable'] is a list
18:59 cableninja but entries in [enable] may have options, is there a better way to format that?
19:02 UtahDave cableninja: Basically you'd have to loop through that list and check for the type of each item and react accordingly
19:02 rbjorkli1 joined #salt
19:03 UtahDave {% for service in args['enable'] %}
19:03 UtahDave Then you'd check if the item is a string or a dictionary and do something based off that
19:06 impi joined #salt
19:09 cableninja UtahDave, how do I do that? or better question, is there a good full on guide for jinja logic?
19:09 UtahDave There should be some good examples in the upstream Jinja documentation. There's probably some good examples in some of the salt-formulas
19:10 jfindlay the jinja docs are fairly complete but you have to spend some time to find what you're looking for
19:13 tercenya joined #salt
19:15 DammitJim jinja docs? where? I need to read those
19:17 ajw0100 joined #salt
19:18 UtahDave http://jinja.pocoo.org/
19:21 hasues joined #salt
19:21 hasues left #salt
19:23 DammitJim thank you UtahDave ! bookmarked
19:28 honestly 1only the template designer docs matter
19:29 honestly and those are not very long
19:38 scottcrooks joined #salt
19:39 sc250024 Quick question: has anyone tried using `salt-cloud` to provision an Ubuntu Xenial AMI in AWS?
19:39 tmmt joined #salt
19:39 sc250024 Using one of their AMIs, `salt-cloud` fails to connect. if I switch the profile to use their 14.04 image, `salt-cloud` works fine
19:40 ajw0100 joined #salt
19:41 rem5 joined #salt
19:44 nmadhok joined #salt
19:46 jfindlay sc250024: probably because ubuntu 16.04 doesn't work with bootstrap yet
19:46 jfindlay https://github.com/saltstack/salt-bootstrap/issues/826, https://github.com/saltstack/salt-bootstrap/issues/844
19:46 saltstackbot [#844]title: ubuntu 16.04 packages | ### Description of Issue/Question...
19:47 Trauma joined #salt
19:48 nmadhok Jinja Docs: https://media.readthedocs.org/pdf/jinja2/latest/jinja2.pdf
19:49 sc250024 @jfindlay: ah, that makes sense
19:49 sc250024 Thank you
19:49 murrdoc joined #salt
19:50 jY is there a config option for what returners to run so i don't have to always use --return
19:50 josuebrunel joined #salt
19:51 murrdoc yes
19:52 jfindlay jY: https://docs.saltstack.com/en/latest/ref/configuration/master.html#event-return
19:52 jY ahh thanks
19:55 supertom joined #salt
19:59 cableninja I've got a managed file (source: salt://collectd/files/services/disk.conf) and I've set its template type to jinja. How can I get a jinja variable from the sls to the managed file? I tried setting outside of the for loop (within the top of the sls) but that didnt help. any suggestions>?
20:01 kevinquinnyo did you pass it in with the 'context' key in file.managed, cableninja ?
20:01 cableninja ooooooo
20:02 cableninja no I didnt
20:02 cableninja will try that
20:02 aqua^c joined #salt
20:02 kevinquinnyo context takes a dictionary, where the key is the variable name as jinja will know it, and the value as the variable contents
20:04 Lionel_Debroux_ joined #salt
20:06 linjan joined #salt
20:08 subsignal joined #salt
20:11 Ayo joined #salt
20:11 cnk joined #salt
20:13 anotherZero joined #salt
20:19 sjmh anyone know if it's possible to merge certain config values from different files?
20:20 sjmh idea would be that applications would be able to install their own 'reactor' stanzas
20:20 sjmh that would all get merged
20:28 jfindlay sjmh: I suspect that you could use normal jinja and yaml includes/imports for reactors although I have not tested this
20:30 rem5 joined #salt
20:30 rgrinberg joined #salt
20:30 garphy joined #salt
20:30 UtahDave sjmh: are you talking about having multiple  *.conf files in  /etc/salt/master.d/   ?
20:30 bVector could someone take a look at this and tell me what I'm doing wrong? http://pastebin.com/9P9gpNAs
20:30 Xevian joined #salt
20:30 bVector I'm trying to run survey.hash with 'pip.freeze bin_env=/home/deploy/app'
20:30 ajw0100 joined #salt
20:31 bVector but it seems to not be passing in the bin_env argument
20:31 sjmh UtahDave : yeah, I know you can do that, but I was talking about having multiple .conf files, that specify some of the same config values.  In this case, specifically, 'reactor'
20:31 bVector I've tried a few different ways of passing in kwargs
20:31 UtahDave sjmh: Hm.  Let me ask. I'm not sure.
20:31 sjmh the idea being an app could install it's own conf into the master.d directory for reactors it sues
20:31 sjmh uses
20:31 UtahDave sjmh: right.  just a sec
20:32 lero joined #salt
20:34 subsignal joined #salt
20:35 UtahDave sjmh: OK, Tom thinks that merging those settings was added fairly recently. Maybe 2015.8.x and probably 2016.3.  But we should test and verify first
20:35 sjmh Ok, cool Ill give it a try then
20:39 UtahDave bVector: does the bin_env option work when you're not using the survey.hash function?
20:39 bVector yeah
20:40 UtahDave ok, so the bin_env option is probably getting passed to the survey.hash function instead of passed through to the pip.freeze function
20:40 bVector yeah I did test.arg_repr in that pastebin I posted
20:41 UtahDave let me ask the guy who wrote that.
20:41 bVector it looks like its coming through as { ...  '__pub_arg': [{'bin_env': '/home/deploy/app'}], ... }
20:43 UtahDave bVector: have you tried putting double quotes around the entire pip.freeze command?   "pip.freeze bin_env='/home/deply/app'"
20:43 bVector I'll give that a try
20:44 bVector 'pip.freeze bin_env='/home/dwelo/hub'' is not available.
20:49 rojem joined #salt
20:53 bVector I'm using a version of salt without the kwargs_passthru line in survey.hash :/
20:53 bVector https://github.com/saltstack/salt/blob/develop/salt/runners/survey.py#L157
20:56 bVector changed a few lines and now it works with `sudo salt-run survey.hash \* pip.freeze 'bin_env=/home/deploy/app'`
20:57 iggy can you use `- sls: some.sls.file` in a require_in?
21:00 UtahDave ah, ok. bVector
21:01 cableninja_ joined #salt
21:01 UtahDave iggy: I'm not sure. have you tried it yet?
21:01 bVector iggy: is this what you're looking to do? https://github.com/saltstack/salt/blob/0ef623f6fae5d624abd5d335ccd0f8b0aab77845/tests/integration/files/file/base/requisites/fullsls_require_in.sls
21:02 bVector or are you looking to require in all `file` directives only in that one sls
21:05 sagerdearia joined #salt
21:06 ajw0100 joined #salt
21:06 cnk left #salt
21:09 rem5 joined #salt
21:12 tracphil joined #salt
21:16 scottcrooks joined #salt
21:20 onlyanegg joined #salt
21:24 izaki joined #salt
21:25 viq joined #salt
21:30 iggy I want to reorder something before another state, but the state has an indeterminate ID (it's generated by jinja), so I was thinking just reorder it to before the entire file gets processed
21:31 iggy but I think we are going to just split things apart and reorder in the top file
21:35 cableninja__ joined #salt
21:41 fracklen joined #salt
21:46 murrdoc thats a terrible idea
21:49 murrdoc if the state has an indeterminate id, you can still use the `name` parameter
21:57 zer0def joined #salt
22:15 * Heartsbane blames UtahDave.
22:18 cableninja Anyone have any idea what I'm doing wrong here? http://pastie.org/10842869 I'm trying to get services[$server][enable][disk][options][disks] as a readable (set of) value(s) from the pillar into the collectd/services/disk.conf. I keep getting various errors like this no matter how I try to format the services block. - Rendering SLS 'base:collectd.servers' failed: Jinja variable 'list object' has no attribute 'disk'
22:20 cableninja the service name /[disk][name] gets set, but the options arent parsing
22:24 cliffstah joined #salt
22:24 berserk joined #salt
22:25 devster31 is there a web-ui gui or something for salt?
22:28 UtahDave cableninja: it's probably because 'enable' is a list instead of a dictionary.
22:29 UtahDave devster31: There's a project call saltpad that's been built by a community member.
22:29 devster31 is it good?
22:30 UtahDave I haven't used it, myself, but I saw the developer give a demo of it at a conference and it looked quite interesting.
22:31 devster31 thanks, I'll try it
22:31 UtahDave SaltStack the company is also building a system that sits above the salt master that has a web gui, but it hasn't bee released yet.
22:31 UtahDave s/bee/been
22:35 murrdoc syndic ?
22:35 devster31 I looked at the users-formula and it seems quite a mess, is using augeas a possible option to make it simpler?
22:36 nmadhok joined #salt
22:37 jb1498 joined #salt
22:37 cyborg-one joined #salt
22:39 zenlot6 joined #salt
22:42 cableninja UtahDave, looks like I got that fixed, but now I'm back to the same problem as before. variables set via context in the servers/init.sls are not being passed to jinja in collectd/services/disk.conf. http://pastie.org/10842916
22:43 berserk joined #salt
22:45 nmadhok1 joined #salt
22:45 berserk_ joined #salt
22:53 mohae joined #salt
22:57 mschiff How can I use "salt['network.ip_addrs']" in a template so it uses the IPs of the minion running the state using that template?
22:57 mschiff I want to set an interfaces ip in a config file...
22:58 majikman is it possible to specify a batch mode for just one formula?
22:59 majikman or rather, makke it part of a formula
22:59 Nahual joined #salt
23:00 babilen https://github.com/saltstack/salt/pull/33346/files m(
23:00 saltstackbot [#33346]title: Ponies! | Because who would want a cow when they can have a pony?...
23:00 KajiMaster joined #salt
23:00 babilen mschiff: You just run it in that SLS?
23:01 mschiff babilen: I am always getting the masters data then... which was confusing me a bit :-/
23:01 lero joined #salt
23:01 dave_r joined #salt
23:02 sjmh Someone have a good description of how pillar targeting actually works, internally?
23:02 mschiff babilen: sorry, I want to use this in pillar data...
23:02 babilen I typically just fill the mine with this data, but apart from pillars you should be able to use it in file.managed sources or SLSs that are being rendered on the minion too
23:02 sjmh Since the data is stored on the master, but the minion's are the ones who are supposed to be filtering on whether they run a job or not..
23:02 johnkeates joined #salt
23:03 babilen mschiff: Sure, pillars are rendered on the master. Completely different setup. Fill the mine (define a number of suitable mine function aliases) and then use https://docs.saltstack.com/en/develop/ref/modules/all/salt.modules.mine.html#salt.modules.mine.get (the runner) in the pillar to get the data
23:04 mschiff babilen: ok I already have the mine set up. Thanks ;)
23:04 babilen sjmh: Pillars are targeted by minion id (the only bit of information the master can trust), rendered on the master and then made available to the minion
23:05 sjmh babilen - right, but when used on the command line for targeting via ( -I ), how does that actually work? The minion doesn't cache the pillar data that I know of - or does it?
23:05 estahn joined #salt
23:07 sjmh At least, not from the conversation in https://github.com/saltstack/salt/issues/32144, it doesn't sound like minion's cache their pillar data locally.
23:07 saltstackbot [#32144]title: Pillar targeting starts to work only after calling `saltutil.refresh_pillar` | ### Description of Issue/Question...
23:08 dendazen joined #salt
23:09 Bryson joined #salt
23:11 babilen sjmh: Sure, that master has to work with up-to-date pillar data, doesn't it? I haven't checked the exact code, but why is this so surprising?
23:12 dave_r hi, noob here, how do i get saltstack to work on 32 bit ubuntu? do I have to build it myself? what should I do
23:13 zzzirk joined #salt
23:13 sjmh babilen - because I feel like I'm getting conflicting information.  See whiteinge's last comment here https://github.com/saltstack/salt/issues/32723#issuecomment-220174295
23:13 saltstackbot [#32723]title: Rosters for 'salt' for targeting systems ( similar to salt-ssh rosters ) | I'd like to be able to give my users the ability to create their own inventory/roster files and use those purely for targeting with the salt command.  We don't allow our salt users to modify the master.conf, so they can't add in their own nodegroups for using to target their commands and scripts with....
23:13 gtmanfred if you want .deb packages, you would need to build them yourself i believe
23:13 gtmanfred but you can also pip install it.
23:13 babilen dave_r: A pip install with the bootstrap script maybe? Or use amd64 like the rest ofus
23:15 babilen sjmh: Yeah, that is a little surprising and would warrant reading the actual code
23:15 BhavyaM joined #salt
23:16 sjmh From what I gathered, I thought pillar data was rendered by the master and cached locally on the master.  But the normal salt 'method' is that the client is the one deciding whether or not to run the command, which means it would need access to the pillar data - that, or the master is compiling a list of minion id's that match the pillar data and is interpolating those into the publish, and the minion is deciding whether to run based off that.
23:16 sjmh Or something else entirely.
23:16 sjmh So, was just trying to get my head wrapped around *exactly* how does targeting via pillar work. :)
23:16 sjmh I know it does - but the details are fuzzy.
23:16 babilen Read the codew
23:17 sjmh Yeah, I'll add that to the growing list of stuff on my plate.
23:17 Bryson joined #salt
23:17 murrdoc RTFC !
23:17 murrdoc
23:17 murrdoc babilen:
23:18 sjmh (¬_¬)
23:18 babilen sjmh: Assuming we have unrefutable evidence that targeting is handled entirely by the minions. What would you do with that information?
23:20 mpanetta_ joined #salt
23:20 babilen https://github.com/saltstack/salt/blob/develop/salt/minion.py#L2086
23:20 sjmh Uhm, have more intelligent conversations when talking about the issue #32723?
23:20 sjmh Which is about creating a pluggable targeting system.
23:20 babilen So that is what you care about?
23:21 mpanetta_ joined #salt
23:21 babilen Just trying to understand your information need .. obviously none of us in here has the entire codebase memorised :)
23:22 sjmh babilen : Part of it's curiosity.  Part of it is trying to understand the internals better so that I can better make decisions on our infrastructure.  Part of it was trying to clear confusion that was created by the two different issues and responses from the Salt developers.
23:23 babilen Sure, thank you. Did you read that comment I linked earlier? That blurs the water even more ;)
23:24 sjmh We have a largish deployment? ( ~26k minions ) - so small things can make huge differences sometimes, and better understanding some of how the targeting works ( especially when we start throwing ext_pillars into the mix ) would probably help me advise my users more.
23:24 sjmh babilen : just read it
23:24 sjmh that goes against what's typically 'taught'
23:25 babilen I totally understand. It just helps all involved people to actually know what we are talking about. I can't give you a definite answer as my impression was always "master selects and sends to minions which then decide if they really care"
23:25 babilen But that is obviously not detailed enough
23:25 sjmh Yeah, I always thought it was just 'publish to everything, minion decides'
23:29 cableninja I'm having problems getting the file.managed context setting working keep getting 'option_disks is not defined', http://pastie.org/10842929 option_* variables are not being set. the pillar has this: http://pastie.org/10842932 and the template source file http://pastie.org/10842933
23:33 babilen sh
23:33 babilen sjmh: Let's see how that discussion goes
23:36 hasues joined #salt
23:36 hasues left #salt
23:38 sjmh babilen - whiteinge responded.
23:38 sjmh guess it's kept in memory. :)
23:44 saltycharles joined #salt
23:44 ajw0100 joined #salt
23:46 babilen sjmh: So there is no master side pre-filtering?
23:46 sjmh Doesn't sound like it - for pillar at least.
23:47 babilen Good to know, I sort of assumed that the master would use its pillar data for this
23:49 babilen sjmh: Is this a scalability issue at your scale?
23:52 sjmh babilen - it came up as part of a discussion of us using an external pillar to cache some data from an external cmdb, and then some users wanting to use that pillar data for targeting.  they wanted the data to be really up-to-the-minute, in case the cmdb data had changed.
23:52 sjmh and we were trying to dive into the performance consequences of them having to run a pillar refresh across the whole infrastructure
23:52 sjmh the cmdb is a SaaS, and I doubt they wanted us to suddenly bombard them with ten's of thousands of requests for new pillar data.
23:52 babilen aye
23:53 sjmh we decided, instead, to go with a runner
23:53 sjmh so it queries the CMDB for a large result set ( basicaly, the data they wanted in the pillar ), and it's just a single request
23:53 sjmh and then the runner just starts up a LocalClient and runs the job that way with a list of minion id's instead
23:54 sjmh but it made me realize that my knowledge of the pillar-targeting mechanism wasn't super clear.
23:54 viq joined #salt
23:55 babilen That sounds like a sensible solution, but you are right in that it made you/me realise that there is more to it than we had assumed
23:55 RoGryza joined #salt
23:55 sjmh I had actually been hoping it was all master-side a bit.  Was thinking maybe we could have hacked something together for inserting that pillar data quickly into the master cache somehow, without touching the minions, but doesn't look like that's the case.
23:56 babilen I still wonder what that comment refers to exactly
23:56 babilen I had been hoping for master side targeting (with minion side checks) also
23:57 babilen And if this requires a pillar refresh on all minion before you can even target them, you are probably filling up the jid lists and job queues to quite a degree
23:58 sjmh Although, I guess I'm still confused with https://github.com/saltstack/salt/issues/32144 then.
23:58 saltstackbot [#32144]title: Pillar targeting starts to work only after calling `saltutil.refresh_pillar` | ### Description of Issue/Question...
23:58 sjmh Because how does the minion know about the pillar data, without him having run a pillar refresh?
23:58 babilen I think the issue there is, that there is new data that has not yet been rendered and therefore can't be used for targeting
23:58 bbbryson joined #salt
23:59 babilen Hmm .. but pillar.items works
23:59 babilen *sigh*
23:59 sjmh Also interesting is the logs.  If he uses an invalid pillar, the master knows that it matches no target, so it doesn't publish a job.

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