Perl 6 - the future is here, just unevenly distributed

IRC log for #salt, 2017-11-13

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

All times shown according to UTC.

Time Nick Message
00:07 Manor joined #salt
00:13 mikecmpbll joined #salt
00:20 magz0r joined #salt
00:40 uptime joined #salt
00:40 uptime joined #salt
00:46 GMAzrael joined #salt
00:58 jfelchner joined #salt
01:01 mannefu joined #salt
01:02 mannefu left #salt
01:08 Manor joined #salt
01:43 magz0r joined #salt
01:44 GMAzrael joined #salt
01:59 viq gaizeror: check out salt-eventsd as well
02:03 magz0r joined #salt
02:08 onlyanegg joined #salt
02:09 Manor joined #salt
02:09 Whissi joined #salt
02:13 NightMonkey joined #salt
02:16 zerocoolback joined #salt
02:27 zerocoolback joined #salt
02:29 saltslackbridge joined #salt
02:33 zerocoolback joined #salt
02:42 cyteen joined #salt
02:54 ilbot3 joined #salt
02:54 Topic for #salt is now Welcome to #salt! <+> Latest Versions: 2016.11.8, 2017.7.2 <+> 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
02:55 nomeed joined #salt
03:10 Manor joined #salt
03:10 jeddi joined #salt
03:11 hoonetorg joined #salt
03:11 saltslackbridge joined #salt
03:11 onlyanegg joined #salt
03:25 sp0097 joined #salt
03:25 saltslackbridge joined #salt
03:29 mavhq joined #salt
03:31 laertus ok, i've got a really newbie-type question...
03:32 laertus let's say i have two machines, "myhost1" and "myhost2", and i want salt to ensure that they each have a different set of users on them
03:32 laertus my first instinct is to have a top.sls in pillars_root that looks like this: http://bpaste.net/show/8c4743a63613
03:32 * MTecknology grumbles...
03:33 laertus and then have users1.sls and user2.sls pillars with the respective users in them
03:33 laertus but somehow this doesn't seem very salty
03:33 laertus what would be a more idomatic way to do this?
03:38 MTecknology XenophonF: I think saltpad is kind of an EoL product at this point, isn't it?
03:39 magz0r joined #salt
03:40 MTecknology Couldn't gaizeror have just used a custom returner to drop that into ES?  I think there's already an ES returner in the project too.
03:45 JPT joined #salt
03:45 onlyaneg1 joined #salt
03:49 GMAzrael joined #salt
04:00 XenophonF MTecknology: yeah looks like it's dead :(
04:01 XenophonF now I'm looking at https://github.com/martinhoefling/molten
04:02 XenophonF laertus: don't try to solve a problem with Salt (or Puppet, or Ansible, or Chef) that's better solved using the directory service of your choice
04:02 XenophonF but yeah that's the way I do it
04:02 laertus i don't have a directory service
04:02 XenophonF use salt to deploy one :)
04:03 laertus no time to learn or deploy one at the moment
04:03 laertus and it's overkill for just one user anyway
04:03 XenophonF true, for one user it's overkill
04:03 laertus a lot of what i'm doing is testing right now.. and using test VMs, or a single VM i have at a VPS, that only has just one user for myself
04:03 laertus actually, it technically has more.. service users and such
04:03 laertus but still
04:06 XenophonF i tend to define global service accounts, e.g., local admins, in a `defaults` SLS
04:07 XenophonF and then I give services proper names, e.g., `login.irtnog.org`, and put those services into those SLSes
04:08 XenophonF my mental model thinks of those named Pillar SLSes as being ITIL service packages
04:08 XenophonF so I can move services around and everything needed to deploy them follows the named Pillar SLS
04:09 XenophonF my point is that maybe, thinking `user1` gets defined on `minion1` is the wrong mental model
04:10 teratoma joined #salt
04:10 XenophonF maybe you'd be better off thinking `the xyz service package has all of these settings, including this service account` and `minion1 hosts the xyz service package (for now)`
04:11 laertus yes, that makes sense for the service accounts
04:11 Manor joined #salt
04:11 laertus like there'll be some service account that my mail server will be running on
04:11 XenophonF sure
04:11 laertus and i'll have that under the same sls that the mail server install will be under
04:11 laertus or something like that
04:11 laertus but in this particular case i'm working on now, i just want a login account for myself on this VM
04:12 laertus and i want to sync my vim init files to it, my zshrc to it, etc
04:12 laertus so when i have to ssh in to it to troubleshoot something, the environment won't be super painful to use
04:12 laertus and i thought this would be a good use of salt, to begin with
04:12 XenophonF see, that'd be perfect for this hypothetical `defaults` Pillar SLS
04:12 laertus except that my username isn't the same across all VMs
04:13 laertus like, for example, in this vagrant VM i have running under virtualbox on my laptop, i just have the default "vagrant" username i log in as
04:13 XenophonF well I'd write one Pillar SLS and use Jinja or something to mutate the username
04:13 laertus but mutate the username how?
04:13 XenophonF that's the whole DRY principle
04:13 laertus i have the username in pillar
04:13 laertus per VM
04:13 XenophonF Jinja works in Pillar SLS files
04:14 XenophonF if there's a pattern to what you want your username to be, express that pattern in code
04:14 laertus yeah, but where does the VM -> username mapping comes from?
04:14 laertus i thought it'd be in pillar
04:14 XenophonF you could have multiple Pillar SLS files
04:14 XenophonF but they'd all be copies of one another, right?
04:14 XenophonF so that violates DRY
04:15 laertus no, they wouldn't be copies of each other
04:15 laertus here's how i see this working:
04:15 XenophonF so express the VM->username mapping in a lookup table in Jinja
04:15 XenophonF and then one single SLS will do what's needed
04:15 XenophonF if the user accounts aren't substantially similar than it makes more sense to have separate SLS files for each
04:16 laertus well, jinja will be involved, but i thought the jinja would be in the file_roots sls file, not in pillar
04:16 laertus and the jinja would look up the username from pillar, based on the salt host id
04:16 XenophonF file_roots SLS file - do you mean top.sls?
04:17 laertus no, in the vim-inits sls file, for example
04:17 XenophonF oh
04:17 XenophonF you know, at the end of the day, you're good as long as the states work
04:18 XenophonF you can always refactor later :)
04:18 laertus yeah, a lot of this is just for practice anyway
04:18 laertus i alreayd have this set up manually.. the old fashioned way
04:18 XenophonF :-D
04:18 laertus but it'd be nice to get this working with salt, for practice
04:19 laertus and i probably will refactor it later anyway... like right now i'm just going to user a tar file and use the salt tar execution module untar it in to the right location for me
04:19 laertus later i'll probably switch to using gitfs
04:30 laertus ok.. another newbie question:
04:30 laertus if i have this simple state file, which ensures that vim is installed:  https://paste.pound-python.org/show/V8tvzVVKOGRXlEXJXXOl/
04:31 laertus it uses "pkg.installed", which is a declarative syntax, using the term "installed" in the past tense because it's representing the final state of the resource
04:32 laertus i'm guessing that this actually uses the salt "pkg" executable module, which is actually a virtual module around a platform-specific module (in my case on openbsd it'd be pkg.openbsdpkg)
04:32 laertus and specifically the "install" command of that:  https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.openbsdpkg.html#salt.modules.openbsdpkg.install
04:32 laertus or the "install" method, rather
04:33 laertus now, my question has to do with the "archive" executable module, and its "tar" method:  https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.archive.html#salt.modules.archive.tar
04:34 laertus in my sls file, since the state should be expressed declaratively in the past tense, should i use the past tense of "tar", as i had used the past tense of "install" when using the "pkg" module?
04:34 laertus like "tarred"?
04:34 laertus this is a bit confusing to me
04:48 GMAzrael joined #salt
04:49 laertus can i even use execution modules inside sls files, or are they only for passing as arguments to the salt command?
04:49 laertus because it's the latter that all the examples in the execution module documentation are of
04:51 onlyanegg joined #salt
04:52 Guest73 joined #salt
04:55 magz0r joined #salt
04:59 justanotheruser joined #salt
05:04 justanotheruser joined #salt
05:08 laertus i have this state file:  http://bpaste.net/show/bd9d22605866
05:08 laertus but when i apply it i get an error:  "State 'archive.tar' was not found in SLS 'vim-inits'"
05:09 justanotheruser joined #salt
05:10 laertus i'm trying to use the "tar" method from the "archive" execution module:  https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.archive.html#salt.modules.archive.tar
05:11 Manor joined #salt
05:17 samodid joined #salt
05:19 Guest73 joined #salt
05:31 cyteen joined #salt
05:33 mavhq joined #salt
05:45 GMAzrael joined #salt
05:45 om2 joined #salt
05:52 laertus so, i changed the syntax of the above sls file to this:  https://paste.pound-python.org/show/3kecI3tFMUk5WnMf6tuD/
05:52 laertus and it worked.. though i don't understand why the first one didn't
05:53 magz0r joined #salt
05:54 laertus hmm... i guess it's because the former was me trying to use an execution module in a state, while the latter is using a state module
05:55 laertus which explains why the latter worked.. but i'm still not sure if there's some way to use an execution module in a state
06:06 MTecknology Why are you "set"ing usernames? You don't re-use that var. {% for username in pillar.get('users', []) %} is half the lines to read.
06:07 MTecknology I told you the difference between pillar dict and the pillar.get salt call. I don't understand why you wouldn't use the better option.
06:09 MTecknology laertus: {% for user in salt['pillar.get']('users', []) %}  Is the structure you should follow. You seem to be ignoring everything I say, but at least don't ignore that one.   When you have a scenario that you know says "don't do that", then don't but that's the standard best practice.
06:10 laertus you never told me which was better
06:11 jasonrm laertus: your state sls files use the `state modules` to describe the desired state, which in turn use `execution modules` to determine current state and perform (if required) the actions needed to reach the desired state.
06:12 jasonrm laertus: any particular reason you want to use an execution module directly?
06:12 Guest73 joined #salt
06:12 Manor joined #salt
06:13 laertus jasonrm: well, i happened to click on a link in the official documentation which is titled "salt module index":  https://docs.saltstack.com/en/latest/salt-modindex.html
06:13 laertus and i did see things like "pkg" in there, which was from many examples in the tutorials, so i thought these were the modules used in those tutorials
06:13 laertus they happened to be execution modules
06:13 laertus i wasn't even aware there were state modules and that i should be using state modules instead of execution modules
06:14 laertus so i thought that execution modules were the modules i should be using
06:14 laertus clearly i was wrong
06:14 jasonrm yeah… that bit me at the start as well
06:14 laertus chalk it up to inexperience, or missing something in the docs, or maybe crappy docs
06:15 * MTecknology gives up
06:15 laertus "crappy" is too strong a term... maybe not quite clear enough
06:15 MTecknology laertus: Good luck to your salt adventures!
06:15 laertus MTecknology: thanks for your help
06:15 jasonrm the docs are good once you understand what assumptions the authors make ;)
06:16 laertus yeah, i think they were written by someone who knew salt really, really well
06:16 laertus and was too divorced from a newbie's point of view
06:16 MTecknology jasonrm: which part is confusing from a beginner POV?
06:19 jasonrm MTecknology: in some ways, its the lack of separation and distinction between modules, particularly, state and execution
06:19 MTecknology I know there's confusion because of "execution modules" typically being called "modules" except everything in salt essentially being a "modular" system.  That's sort of a growing pain Tom mentioned in one of his saltconf talks.  Unfortunately, the name "modules" isn't going anywhere and everything is either execution modules or modules of another subsystem.
06:19 jasonrm a lot of the early tutorial is calling execution, but then you move to states and it's "different"
06:19 jasonrm i mostly grok it now, but it was very confusing years back
06:20 MTecknology You have execution modules, and state modules. State modules dictate what execution modules will do.   I'd love to see an easy way to communicate that idea to beginners, but I don't know how that can compute unless someone already understands modular systems enough to get it.
06:21 laertus maybe that was already mentioned in the tutorials somewhere, and i just missed it
06:21 laertus i think i'm suffering from a bit of information overload at this point
06:21 MTecknology laertus: based on the giant pile you've been fed, I would agree.
06:22 jasonrm is there a page like https://docs.saltstack.com/en/latest/ref/index.html that is more than an index? that has a 1-5 line summary of what a module group does?
06:22 MTecknology laertus: You've been fed lots of terrible info and you've made me not care enough to help.
06:23 MTecknology not care enough to *not help? .. I'm struggling with human meaning there
06:23 magz0r joined #salt
06:23 laertus i really don't want to get in to a fight with you, MTecknology
06:24 laertus if you don't want to help, you don't want to help
06:24 laertus let's just drop it and move one
06:24 laertus maybe someone else here can help
06:24 MTecknology I *WANT* to help...
06:24 laertus ok, then i misread what you said
06:24 laertus and i apologise
06:25 MTecknology laertus: feel free to grep your logs for the times I've helped and think about what changed
06:25 laertus you've helped a lot and i'm grateful
06:25 laertus i just get frustrated at salt sometimes.. and i hope neither you nor any other salt fans here take it personally
06:26 MTecknology jasonrm: I don't think there's any nice clean summary of each. Is that page you linked to an actual "noob" resource? If so.. I'd love to spend some time trying to add some info there.  Also- was that particular distinction an actual obstacle for you when you started?
06:28 jasonrm MTecknology: any page you land on while learning should be helping guide a new person. as no matter the tutorial, it will always be lacking for what task they want to get done and searches will lead them to pages like that
06:30 MTecknology Not to beat a dead horse, but are we saying a page like that or that actual page?  Does "like that" mean additional pages that only have lists without descriptions?
06:32 MTecknology laertus: When you take what I say and throw it out the window, I take it personally. It's IRC and that's a place for thick skin, but it still means I'm gonna start turning a blind eye, even when I know better solutions that I really do wanna share.   It's not worth the time to type if it's just gonna go out the window.
06:33 laertus if i threw anything you said out the window it was not intentional
06:34 laertus i either misread what you said or forgot it.. or it might be possible that you misremembered what you told me
06:34 laertus in any case, there's some miscommunication there
06:34 laertus and i don't think it's worth getting upset over, because i'm not trying to ignore you or your advice, which i greatly appreciate
06:35 laertus sometimes when a student is slow or makes mistakes, the teacher has to repeat themselves to get the student to learn
06:36 MTecknology This is IRC, not school.
06:36 jasonrm MTecknology: there has to be at least some way to summarize a module grouping. "pillar modules: a salt master can be configured to use one or more pillar modules to retrieve data that is is made available by pillar" ... maybe it's not correct, but if i'm trying to do something in a template, I know I can ignore all of those modules for now.
06:37 jasonrm laertus: word of warning, if you have any background in programming don't make your states to complicated once you start playing with jinja
06:38 laertus yeah, i'm trying to keep things as simple as possible, but no simpler ;)
06:38 jasonrm laertus: i've been there, it's no fun, lol -> https://github.com/saltstack/salt/issues/12470#issuecomment-41975577
06:38 MTecknology jasonrm: I think I'm mostly interested in where "noobs" land and what brings them there. I'm wondering if there should be more generic/educational destinations for some things instead of what's essentially an API reference. That big blob of confusing-unless-familiar is relatively unavoidable, but there's a lot of room for dividing user experience.
06:39 laertus jasonrm: hehe.. yeah, at that point i think you're better off just using python to generate the state file directly
06:39 MTecknology That particular page: https://docs.saltstack.com/en/latest/ref/index.html .. I absolutely agree that there should be a brief summary of what each is giving you.
06:43 MTecknology I was kinda curious because I've never actually seen that page before.
06:44 jasonrm MTecknology: i landed in those pages, it took me far too long to realize they weren't the same. execution being used at cli makes perfect sense, but i didn't catch the switch to state modules once templates started being talked about. It wasn't really until i understood python a bit better and got a little accustom to the source code did I realize how everything is a function
06:46 laertus for this page:  https://docs.saltstack.com/en/latest/salt-modindex.html   what would have helped me was a big note at the top:  "NOTE: These execution modules are for use by state modules or by the salt command.  Do not use them in state files.  Use state modules instead."
06:46 laertus seeing that would have saved me some time
06:47 jasonrm that list includes state modules ;)
06:47 jasonrm but i agree
06:48 laertus yeah, the note would have to be modified to make it more accurately reflect what that page contains... maybe there need to be multiple notes, at each division by type of module
06:48 laertus but something along those lines would have saved at least me a little bit of frustration
06:49 MTecknology jasonrm: " big note at the top:"  that would not have been in any way accurate
06:49 MTecknology laertus: **
06:50 laertus ok, well, i'm just showing my ignorance of salt then
06:50 zerocoolback joined #salt
06:50 GMAzrael joined #salt
06:50 MTecknology execution modules are for when execution modules need to be called... end of story
06:50 laertus but am i wrong that i should not have been trying to use execution modules inside a state file and should have been using satate modules instead?
06:51 laertus state modules even
06:51 k_sze[work] joined #salt
06:52 MTecknology laertus: remember what I told you about state modules?
06:53 onlyanegg joined #salt
06:53 laertus "your state sls files use the `state modules` to describe the desired state, which in turn use `execution modules` to determine current state and perform (if required) the actions needed to reach the desired state"
06:54 jasonrm that was me though :p
06:54 laertus oh
06:54 MTecknology since you quoted me, I'm happy I said something worth quoting
06:54 MTecknology laertus: Do you understand what that means?
06:55 MTecknology I suggested an execution and state module that you should look at as an example.
06:55 laertus "You have execution modules, and state modules. State modules dictate what execution modules will do."
06:56 MTecknology I realize now that I did not clarify: look means look at the source
06:57 MTecknology If python scares you, then just ignore the syntax stuff.. but still skim through the english portions
06:57 laertus python does not scare me
07:00 laertus which module did you want me to look at the source of?
07:01 MTecknology debconf
07:01 MTecknology I could say "any", but I actually wrote that one so I know it meets what I want you to see
07:02 colttt joined #salt
07:02 laertus you wrote that module?
07:02 laertus awesome
07:03 laertus not i feel bad about criticising salt
07:03 laertus not=now
07:03 laertus freudian slip...
07:05 MTecknology I'm struggling hard to comprehend that as a freudian slip
07:05 laertus freudian doesn't necessarily mean it's sexual.. it's just a slip of the tongue in which you say one thing while meaning another
07:05 laertus in this case i kind of said the reverse of what i meant
07:05 laertus putting my foot in my mouth.. which i have a great talent for
07:06 DarkKnightCZ joined #salt
07:06 laertus anyway, i'll just thank you again for taking the time to help me despite me criticising something you've actually contributed to
07:06 laertus so thanks, and sorry
07:08 inetpro joined #salt
07:08 MTecknology A freudian slip isn't a typo. It's when you meant to say something, but said something else based on true desire.
07:08 laertus it's an expression of the subconscious, by some theories
07:08 MTecknology I almost went into psychology as a major...
07:08 laertus not necessarily "true" (as what is true in the realm of the mind, anyway?)
07:09 MTecknology When I found out I didn't like people, it wasn't really an option.
07:10 laertus i've thought of becoming a psychologist myself at one point
07:10 MTecknology People lie and start to smell bad. Computers listen and get replaced.
07:11 laertus but i decided i couldn't bear hearing people's problems all day... it would be just too depressing
07:11 MTecknology psychology is *SO* much more broad than "helping" people with their problems... but this is also kinda way OT
07:11 laertus in retrospect, that might have been a mistake.. as there are plenty of things you can do with psychology without necessarily being a psychologist per se
07:11 laertus yeah, exactly
07:12 laertus i'll just go back to reading that module... brb
07:14 mavhq joined #salt
07:20 pualj joined #salt
07:26 laertus ok, i think i get the general idea, as far as the module goes
07:26 laertus not sure what it has to do with execution modules vs state modules, though
07:26 do3meli joined #salt
07:27 laertus that was /usr/lib64/python2.7/site-packages/salt/modules/debconfmod.py by the way
07:27 MTecknology laertus: did you see the state module do anything but call the execution module?
07:28 laertus do you mean this state module:  /usr/lib64/python2.7/site-packages/salt/states/debconfmod.py ?
07:28 MTecknology github links tend to work better
07:29 MTecknology and yes
07:30 laertus https://github.com/saltstack/salt/blob/develop/salt/states/debconfmod.py
07:34 laertus it's definitely doing a lot more than just calling the other module
07:34 felskrone joined #salt
07:34 laertus like that huge "for (key, args) in six.iteritems(data)" block near the bottom
07:39 hammer065 joined #salt
07:42 do3meli left #salt
07:42 inetpro joined #salt
07:42 fl3sh hi, does anyone use salt minion on osx?
07:42 hoonetorg joined #salt
07:44 GMAzrael joined #salt
07:47 SMuZZ joined #salt
07:59 jhauser joined #salt
08:10 Manor joined #salt
08:10 johnj joined #salt
08:10 zulutango joined #salt
08:17 Hybrid joined #salt
08:21 zerocoolback joined #salt
08:23 MTecknology laertus: If you're familiar with python, then you're familiar with iterating over a set. That part should not be confusing you.
08:26 laertus yep, i got that
08:27 pbandark joined #salt
08:29 Ricardo1000 joined #salt
08:39 darioleidi joined #salt
08:40 KennethWilke joined #salt
08:40 pewpew joined #salt
08:43 GMAzrael joined #salt
08:47 Guest73 joined #salt
08:47 mavhq joined #salt
08:57 absolutejam Morning
08:58 absolutejam Is there any way to use `isinstance` in jinja?
08:58 absolutejam or an alternative filter?
08:58 absolutejam I need to see if a pillar key is a dict
09:02 babilen absolutejam: Wouldn't |mapping() be enough?
09:02 Manor joined #salt
09:03 babilen *quack quack*
09:04 _KaszpiR_ joined #salt
09:07 mikecmpbll joined #salt
09:08 SkyRocknRoll joined #salt
09:08 laertus joined #salt
09:11 johnj joined #salt
09:16 coredumb Morning
09:17 cyteen joined #salt
09:17 kukacz joined #salt
09:23 aanriot joined #salt
09:28 _KaszpiR_ joined #salt
09:28 N-Mi joined #salt
09:28 N-Mi joined #salt
09:29 Mattch joined #salt
09:31 zerocoolback joined #salt
09:37 ws2k3 joined #salt
09:48 GMAzrael joined #salt
09:51 Larry1 joined #salt
10:10 johnj joined #salt
10:18 k1412-web joined #salt
10:21 k1412 Hello everyone, I know it's not directly salt related but it's the first time I see a formula repo like that (most all there are commands usage and pillar example) but here I see only the pillar no command usage (https://github.com/salt-formulas/salt-formula-linux)
10:31 SlicerDicer joined #salt
10:31 SlicerDicer joined #salt
10:32 SlicerDicer_ joined #salt
10:35 viq k1412: so what is your question?
10:36 k1412 viq: How use the forumula, most of time I see something like php.xxx for php formula but here I don't see any command like that
10:37 babilen I guess target one of the many states you find in the source code
10:37 viq k1412: you assign states and pillars to hosts in the respective top.sls files, and run 'state.apply'
10:38 viq Also https://github.com/salt-formulas/ makes somewhat different assumptions than https://github.com/saltstack-formulas/ do, AFAIK
10:40 k1412 Ah thanks I will better go with saltstack then for now I have more habit with that
10:40 viq http://salt-formulas.readthedocs.io/en/latest/ talks more about the salt-formulas
10:44 k1412 thanks for all the informations
10:48 losh joined #salt
10:52 Praematura joined #salt
10:56 nkuttler hrm, if i perform a highstate on a group of machines, how do i apply one specific state only on one minion? i don't want to depend on a grain
10:57 babilen You target that specific state to that specific minion in the top.sls
10:57 nkuttler there is no guarantee the minion exists though
10:58 babilen So you just make it up on the spot if you apply it or not?
10:58 nkuttler i just need "one of this group"
10:58 Larry1 left #salt
10:58 Larry1 joined #salt
10:58 nkuttler it doesn't matter where it is applied
10:58 babilen That's a lot easier in Ansible
10:59 nkuttler eh :)
10:59 babilen You should decide where and do it in SaltStack
10:59 nkuttler hrm.. ok..
11:01 Larry joined #salt
11:01 babilen You could write an orchestration, get the list of hosts, select one randomly, run the state and continue with highstate on the others
11:01 babilen In fact that would be the appropriate thing to do
11:01 babilen To be idempotent you'd have to record your "initial" choice somewhere
11:02 babilen (so that you don't eventually run it on all hosts)
11:02 nkuttler thanks, i'll look into that
11:03 nkuttler it doesn't actually matter if i run it more than once, i just need to avoid concurrency
11:03 babilen The recording could be done by setting a custom grain (for example) unless you have a another datasource to which you can write already
11:04 babilen So you can run the same state on more than one minion, just not at the same time?
11:04 nkuttler yes, nothing will happen on the second run
11:04 babilen Do you *want* to run it on more than one minion?
11:04 nkuttler no
11:05 babilen Okay, then you have to ensure that you select a single one .. otherwise you could have used a batched run
11:05 babilen "-b 1" to be precise
11:05 nkuttler yeah, but -b 1 is too slow
11:05 babilen Without further information it sounds as if orchestration is not a bad approach
11:06 nkuttler yeah, thanks again
11:06 rawzone joined #salt
11:07 viq Or, as babilen mentioned, use another datasource, eg a "lock" in etcd or consul
11:11 johnj joined #salt
11:11 rawzone^ joined #salt
11:24 Larri Hi everyone, I use salt to setup ceph, but I got this from salt master
11:24 Larri master_minion            : ['Could not find minion salt. Check /srv/pillar/ceph/master_minion.sls']
11:24 Larri could any one give me some clue :-)
11:26 Manor joined #salt
11:29 babilen Larri: We would need additional information (e.g. commands you used, their complete output, configuration/setup, ...)
11:30 Larri babilen: Thanks, wait for a sec
11:30 babilen My initial idea would be that you didn't set a master in your minion config and that your DNS server doesn't resolve "salt" to your master
11:30 Larri this is the command          salt-run state.orch ceph.stage.0
11:31 Larri salt:~ # salt-run state.orch ceph.stage.0
11:31 Larri No minions matched the target. No command was sent, no jid was assigned.
11:31 Larri deepsea_minions          : valid
11:31 Larri ceph_version             : valid
11:31 Larri master_minion            : ['Could not find minion salt. Check /srv/pillar/ceph/master_minion.sls']
11:31 Larri [ERROR   ] No highstate or sls specified, no execution made
11:31 Larri salt_master:
11:31 Larri ----------
11:31 Larri ID: validate failed
11:31 Larri Function: salt.state
11:31 Larri Name: just.exit
11:31 Larri Result: False
11:31 babilen Okay, so you've written an orchestration ?
11:31 babilen Please use http://paste.debian.net, https://gist.github.com, http://sprunge.us, …
11:31 babilen Are you using someone else's states/orchestration here?
11:32 Larri no, I haven't
11:32 Larri I'm following this tutorial
11:32 babilen What's the content of /srv/pillar/ceph/master_minion.sls and FILE_ROOTS/ceph/state/0.sls ?
11:32 Larri http://docserv.suse.de/documents/SES_5/ses-deployment/html/ceph.install.saltstack.html#deepsea.stage.description
11:32 babilen Right
11:32 babilen I can't access that
11:32 Larri babilen: on master or menion?
11:33 Larri minion sorry
11:34 babilen So, this is https://github.com/SUSE/DeepSea
11:34 babilen Looks rather complicated :)
11:35 babilen You've ensured that "Check that the file /srv/pillar/ceph/master_minion.sls on the Salt master points to your Salt master." ?
11:35 Larri Yeah... actually I'm a new salt beginner.
11:35 Larri /srv/pillar/ceph/master_minion.sls this is empty on minion
11:35 babilen And it looks as if you picked quite a sophisticated codebase for your first steps
11:35 babilen I think you might have to configure that on your master
11:36 Larri the tutorial tells me that it this file is empty, minion will  try to connect hostname salt
11:36 babilen You have to forgive me, but I've never used those states and they are far from trivial (nor is /srv/pillar/ceph/master_minion.sls a common thing in salt)
11:37 babilen Yeah, but if your DNS server does not resolve the hostname "salt" to an IP address, that doesn't help (which seems to be the case here)
11:37 babilen So, you'd have to configure your master in that file (by IP or name) or configure your DNS server to resolve that name
11:37 Larri I have already configured /etc/hosts
11:37 babilen And "salt" is correctly resolved on the master?
11:38 Larri for all master and minion  they are like
11:38 Larri 10.67.162.187   salt
11:38 Larri 10.67.162.188   node1
11:38 Larri 10.67.162.190   node2
11:38 Larri 10.67.162.189   node3
11:38 Larri yes
11:39 Larri on node* I could ping salt and on salt I could ping node*
11:39 babilen It might conflate hostname and minion ID and simply can't contact your master minion
11:39 babilen Can you ping salt on salt?
11:39 babilen But then, that's probably not the minion id salt uses
11:39 Larri yes I tried
11:39 babilen What does "salt '*' test.ping" give you?
11:40 Larri salt:~ # salt '*' test.ping
11:40 Larri node3:
11:40 Larri True
11:40 Larri node2:
11:40 Larri True
11:40 Larri node1:
11:40 Larri True
11:40 babilen Please use http://paste.debian.net, https://gist.github.com, http://sprunge.us, …
11:40 Larri sorry...
11:40 babilen So, you don't seem to have a minion on the master
11:41 babilen Are you following the steps on https://github.com/SUSE/DeepSea ?
11:42 babilen It says that "zypper install deepsea" "installs the salt-master and salt-minion packages as a dependency."
11:42 Larri have a minion on the master ??   You mean that I should execute salt-minion service on master??
11:42 GMAzrael joined #salt
11:43 Larri Yeah, https://github.com/SUSE/DeepSea  and the  docs I referred to are almost the same
11:43 Larri I installed salt-master salt-minion and deepsea on master
11:44 Larri and installed only salt-minion on node1 node2 and node3
11:44 babilen Yes, you should have a minion running on the master
11:44 Larri Let me have a try
11:44 babilen I assume that DeepSea uses that to configure the master itself, but then .. I've never used that software
11:44 babilen The problem appears to be that it can't find the minion on the master
11:45 Larri I followed your procedure, and started minion service on master, but the problem reoccured.
11:46 babilen Can you re-run the test.ping command?
11:47 Larri https://gist.github.com/losemyheaven/2e5075369bccd8cbb65424957ccab1ae
11:47 zerocoolback joined #salt
11:47 babilen And what does "salt-key -A" give you?
11:48 Larry1 joined #salt
11:49 zerocoolback joined #salt
11:51 RandyT joined #salt
11:51 RandyT joined #salt
11:53 babilen Larry1: ping?
12:03 yadan joined #salt
12:06 Larry joined #salt
12:08 yadan joined #salt
12:11 Larry joined #salt
12:12 johnj joined #salt
12:13 yadan left #salt
12:13 yadan-desktop joined #salt
12:14 yadan-desktop hi
12:14 Praematura joined #salt
12:15 Manor joined #salt
12:18 yadan-desktop left #salt
12:21 Larry1 joined #salt
12:21 Larry1 left #salt
12:21 Larry1 joined #salt
12:24 Larry1 joined #salt
12:26 lost_ joined #salt
12:28 Larry2 joined #salt
12:29 Larry2 joined #salt
12:29 Yadan joined #salt
12:29 Yadan hi
12:30 zhaoqiang joined #salt
12:30 Larry3 joined #salt
12:31 * Yadan is just testing if he can sent message out, please just ignore the "hi" messages
12:33 Yadan1 joined #salt
12:35 Yadan1 joined #salt
12:35 babilen Yadan: Please use a diferent channel  (e.g. #test)
12:37 Yadan joined #salt
12:38 coredumb when you import a map in your state file, what's the best way to pass it to a managed file?
12:39 lost_ joined #salt
12:40 lost_ left #salt
12:42 GMAzrael joined #salt
12:43 Larri joined #salt
12:43 Larri hi
12:45 Yadan left #salt
12:46 Tucky joined #salt
12:54 babilen Larri: ping?
12:57 GMAzrael joined #salt
13:03 kukacz joined #salt
13:12 skeezix-hf joined #salt
13:13 johnj joined #salt
13:14 Nahual joined #salt
13:16 om2 joined #salt
13:18 numkem joined #salt
13:21 absolutejam babilen: I'm not sure what that filter does but I'll have a look! THanks
13:25 aldevar joined #salt
13:27 absolutejam `is mapping` was what I needed, but thanks for the direction babilen
13:29 Praematura joined #salt
13:29 Tucky joined #salt
13:29 Tucky joined #salt
13:41 samodid joined #salt
13:45 sp0097 joined #salt
13:46 gh34 joined #salt
14:14 johnj joined #salt
14:24 fl3sh no one use salt minion on osx?
14:27 yuhl joined #salt
14:28 yuhl joined #salt
14:33 pualj joined #salt
14:35 dxiri joined #salt
14:40 bowhunter joined #salt
14:43 cyteen joined #salt
14:44 saltslackbridge <gtmanfred> People use salt minion on osx
14:47 Praematura joined #salt
14:47 XenophonF I have it installed on a handful of Macs for test purposes.
14:54 fl3sh XenophonF: on 10.13?
14:57 XenophonF yup
14:58 XenophonF the .pkg installer handled upgrading from the older 2016.3 install, too
14:58 pualj joined #salt
14:59 dxiri_ joined #salt
14:59 racooper joined #salt
15:02 user-and-abuser joined #salt
15:05 mikecmpb_ joined #salt
15:07 XenophonF just to recap our PMs, the Mac installer is available from repo.saltstack.com, and like Windows it bundles its own Python 2.7 interpreter because the system Python sucks
15:08 XenophonF and you can do cool things on the Mac like install apps from .DMG files and stuff (e.g., the mac_package state module)
15:08 XenophonF supposedly that can do App Store installs
15:10 pbandark1 joined #salt
15:14 csmule joined #salt
15:15 johnj joined #salt
15:17 mavhq joined #salt
15:18 ouemt joined #salt
15:20 quantumsummers joined #salt
15:32 cgiroua joined #salt
15:33 Brew joined #salt
15:35 sp0097 joined #salt
15:36 mikecmpbll joined #salt
15:37 sp0097 joined #salt
15:38 sp0097 joined #salt
15:39 sp0097 joined #salt
15:39 sp0097 joined #salt
15:40 sp0097 joined #salt
15:41 sp0097 joined #salt
15:42 sp0097 joined #salt
15:44 tiwula joined #salt
15:50 quantumsummers joined #salt
15:57 sp0097 joined #salt
16:07 ahrs joined #salt
16:08 Praematura joined #salt
16:12 Guest73 joined #salt
16:14 CampusD joined #salt
16:16 johnj joined #salt
16:16 CampusD Hi all, I am having some issues with file.line, debugging doesn't seem to show errors. Still file is not updated. Sample here https://gist.github.com/anonymous/dd1aee19cb7310426e365244077d4f31 . Any ideas?
16:26 sp0097 joined #salt
16:27 SkyRocknRoll joined #salt
16:33 DarkKnightCZ joined #salt
16:47 mavhq joined #salt
16:51 Praematura joined #salt
16:58 csmule Shouldn't this select any minions with this environment?
16:59 csmule salt -C 'G@environment:prod' test.ping
17:01 mikecmpb_ joined #salt
17:05 kellyp joined #salt
17:11 heaje joined #salt
17:12 MTecknology laertus: The state is iterating over a list supplied to it and calling the module each time.
17:12 MTecknology csmule: You'd want to use -G for that, otherwise you need to actually have a compound selection for compound matching.
17:13 MTecknology -C "* and G@.."
17:13 ahrs joined #salt
17:15 Heartsbane I am blinded with white space
17:16 Heartsbane Damn IRC client was double spacing everything.
17:17 johnj_ joined #salt
17:19 nixjdm joined #salt
17:24 csmule MTecknology: It doesn't seem like the minion option "environment:" is set as a grain.  I can select fine on my custom grains.
17:27 _JZ_ joined #salt
17:29 mavhq joined #salt
17:35 eightyeight i'm seeing the following behavior, where salting SSH keys produces an ~/.ssh/authorized_keys file with unnecessary line breaks: https://ae7.st/p/4ar2
17:35 eightyeight what's causing this behavior, and how can it be remedied?
17:36 eightyeight the shuffling is meh, although it would be nice if that could be ordered based on how it's configured in the state's SLS
17:37 eightyeight curious if
17:37 eightyeight curious if https://github.com/saltstack/salt/blob/develop/salt/modules/ssh.py#L573 is the culprit
17:42 mikecmpbll joined #salt
17:47 mavhq joined #salt
17:51 astronouth7303 i'm trying to build a utility SLS that'll add config files to nginx, but depends on {nginx-light|nginx-full|nginx-extras} being installed. Is there a way to express that?
17:55 astronouth7303 (those are apt packages)
17:55 eightyeight probably best to not use ssh_auth.present in favor of file.managed. then i can source it, and not worry about salt mangling it
17:57 shanth joined #salt
18:16 fatal_exception joined #salt
18:18 johnj_ joined #salt
18:18 vexati0n has anyone used salt-ssh with solaris 10 before?
18:18 vexati0n I can't do anything except raw shell commands
18:20 vexati0n ha. nevermind, they don't have python installed.
18:23 eseyman joined #salt
18:37 wongster80 joined #salt
18:40 astronouth7303 on systems with pip and pip3, how do i tell salt to use pip3?
18:41 astronouth7303 `bin_env: pip3`?
18:43 tapoxi joined #salt
18:43 pcn https://github.com/saltstack/salt/issues/31814
18:44 pcn Looks like that is playing it safe and using the full path
18:45 saltslackbridge <gtmanfred> i believe you have to use the full path
18:47 tapoxi anyone know the release timeline for 2016.11.9?
18:48 pipps joined #salt
18:48 tapoxi nasty bug in 11.8 I'm dealing with
18:48 saltslackbridge <gtmanfred> january
18:49 saltslackbridge <gtmanfred> We are trying to finish up everything for the Oxygen release right now
18:49 _KaszpiR_ joined #salt
18:50 tapoxi for a second there I thought this was a really smart bot
18:50 saltslackbridge <gtmanfred> *beep boop*
18:51 tapoxi thanks gtmanfred, should I jump to 2017.7 before upgrading to oxygen? or are jumping major versions relatively safe
18:52 saltslackbridge <gtmanfred> You should be ok, everything that is being deprecated in oxygen, should have had deprecation messages in 2016.11, since we require 2 releases for deprecation
18:52 saltslackbridge <gtmanfred> but i wouldn’t do more than 2
18:55 nkuttler joined #salt
18:56 pualj joined #salt
18:59 SkyRocknRoll joined #salt
18:59 lordcirth_work eightyeight, ssh_auth.present works fine for me.  Are you sure the newlines aren't in the source pillar data?
19:00 MTecknology ^ that's bitten me more than once
19:00 MTecknology bit*?
19:01 pipps joined #salt
19:01 eightyeight lordcirth_work: i'm not using pillars with this. stock SLS config. and there are no extra newlines in the config, and the keys are in order.
19:02 lordcirth_work eightyeight, try running salt-call -l debug and see what it gets rendered to
19:04 SkyRocknRoll joined #salt
19:06 laertus when i apply this state:  https://paste.pound-python.org/show/acnPGmyfqxgVH7AeYtzM/
19:06 laertus it does extract the tarfile to /home/myuser, as i intend
19:06 eightyeight lordcirth_work: there is a ton of config for this server. is there a way i can tell it to just highstate the authorized_keys file? i'd rather not dig through thousands of lines of INFO and DEBUG lines.
19:06 laertus but i get a comment during the run saying "salt://vim-inits/vim.tar extracted to /home/myuser/, due to absence of one or more files/dirs"
19:07 laertus and, more troublingly, the extracted contents are owned by root, not by the user as the state file directs
19:08 eightyeight lordcirth_work: https://ae7.st/p/8iv3 is the config
19:10 pipps joined #salt
19:11 laertus ok, i fixed the ownership issue by removing the "options: 'xf'" line from the state file
19:17 mavhq joined #salt
19:19 johnj_ joined #salt
19:24 netcho joined #salt
19:24 netcho joined #salt
19:25 ChubYann joined #salt
19:28 Praematura joined #salt
19:31 pipps joined #salt
19:33 lordcirth_work eightyeight, just 'state.apply ssh' or whatever your state is called.
19:33 lordcirth_work eightyeight, you should have quotes around the key strings, on general principles
19:59 ChubYann joined #salt
20:06 ymasson joined #salt
20:09 user-and-abuser joined #salt
20:18 fatal_exception joined #salt
20:20 johnj_ joined #salt
20:23 kellyp joined #salt
20:23 onmeac joined #salt
20:32 kellyp joined #salt
20:35 eightyeight still 2300 lines. heh.
20:36 lordcirth_work Anyone used the syslog_ng state?  I'd like to use a state rather than file.managing everything, but it doesn't seem extensively documented
20:39 lordcirth_work laertus, sounds like a documentation problem.  You should raise a Github issue, I think.
20:46 swa_work joined #salt
20:47 pipps joined #salt
20:47 Praematura joined #salt
20:50 dxiri joined #salt
20:58 dxiri joined #salt
21:02 pipps joined #salt
21:08 dxiri joined #salt
21:10 tom[] how can i install a more recent release than the 2016.11.2 Carbon in debian stretch?
21:13 nkuttler tom[]: with the upstream repo
21:14 tom[] nkuttler: thanks. i found it now
21:18 XenophonF https://github.com/irtnog/cygwin-formula, a Salt formula that deploys Cygwin
21:18 XenophonF admittedly, it's pretty straightforward
21:21 user-and-abuser joined #salt
21:21 johnj_ joined #salt
21:21 bowhunter joined #salt
21:27 zertyu joined #salt
21:28 zertyu hi there
21:28 dxiri joined #salt
21:28 CampusD joined #salt
21:28 zertyu AFAIU salt using construction terminalogy
21:28 zertyu isn't it right ?
21:30 dxiri joined #salt
21:31 user-and-abuser joined #salt
21:32 mavhq joined #salt
21:34 pipps joined #salt
21:35 lordcirth_work zertyu, what do you mean?
21:35 pipps99 joined #salt
21:38 XenophonF man don't feed the trolls
21:38 zertyu when i read grain pillar etc ... it seems like construction terminalogy using
21:38 zertyu salt
21:39 zertyu is that it true ?
21:39 zertyu trolling is you XenophonF
21:39 lordcirth_work zertyu, they are all terms based on salt, not construction.
21:42 tiwula On aws/ec2, can I create/override tags for the instance in the profile or map file so that they get set upon launch?
21:42 XenophonF not in the map file
21:42 XenophonF you have to do it in the instance profile
21:42 XenophonF er, the cloud profile i mean
21:43 XenophonF e.g., https://github.com/irtnog/salt-states/blob/development/salt/files/cloud.profiles.d/irtnog.conf#L161
21:43 zertyu in based in what think you imagine pillar, grain etc....
21:43 XenophonF and https://github.com/irtnog/salt-states/blob/development/salt/files/cloud.maps.d/irtnog.conf#L9
21:44 saltslackbridge <gtmanfred> you should be able to overwrite anything in the profile in the map
21:45 XenophonF holy cow
21:45 XenophonF I stand corrected!
21:45 XenophonF That's awesome.  I had no idea you could do that.
21:45 XenophonF https://docs.saltstack.com/en/latest/topics/cloud/map.html
21:46 mauli_ joined #salt
21:46 XenophonF holy crap I'm so moving a ton of tags to the map file
21:46 copelco__ joined #salt
21:46 lordcirth_work gtmanfred, why are you on the slack bridge now?
21:47 saltslackbridge <gtmanfred> for some reason I cannot see any messages between the two places, this is in #salt right?
21:47 MightyJoe joined #salt
21:48 saltslackbridge joined #salt
21:49 simmel_ joined #salt
21:49 Hazelesque_ joined #salt
21:50 saltslackbridge <gtmanfred> @saltircbridge
21:51 sjorge joined #salt
21:52 v12aml joined #salt
21:52 gtmanfred hrm
21:52 zertyu those are not commun terminalogy
21:52 tiwula Thanks XenophonF.  I'll give that a whirl
21:52 wwalker_ joined #salt
21:52 gtmanfred ping
21:52 gtmanfred ...
21:52 zertyu i m just beginning with salt
21:52 zertyu just for guidance i m asking that
21:52 twiedenbein joined #salt
21:52 gtmanfred there it is
21:52 gtmanfred must have been a netsplit
21:52 saltslackbridge joined #salt
21:52 saltstackbot joined #salt
21:52 phtes joined #salt
21:52 saltslackbridge joined #salt
21:52 TomJepp joined #salt
21:52 Twiglet joined #salt
21:52 manji joined #salt
21:52 gtmanfred ping
21:53 Yoda-BZH joined #salt
21:53 rideh joined #salt
21:53 saltslackbridge <gtmanfred> lordcirth_work, mostly because I have slack open all the time.
21:53 Yoda-BZH joined #salt
21:53 twooster joined #salt
21:53 nullwit joined #salt
21:54 lordcirth_work zertyu, did you have a technical question you needed help with?
21:54 dlloyd joined #salt
21:56 zertyu is there any kind of tree view
21:56 zertyu with salt ?
21:56 saltslackbridge <gtmanfred> tree view of states?
21:56 saltslackbridge <gtmanfred> there is with enterprise
21:57 nledez joined #salt
21:58 ws2k3 joined #salt
21:58 ws2k3 joined #salt
21:59 ws2k3 joined #salt
21:59 zertyu well how you can draw your terminalogy in a scenario ?
21:59 zertyu that's my question
21:59 ws2k3 joined #salt
21:59 ws2k3 joined #salt
22:00 user-and-abuser joined #salt
22:01 zertyu for me it is not clear states grain pillar etc ...
22:01 frew joined #salt
22:04 nledez joined #salt
22:04 nledez joined #salt
22:05 Kelsar joined #salt
22:07 ws2k3 joined #salt
22:07 Processus42 joined #salt
22:08 pipps joined #salt
22:10 MTecknology zertyu: I don't understand the question. What do you mean by "draw your terminalogy in a scenario"?
22:10 shanth what's the question zertyu?
22:12 Praematura joined #salt
22:12 zertyu i don't know say an history
22:12 astronouth7303 hm, that was weird. i tried changing the certificates for salt-api cherrypy, and couldn't get it to pick them up, even with a salt-master restart. and `service salt-api stop` wouldn't kill it.
22:12 zertyu with all your words
22:13 shanth wat
22:13 astronouth7303 had to kill-9 it and manually clean out the PID file
22:15 apofis joined #salt
22:17 MTecknology zertyu: Are you using a translation service? What you say does not make sense.
22:18 CampusD zertyu, not sure what kind of story/analogy/cartoon story you could come up with the name of the key components of the application
22:18 CampusD I guess I am not that creative
22:19 user-and-abuser joined #salt
22:20 skatz joined #salt
22:21 colegatron joined #salt
22:21 kellyp joined #salt
22:22 wongster80 joined #salt
22:22 johnj_ joined #salt
22:23 chowmeined joined #salt
22:26 zertyu ok no problem
22:26 zertyu i try to imagine that story for you
22:26 zertyu left #salt
22:27 CampusD you have salt, states of salt, pillars of salt, grains of salt, etc
22:32 freelock joined #salt
22:32 kbaikov[m] joined #salt
22:32 psychi[m] joined #salt
22:32 sxar joined #salt
22:32 ThomasJ|m joined #salt
22:32 toofoo[m] joined #salt
22:32 hackel joined #salt
22:32 viq[m] joined #salt
22:32 rtr63gdh[m] joined #salt
22:32 jerrykan[m] joined #salt
22:32 benjiale[m] joined #salt
22:32 gomerus[m] joined #salt
22:32 aboe[m] joined #salt
22:32 theblazehen joined #salt
22:33 fujexo[m] joined #salt
22:33 renaissancedev[m joined #salt
22:33 Llmiseyhaa joined #salt
22:44 kellyp_ joined #salt
22:45 kellyp_ joined #salt
22:49 vexati0n my state keeps failing because of "dict object has no attribute X"... but of course that attribute doesn't exist, i'm cycling through an array to find the attribute the dict object DOES have. how do i make jinja skip that error ?
22:53 vexati0n https://bpaste.net/show/e1167f5beb10
22:54 vexati0n that just fails on the first if statement, because the pillar[...] isn't defined. but how else am i supposed to discard the items that aren't defined until i find the one that IS defined?
22:55 saltslackbridge <gtmanfred> so, you can only use `is defined` with dot notation
22:55 vexati0n that... is stupid.l
22:55 vexati0n what's the alternative?
22:55 saltslackbridge <gtmanfred> {% if salt.pillar.get(’ossec_ip_keys:%s:key’|format(addr), None) %}
22:56 saltslackbridge <whytewolf> even if you had jinja skip the error. ossec_client_key would not survive the loop
22:56 saltslackbridge <gtmanfred> yeah, that too, if you set a variable in a loop, it gets destroyed once the loop ends
22:56 vexati0n grr. why does jinja have to be like 1/3 of the way to useful
22:57 vexati0n so what's the correct way to take a list of things where cannot know ahead of time which one I need, and select the correct one based on existing pillar data?
22:58 saltslackbridge <gtmanfred> i mean, you could put the for loop around the place you need to use that, instead of setting a variable
22:58 MTecknology vexati0n: Did you look at what gtmanfred said? ^^
22:58 MTecknology You go into the look if values and you don't if not
22:59 pipps joined #salt
22:59 saltslackbridge <gtmanfred> mtecknology, did you look at his paste? he is setting a variable inside a for loop, that will delete the variable once the endfor is hit
22:59 MTecknology loop*
22:59 MTecknology ooooh... nevermind!
23:00 saltslackbridge <gtmanfred> vexati0n, i would write a salt execution module that does the logic that you want to do in jinja, and then just call that function
23:00 saltslackbridge <gtmanfred> return the value you are looking for
23:00 saltslackbridge <gtmanfred> then just do {{salt.whatever.module() }} and get the expected return back, then you can do all the logic in python instead of trying to shove it in jinja
23:01 saltslackbridge <gtmanfred> https://docs.saltstack.com/en/latest/ref/file_server/dynamic-modules.html
23:01 pipps99 joined #salt
23:01 vexati0n that violates my religion, which prohibits writing python
23:01 saltslackbridge <gtmanfred> well, then don’t do it
23:01 saltslackbridge <gtmanfred> ¯\_(ツ)_/¯
23:01 saltslackbridge <gtmanfred> write a ruby renderer, and write all your states in erb
23:07 saltslackbridge <skatz> I'm having trouble using pkg/winrepo_ng in a state to upgrade Windows minions from 2017.7.1 to 2017.7.2... When the `salt-minion-py3: pkg.installed: - version: 2017.7.2` state executes, it successfully upgrades the minion to the correct version but I never get a return from the job (I suppose because the upgrade kills the original salt-minion service and spawns a new one). Is that expected? Any way to get a return from that job so I can see
23:07 saltslackbridge which minions successfully upgraded?
23:08 saltslackbridge <gtmanfred> The same problem exists on linux
23:08 saltslackbridge <gtmanfred> and I believe it is expected
23:08 pipps joined #salt
23:08 saltslackbridge <gtmanfred> you would just need to query all the minions and check their `test.version` module
23:08 saltslackbridge <skatz> ok. i supposed I could issue a test.version afterward to find any that didn't upgrade for whatever reason
23:08 saltslackbridge <skatz> jinx :slightly_smiling_face:
23:09 saltslackbridge <gtmanfred> though, we have had a long discussion on how to correctly fix this on linux (with systemd at least) https://github.com/saltstack/salt/pull/44427
23:09 saltslackbridge <gtmanfred> this is the 4th or 5th time this pr has been made
23:09 saltslackbridge <gtmanfred> and this change has been reverted before, but no one remembers why
23:10 g3cko joined #salt
23:12 saltslackbridge <skatz> iiinteresting. i suppose since the installer wipes out the old service on windows it might not be possible to change that behavior there
23:12 saltslackbridge <skatz> I'm far from a windows expert though
23:13 saltslackbridge <gtmanfred> me either, but i would recommend double checking the issue list on github, and if you don’t find anything, opening a new issue, because it should be something that is looked into
23:19 brianthelion joined #salt
23:20 eightyeight how can i pass multiple grains to salt(1)? IE: "salt -G 'os_family:Debian && domain:cloud.example.com' test.version"
23:21 eightyeight or "salt -G 'os_family:Debian' -G 'domain:cloud.example.com' test.version
23:21 eightyeight both fail
23:21 eightyeight trying to match both the os_family and the domain grains
23:21 saltslackbridge <gtmanfred> salt -C ‘G@os_family:Debian and G@domain:cloud.example.com’ test.version
23:21 saltslackbridge <gtmanfred> https://docs.saltstack.com/en/latest/topics/targeting/compound.html
23:21 eightyeight ah. Compoound.
23:21 eightyeight thx
23:21 eightyeight s/oo/o/
23:23 saltslackbridge <skatz> @gtmanfred I shall, thanks
23:23 johnj_ joined #salt
23:25 brianthelion saltslackbridge: Just following up on my issue RE: salt-cloud + salt-ssh and update_cachedir
23:25 brianthelion I'm on my laptop behind my home firewall. Which of these "auto high-state" recipes will actually work when I provision my VM on AWS? http://www.powelltechconsulting.com/salt-cloud-executing-an-auto-high-state/
23:26 brianthelion I was trying salt-ssh because I assumed I'd need to be :4505 accessible by the new minion
23:27 brianthelion but maybe that's not true
23:27 pipps joined #salt
23:27 saltslackbridge <gtmanfred> yeah, if you are behind a nat firewall, you will need to use salt-ssh
23:28 saltslackbridge <gtmanfred> non of those auto highstates will work
23:28 saltslackbridge <gtmanfred> because they all require being connected to the master
23:28 brianthelion figured
23:28 saltslackbridge <gtmanfred> if you use masterless minions, you could use `start_action: state.highstate`
23:28 saltslackbridge <gtmanfred> or stateup_states
23:28 dxiri joined #salt
23:29 saltslackbridge <gtmanfred> but yeah, if you want to use salt-ssh, you can’t do that
23:29 saltslackbridge <gtmanfred> I am in the process of working on integrating salt-ssh with salt-master, so a salt ‘*’ call would also hit roster minions
23:29 saltslackbridge <gtmanfred> at which point salt-ssh could be used, but until then, not possible, even with the reactor and update_cachedir
23:30 saltslackbridge <gtmanfred> unless you time a salt-cloud -F with the update_cachedir every say… 5 minutes
23:30 saltslackbridge <gtmanfred> and then on new instances trigger a state.orchestrate run that uses the salt-ssh client to run a highstate on the minions
23:30 dxiri joined #salt
23:31 saltslackbridge <gtmanfred> actually
23:31 saltslackbridge <gtmanfred> you wouldn’t user orchestrate, you would just do it from the reactor
23:32 Praematura joined #salt
23:32 saltslackbridge <gtmanfred> nevermind, it would be an orchestrate that does a salt.state state run
23:32 saltslackbridge <gtmanfred> ssh=True https://docs.saltstack.com/en/latest/ref/states/all/salt.states.saltmod.html#salt.states.saltmod.state
23:33 s0undt3ch joined #salt
23:33 saltslackbridge <gtmanfred> so, you could do #4 on that website
23:33 saltslackbridge <gtmanfred> but you would need to be running a master daemon locally, even with no minions connected to it
23:34 saltslackbridge <gtmanfred> so that the event bus was opened and the salt-cloud command could fire on it, then the salt-master could fire off the state.orchestrate from the reactor, alternatively you could write your own event stream listener, and not use the reactor
23:34 saltslackbridge <gtmanfred> but that would be more work
23:35 laertus joined #salt
23:35 pipps joined #salt
23:35 brianthelion cool, i will give that a try. I was actually in the middle of testing that when I hit https://github.com/saltstack/salt/issues/43407
23:36 brianthelion and kinda tabled it until I knew that issue was resolved
23:37 pipps99 joined #salt
23:38 brianthelion just as a bit of background, I'm basically trying to bootstrap a AWS VPC from my laptop which means (1) salt-cloud to provision a VM, (2) salt-??? to configure the VM as a master, ship it my pillars/states, and set up salt-api, and (3) pepper to do everything from there
23:39 justanotheruser joined #salt
23:40 brianthelion any thoughts on a better way to get it done are much appreciated
23:40 brianthelion the "gotchas" of trying to work from behind a firewall have been painful
23:42 eightyeight how do i return minions that are older or newer than a specific version via salt(1)?
23:44 GMAzrael joined #salt
23:47 onlyanegg joined #salt
23:53 mikecmpbll joined #salt

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