Perl 6 - the future is here, just unevenly distributed

IRC log for #salt, 2017-05-11

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

All times shown according to UTC.

Time Nick Message
00:04 pipps joined #salt
00:05 DEger joined #salt
00:05 dps joined #salt
00:15 justanotheruser joined #salt
00:43 dezertol joined #salt
00:47 onlyanegg joined #salt
00:48 hashwagon Is it possible for a require state to require multiple file.managed states to complete? I know this works with packages with 'pkgs'.
00:48 hemebond hashwagon: Yes, you can have as many requires as you want.
00:51 hashwagon How would I make a list for multiple file.managed states? I've installed multiple packages in one state with pkg.installed: -pkgs: <listed items>. Is this same format possible with files.managed?
00:51 hemebond Wait, what?
00:51 hemebond Installing multiple packages in one states is a special thing and nothing to do with dependencies.
00:54 ssplatt joined #salt
00:54 hashwagon Ah okay. Was meaning something comparable to the "Multiple packages can also be installed with the use of the pkgs state module" section at  https://docs.saltstack.com/en/latest/ref/states/all/salt.states.pkg.html, but a list of  requisites for file.managed.
00:54 hashwagon If that makes sense, but it sounds like it's not a feature.
00:55 hemebond That's a special parameter for the pkg.installed state module.
00:55 hashwagon Ah okay good to know thanks
00:56 hashwagon I have another noob question. If there a multiple states listed in a state file without requisites do they execute in a particular order?
00:57 hemebond They will execute in the order they are defined.
00:57 hashwagon perfect thanks
00:57 hemebond In the file.
01:15 ssplatt joined #salt
01:23 Nahual joined #salt
01:34 onlyanegg joined #salt
01:48 Guest97338 joined #salt
01:50 ilbot3 joined #salt
01:50 Topic for #salt is now Welcome to #salt! <+> Latest Versions: 2016.3.6, 2016.11.4 <+> Support: https://www.saltstack.com/support/ <+> SaltStack Webinar on Carbon, Nitrogen, and Enterprise 5.1 on May 18, 2017 https://goo.gl/PvsOvQ <+> Logs: http://irclog.perlgeek.de/salt/ <+> Paste: https://gist.github.com/ <+> See also: #salt-devel, #salt-offtopic <+> We are volunteers and may not have immediate answers
01:53 Guest97338 How can I take the output of a script and use it in a variable in a sls state file?
01:53 whytewolf Guest97338: you either need to run your script as jinja.... which could be bad if your script changes things. or you don't do it at all
01:54 Guest97338 using salt['cmd.run]('/script/location.sh') won't work for me because it doesn't exist yet (Jinja is evaled before yaml states
01:54 whytewolf Guest97338: yes, and states don't talk together
01:55 Nahual Guest97338: Are you planting the script there with another state?
01:56 Guest97338 I've even split it up into two states and brought them in in sequence from the top.sls file
01:56 whytewolf Guest97338: that won't work either.
01:57 whytewolf although you could do that with orchestration
01:57 whytewolf instead of top.sls
01:57 whytewolf [each stanza in orchestration is a seperate run]
01:57 Nahual Yes. I have to do something similar for some of our deployments.
01:59 jas02 joined #salt
01:59 Guest97338 I'm not familiar with orchestration
02:00 whytewolf https://docs.saltstack.com/en/latest/topics/orchestrate/orchestrate_runner.html#orchestrate-runner
02:00 whytewolf learn it, love it
02:00 whytewolf [or hate it]
02:01 Guest97338 thanks
02:04 justanotheruser joined #salt
02:11 zerocoolback joined #salt
02:16 mpanetta joined #salt
02:21 mpanetta joined #salt
02:28 c_g joined #salt
02:28 c_g joined #salt
02:29 cyteen joined #salt
02:31 icebal joined #salt
02:40 cyborg-one joined #salt
02:43 c_g joined #salt
02:52 onlyanegg joined #salt
02:57 rem5 joined #salt
02:59 rem5 joined #salt
03:02 deuscapturus joined #salt
03:06 CrummyGummy joined #salt
03:08 asyncsec joined #salt
03:11 mavhq joined #salt
03:11 VR-Jack-H joined #salt
03:16 icebal joined #salt
03:41 aneeshusa joined #salt
03:43 Praematura joined #salt
03:49 coder joined #salt
03:50 nikdatrix joined #salt
03:50 Guest21697 left #salt
03:52 mpanetta joined #salt
03:58 citaret joined #salt
04:07 Guest21697 joined #salt
04:07 Guest21697 left #salt
04:24 yuhl______ joined #salt
04:28 Praematura joined #salt
04:33 vaelen joined #salt
04:34 Terminus joined #salt
04:36 sp0097 joined #salt
04:41 fracklen joined #salt
04:44 al joined #salt
04:50 preludedrew joined #salt
04:53 SaucyElf joined #salt
04:54 pcn You can also just write a module that does it all in python, and call that.
05:16 rdas joined #salt
05:22 Bock joined #salt
05:29 felskrone joined #salt
05:30 DanyC joined #salt
05:32 Andy__ Thanks whytewolf and iggy for the info, I'll give up on using pillar to target pillar
05:34 Neighbour You can use grain targeting though
05:35 Andy__ I did wonder about that, but it seems like the chicken and egg situation of getting the grains there in the first place
05:35 Andy__ Would I need to do two runs?  First to set /etc/salt/grain files on hosts as I need, and then I would be able to target based on grains?
05:36 Neighbour I'm using it in orchestration scripts where I pass a custom pillar (which included a new minion's intended role) and then use {% set future_minion_pillar = salt['pillar.show_pillar'](minion=<name>, pillar['target_grains']) %} to retrieve the not-yet-existing minion's pillar
05:37 Andy__ Also I was going for pillar because it seems to be the recommended way to handle key-value stuff, with grains being preferred for information about the system like OS, CPUs, etc - I guess it's still fine to use a grain like that, though?
05:37 Neighbour pillar is a master-to-client oriented set of key-values, while grains are more client-to-master
05:38 Andy__ Heh, nice succinct way to think of it, thanks :)
05:38 Neighbour wait, that's not entirely right...it's not directly calling pillar.show_pillar, since that's a salt-runner
05:39 Andy__ This is still new to me so the example you pasted seems a bit tricky, but doesn't needing to specify the minion name defeat the purpose?
05:39 Andy__ Or could 'minion=<name>' just as easily be 'role=<role>'?
05:40 Neighbour salt['saltutil.runner']('pillar.show_pillar', minion=<minion_name>, pillar=<pillar-dict>, extra-key-values-that-will-be-interpreted-as-grains)
05:40 Neighbour if you pass 'role=<role>', it will be interpreted as a grain named 'role' being present
05:41 Neighbour specifying a minion name is not per se required, but if you determine pillar-data by minion name (or part of it), it comes in handy :)
05:41 Neighbour you can practice this on the command line at the master
05:41 Neighbour salt-run pillar.show_pillar
05:41 Neighbour with extra options as you see fit
05:42 Andy__ That gives me an error :/
05:42 Andy__ "KeyError: 'grains'"
05:43 Andy__ When running just 'salt-run pillar.show_pillar'
05:43 Neighbour that's odd
05:43 Neighbour and if you pass in the role value?
05:43 Neighbour salt-run pillar.show_pillar role=somethingorother
05:43 Andy__ Yeah, I've been able to run "salt '*' pillar.items"
05:43 Neighbour that's different
05:44 Neighbour that queries an existing minion on what its pillar is
05:44 Andy__ Still doesn't like it with a role specified
05:44 Neighbour salt-run generates a pillar based on the arguments you provide
05:44 Neighbour hm, that might be a bug...i'll look into it after breakfast :)
05:44 Neighbour which version of salt are you using?
05:44 Andy__ salt 2016.11.4 (Carbon)
05:45 Andy__ Thanks :)
05:45 Andy__ I've been using it for a week or so and had a few niggles, mostly which I've put down to user error, but at least one other thing that seemed like a possible bug
05:46 Andy__ Trying to get the Docker login stuff to work, and to get an image running.  Will try again and get you the details if you're interested.
05:47 rmc3 joined #salt
05:49 coder joined #salt
05:50 Guest63623 left #salt
05:50 Guest63623 joined #salt
05:51 nikdatrix joined #salt
05:53 evle joined #salt
05:58 fracklen joined #salt
06:06 golodhrim|work joined #salt
06:06 q1x joined #salt
06:14 ronnix joined #salt
06:15 rgrundstrom Good morning.
06:19 fracklen_ joined #salt
06:20 Neighbour good morning rgrundstrom
06:22 Tantagel joined #salt
06:37 Elsmorian joined #salt
06:47 wych42 joined #salt
06:53 Ricardo1000 joined #salt
07:05 jarvis_ joined #salt
07:06 DEger joined #salt
07:11 Neighbour Andy__: Ok, i've found the problem
07:14 aldevar joined #salt
07:17 Inveracity joined #salt
07:20 Neighbour and a bunch more weirdness...
07:23 toanju joined #salt
07:32 Elsmorian joined #salt
07:33 do3meli joined #salt
07:34 do3meli left #salt
07:37 jas02 joined #salt
07:39 jas02 joined #salt
07:52 nikdatrix joined #salt
07:53 rgrundstrom What is wrong with this? https://justpaste.it/16ihf
07:53 rgrundstrom I get file not found when running... But i want it to create the file
07:53 candyman88 joined #salt
07:54 rgrundstrom With the content ofc.
07:56 Rumbles joined #salt
07:56 Neighbour rgrundstrom: use file.managed with the 'contents' option for that
07:56 Neighbour file.line is for editing existing files
07:58 rgrundstrom Neighbour: Ok I can see now that the file is created. but the content is missing.
07:59 mikecmpbll joined #salt
07:59 oida_ joined #salt
08:00 rgrundstrom never mind...
08:00 rgrundstrom Solved it
08:01 nikdatrix joined #salt
08:03 jhauser joined #salt
08:03 jas02 joined #salt
08:13 geomacy joined #salt
08:16 Ricardo1000 Hello
08:16 Ricardo1000 Does anyone know, exist or not some beacon module which compare files by md5 hash ?
08:17 toanju joined #salt
08:20 irated joined #salt
08:21 babilen Ricardo1000: I tested your setup in the interim and only see a single event
08:22 babilen Ricardo1000: What would you want that md5 beacon to do?
08:22 Ricardo1000 babilen: I figured out what was the matter
08:22 pbandark joined #salt
08:23 jarvis_ joined #salt
08:23 babilen *drumroll*
08:23 Ricardo1000 babilen: It was feature of the text editor
08:23 babilen That's novel .. what happened?
08:23 Ricardo1000 babilen: I wanna compare file changes not by inotify event, but real file content changes
08:24 Ricardo1000 babilen: Text editor write changes in different way that I have expected
08:26 Ricardo1000 babilen: As U understand I should write cistom beacon plugin with embded db support like lmdb or db4 to store file hash and then compare it
08:28 Trauma joined #salt
08:30 babilen How did you configure the inotify beacon?
08:30 Andy__ Neighbour: Nice one, so you don't need any more info from me about it then I guess?
08:30 Mattch joined #salt
08:35 babilen Ricardo1000: And, while we are at it: What do you really want to do?
08:38 Ricardo1000 babilen: I have changed mask option from modify to close_write. I wanna trigger action, when file has really been changed
08:39 babilen To what end?
08:41 dubg joined #salt
08:42 dubg Hello everyone, anyone know how to write a state using pillar and macro without write twice ?
08:42 babilen What are you writing twice?
08:43 dubg let's say i'm creating a state "user" using pillar
08:43 dubg but now i need to use "user" into another state
08:43 dubg so i use macro
08:44 babilen Why?
08:44 babilen Just import the 'user' state
08:44 dubg yeah but how i pass argument ?
08:44 dubg if i don't use pillar
08:44 LondonAppDev joined #salt
08:44 babilen Why wouldn't you use the pillar?
08:45 babilen Define users in pillars and import the resulting states whereever you need them
08:48 dubg i have a certain logic in my state
08:48 dubg like if i have "osfamily= redhat" do this
08:48 dubg or do this
08:48 babilen Would it perhaps make sense to paste the bit you are having problems with to one of http://paste.debian.net, https://gist.github.com, http://sprunge.us, … ?
08:50 Neighbour Andy__: Nope, you can fix it yourself (temporarily, until you upgrade) by changing /usr/lib/python2.7/site-packages/salt/utils/minion.py :)
08:50 Neighbour Andy__: change line 86: grains = data['grains']     to grains = data.get('grains', None)
08:51 Neighbour Andy__: same for the line below that, but with pillar instead of grains
08:51 Andy__ Nice, thanks :).  So this is a fix going into the next release of Salt, then?
08:51 dubg example: http://paste.debian.net/931931/
08:51 dubg this is not DRY
08:51 Neighbour I still have to make a PR, but I hope it will get included asap :0
08:52 babilen dubg: I see no osfamily in there nor any need for the macro at all (as you could just provide that user in the 'users' pillar)
08:54 dubg babilen: the "osfamily" is an example
08:55 dubg babilen: So the answer is no ?
08:55 babilen dubg: Yeah, sure, but so far I don't see any need for that macro. You are obviously working on a more complex case that *might* require it, but it is hard to say without seeing an example that exemplifies that complexity
08:56 dubg Anyway, is it possible to combine them ? (not matter the use case)
08:57 Andy__ I mentioned some Docker niggles earlier - one of them is I can't seem to get the dockerng.login function to work, it doesn't find the configured registry
08:57 babilen Basically you have two general approaches: 1. Define users in data (i.e. pillars) and 2. Define users in code (i.e. states) -- The first approach would require you to define all users in pillars and include/import the generic users state
08:58 babilen The latter would require you to write specific states for every single user, while also allowing for more, state specific, logic
08:58 babilen Those are the basic approaches .. then there are mixtures that allow for the definition of (platform specific) defaults and (optional) overrides via pillars.
08:58 jas02 joined #salt
08:59 Andy__ Running "salt '*' pillar.items" it shows me the 'docker-registries' pillar containing my registry URL, password and username, but then when I run "salt '*' dockerng.login <my-registry>" I get "No match found for registry '<my-registry>'"
08:59 babilen dubg: The basic design for that can be found in "formulas"
08:59 Andy__ I've got a horrible workaround to basically create the $HOME/.docker/config.json file myself, but it would be great to use the built in functionality
09:00 babilen duddIt sounds as if you want to ship defaults and a map.jinja for your state that allows for override via pillars (with foo:lookup:something-user), but
09:00 babilen I can't really say
09:00 Andy__ (by create the file myself, I mean with a jinja template and using the same pillar variables)
09:01 vlebo joined #salt
09:01 babilen Macros are, in the end, only a way to define a more concise definition of longer code snippets (a DSL), so you could expand them to whatever you deem appropriate. They will not, however, solve the essential problem of 1. or 2. ?
09:05 dubg babilen: i see, but i think that i take a wrong example (there is a function user anyway, but it's for the example). So, for u to understand my case, let take a state "firewall" who manage the firewall (obviously). I want to be able to manage the firewall from data in pillar like u say but sometime i need to call the state "firewall" under another state (like "apache") with specific argument (to avoid pillar, because it's something tha
09:05 LondonAppDev joined #salt
09:06 Neighbour Andy__: PR submitted...we'll see how it goes from here
09:06 babilen dubg: Your message was truncated at "something that"
09:06 LondonAppDev joined #salt
09:06 dubg babilen: i see, but i think that i take a wrong example (there is a function user anyway, but it's for the example). So, for u to understand my case, let take a state "firewall" who manage the firewall (obviously).
09:07 dubg I want to be able to manage the firewall from data in pillar like u say but sometime i need to call the state "firewall" under another state (like "apache") with specific argument (to avoid pillar, because it's something that need to be everytime)
09:07 dubg So i don't see why i need to put everything in pillar
09:08 dubg in the end, i use pillar to overwrite when i need, or put specific data
09:09 babilen I see no problem in shipping static pillar data for that
09:09 Neighbour Andy__: dockerng.login seems to look for pillar entries ending with "-docker-registries", so you probably need one named "foobar-docker-registries" or something like it
09:09 Neighbour Andy__: oh, and also "docker-registries"...nm :)
09:11 Trauma joined #salt
09:11 dubg I used Puppet in the past, and they use "Define" who does both
09:11 babilen dubg: Maybe your perception changes when you allow for multiple top-level pillar keys in the "firewall" pillar SLS
09:11 Neighbour Andy__: Ok, the name you pass with the call to dockerng.login (let's name it "foo") is looked up as a key in the pillar under 'docker-registries'
09:12 Neighbour Andy__: is that what you have in your pillar?
09:15 dubg
09:17 dubg i don't see the point of using multiple top level pillar key
09:17 dubg i have already a hierarchy
09:17 dubg in my pillar top sls
09:18 babilen dubg: If you want to use separate states that are configured with data in a different hierarchy, you'd have to introduce multiple top-level keys
09:18 * hemebond is perplexed by the anti-pillar sentiment
09:18 felskrone how can i tell programatically wether a formula has finished successfully? their does not  seem to be a field das return if any state within my formual may have failed
09:18 hemebond felskrone: Highstate returns all that information.
09:18 hemebond You could use json output and parse it.
09:18 babilen dubg: Your problem is that you want a generic state that can be configured/defined entirely in pillars while you insist that you don't want to use pillars for that
09:19 felskrone hemebond: yes, but i do not run a highstate all the time, that would overload my masters :-)
09:19 hemebond felskrone: highstate is also an output format.
09:20 hemebond When applying a specific state it will still return the same data.
09:21 dubg i use pillar to configure but i don't want to write more pillar in some case when it can done directly in state
09:22 dubg like static data
09:22 babilen dubg: Why?
09:22 dubg when i call a state into a state, the data in argument will never change, so why use pillar in this case ?
09:22 babilen Because you have to define that data somewhere
09:23 dubg so in state is it wrong ? x)
09:23 felskrone hemebond: lets say i run "state.sls webserver-formula", it returns all the data from the states within that formula, but no info wether all states have run successfully or not, that info seems to be only in each state-data returned, is that correct?
09:24 Andy__ Neighbour: Yes, I believe I have my pillar set up as you say
09:24 babilen I would take a look at the formula conventions documentation and see if you can happify yourself by keeping the "data" bit in defaults.yaml, map.jinja (for platform specific bits and data merging) and pillars (for exceptions)
09:24 babilen dubg: I don't say that it is wrong .. there is no "wrong" here, but there are different approaches and it doesn't make sense to want to use approach one and insisting to use it like approach two
09:25 hemebond felskrone: It absolutely does return information about whether or not the states executed successfully.
09:25 hemebond Also, it's `state.apply` now.
09:25 Andy__ "sudo salt '*' pillar.items" gives me { "<node>": { "docker-registries": { "<registry>": {"password": "<password>", "username": "<username>"}}}}
09:25 Andy__ I think I've translated that right...
09:26 felskrone hemebond: yes, but not a single field saying "all state have ran successfully", only "result: True|False" for
09:26 felskrone each state
09:27 Andy__ There is other pillar data in there, but the top level is my node name, first level down has 'docker-registries', level under that has my registry name
09:27 hemebond felskrone: It provides that summary at the very bottom in the highstate format.
09:27 hemebond But if it doesn't in the JSON format then just calculate it yourself.
09:27 babilen dubg: I also don't see a problem with defining extra user states in your firewall state (and configuring those formula style), but you *want* to use a generic state that is configured via pillars.
09:28 hemebond It's easy to parse.
09:30 ronnix joined #salt
09:30 vlebo joined #salt
09:31 Andy__ Neighbour: Found the --out=json option!  Here's the JSON format, shrunk to a single line and with irrelevant pillars removed: { "<node>": { "docker-registries": { "<registry>": { "username": "<username>", "password": "<password>" } } } }
09:33 dubg babilen: forget the "user" case, he is wrong anyway cause u can do "user.present" in a state. But for the state "firewall", i want to be able to call the state "firewall" with agument="apache" in the state apache
09:33 felskrone hemebond: will do, thanks
09:33 dubg and in parallel i want to be able to configure the state firewall in my pillar
09:34 dubg for other things
09:34 dubg i will take a look to map.jinja
09:35 aldevar1 joined #salt
09:35 dubg so for me it's a combination for + macro
09:36 babilen You either decide to configure it all in one place (and provide/merge the data necessary to do it) or you don't. The former allows for a generic state that is handled by defining data in multiple places, while the latter allows you to ship specific states that contain the data you want.
09:36 babilen dubg: I'd recommend to read https://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html
09:38 citaret_ joined #salt
09:41 dubg what is the main difference between a state and a formula?
09:41 dubg I thought that formula was just "offical" state
09:42 babilen Formulas are rather a state design pattern
09:42 babilen The basic idea is to write generic states for services that are entirely configured via pillars
09:45 dubg i see
09:45 dubg i will dive into map.jinja to see what is the purpose
09:45 dubg thanks for ur help :)
09:46 Trauma joined #salt
09:53 Venflon joined #salt
09:56 hemebond dubg: Basically just a collection of states.
09:59 Trauma joined #salt
10:03 Neighbour Andy__: Try passing your registry as a list to dockerng.login, instead of a single item
10:03 Venflon left #salt
10:03 Neighbour Andy__: salt minion dockerng.login '[my_registry]'
10:04 Neighbour on second thought, not sure if that's going to work :0
10:04 LondonAppDev joined #salt
10:05 Neighbour You could add debug-logging in the salt source files, and run your minion with `-l debug` (which is my standard approach if something's not working as I thought it should)
10:13 Praematura joined #salt
10:18 Tia joined #salt
10:18 Tia left #salt
10:21 fracklen joined #salt
10:50 fracklen joined #salt
10:55 rgrundstrom joined #salt
10:55 rgrundstrom Anyone have experience with molten? https://github.com/martinhoefling/molten
11:07 felskrone joined #salt
11:12 frew joined #salt
11:14 DEger joined #salt
11:21 dendazen joined #salt
11:23 alem0lars joined #salt
11:26 Whissi joined #salt
11:30 Andy__ Neighbour: Sorry, was AFK for a while.
11:30 Andy__ You're right, the list doesn't work, not accepted as a valid argument
11:31 Andy__ When you say 'salt source files', do you mean the Python files themselves?  Or is there a way of adding debug into the states and pillars etc?
11:31 Andy__ I'm guessing you mean Python...will give that a go
11:37 Neighbour Andy__: yep, the python files...in your case /usr/lib/python2.7/site-packages/salt/modules/dockerng.py
11:37 Andy__ OK, thanks, will have a look...  Finally gonna have to learn some Python ;)
11:38 Kelsar joined #salt
11:40 Neighbour Andy__: I suggest spamming `log.debug('{}: some text here {}'.format(name, variable_you_want_to_check))` and running the salt minion not as a service, but in a console with `-l debug`
11:42 Andy__ Well before even putting any log lines in, looking in the code pointed me at another thing to try - just seeing if I can get the particular pillar with `pillar.get`
11:42 Andy__ ...I can't
11:43 Andy__ So `sudo salt '*' pillar.get docker-registries` just returned '<node>:'
11:43 Andy__ Same with my other pillars
11:43 Andy__ These are things which seem to be successfully listed when I run `sudo salt '*' pillar.items`
11:44 nikdatrix joined #salt
11:44 colttt hi, in the states/top.sls is it possible to make something like  base: '*' - fooserver - exclude: - barfoo?
11:45 Andy__ Ahhhhhh
11:45 Andy__ I had to do a `sudo salt '*' saltutil.refresh_pillar` - then the `pillar.get` worked, and the login worked, too
11:46 dubg joined #salt
11:50 Trauma joined #salt
11:54 colttt Andy__: if you also use gitfs, I run everytime after a push:salt-run fileserver.update; salt '*' saltutil.refresh_pillar
11:55 Andy__ colttt: Thanks :).  I think we probably will use gitfs, though I'm still exploring a bit - is that generally how people manage this stuff?
11:56 Andy__ I've been thinking to provision a new cluster of master + minions, I would need to do some initial copying of files into /etc/salt on the master, but then set the master up as a minion of itself, and get everything else pulled in via gitfs, maybe even including 'salt-master config', so after the initial set up it can manage itself
11:56 Andy__ Or do people use packages or something to set up the master and manage configs?
11:56 colttt Andy__: Yes i think so, it has the benefit that everthing is documented (via comment in the git) and after holidays you can take alook into the git logs and see what happens
11:57 Andy__ Yeah, I'd certainly like to use Git if I can, just trying to figure out how it all works in practice.  Another thing I wondered about is how you would roll back a change?
11:57 colttt Andy__: thats a good questions..
11:58 Andy__ e.g. I use gitfs to pull in a formula which specifies the version of my application I use; to rollout I merge my latest release branch to master, do some salty magic to pull that latest commit in master down and apply the state
11:58 Andy__ I realise my application is broken and want to roll back - do I have to do that in Git, then re-apply?  It would be nice to refer to git tags when applying state, maybe.
11:59 colttt hello, is somthing like that possible: https://paste.debian.net/931971/
12:03 Neighbour Andy__: I run a minion on the same server as the master, they run nicely side-by-side
12:05 mat_ is it possible to access a grain from within a grain definition ? I need to get the num_cpus
12:06 DEger joined #salt
12:09 swills joined #salt
12:10 impi joined #salt
12:14 pbandark in jinja can I strip any character from the variable? for ex. if version='3.6.1'. I want to strip "1" and keep '3.6'. is it possible ?
12:15 Andy__ Neighbour: OK, thanks, that's what I was thinking, then you use gitfs to pull the master config down from Git?  Is the initial set up of the master always just a manual process?
12:16 dubg joined #salt
12:16 dubg Is it possible to call macro in pillar ?
12:16 rem5 joined #salt
12:21 thinkt4nk joined #salt
12:22 Tantagel joined #salt
12:27 Neighbour Andy__: I haven't gotten a good setup for that yet :)
12:27 djural joined #salt
12:28 Andy__ Fair enough.  Really I'm just trying to figure out how people manage this stuff in real life.  Do you have an approach for rollbacks?
12:30 GnuLxUsr joined #salt
12:30 deuscapturus joined #salt
12:34 Neighbour Andy__: use git to manage your salt config, states, modules, custom whatevers (states/modules/pillars/ext_pillars/etc)
12:38 Neighbour basically the content of /srv/salt (or wherever you have salt pointing it to)
12:39 Dr_Jazz I am thinking about moving a lot of our stuff to consul and just run masterless minions against consul
12:39 Dr_Jazz but I might have a special use-case ill admint
12:39 kiltzman joined #salt
12:42 numkem joined #salt
12:43 XenophonF joined #salt
12:45 devilfruit joined #salt
12:46 noobiedubie joined #salt
12:47 Trauma joined #salt
12:50 LondonAppDev joined #salt
12:54 N-Mi joined #salt
12:54 N-Mi joined #salt
12:55 deuscapturus joined #salt
13:16 kavakava joined #salt
13:16 c_g joined #salt
13:19 cibo joined #salt
13:19 cibo hello
13:20 cibo can anybody please help me with salt.client.localclinet().cmd()
13:20 ssplatt joined #salt
13:20 jas02 joined #salt
13:21 cibo I am using 2016.11.3
13:22 cibo and it looks like I am not able to get anything from full_return=True
13:22 cibo the output is the same like full_return=False
13:23 candyman89 joined #salt
13:23 cibo is there any way to get exit code?
13:24 SteamWells joined #salt
13:28 PatrolDoom joined #salt
13:29 PatrolDoom joined #salt
13:29 dyasny joined #salt
13:29 zerocoolback joined #salt
13:31 Trauma joined #salt
13:35 drawsmcgraw joined #salt
13:44 pcn cibo: it may be a documentation error, or it may be your problem here, but the documentation for localclient.cmd doesn't include full_return as an arg: https://docs.saltstack.com/en/latest/ref/clients/#localclient
13:47 thinkt4n_ joined #salt
13:47 amcorreia joined #salt
13:48 pcn cibo are you looking for the numerical return code because it's going to be used by you afterwards?
13:49 pcn cibo maybe instead you want to directly invoke the LocalClient.cmd_full_return() method?
13:49 hatifnatt Hello. Looks like I can't user special 'slspath' variable in Jinja template?
13:49 noobiedubie joined #salt
13:50 devilfruit left #salt
13:51 thinkt4nk joined #salt
13:52 englishm_work joined #salt
13:53 pcn Weird, the source in develop for that looks like it cmd(..., full_return=True) is implemented and documented
13:55 pcn cibo: in the 2016.11 branch the full_return flag isn't implemented in LocalClient.cmd from what I can see here: https://github.com/saltstack/salt/blob/2016.11/salt/client/__init__.py#L536-L642
13:57 pcn It's added here: https://github.com/saltstack/salt/commit/e444e7da62bcc0a32fe4c6ed7ea01c2d2a7ecd34
13:57 cibo pcn: you write
13:58 cibo pcn: I am looking for return code to handle script errors
13:59 cibo without parsing output
14:00 pcn So you're looking for true/false, and arent worried about the number?
14:00 hatifnatt Construction like '{%- import_yaml slspath ~ "/defaults.yaml" as defaults %}' work fine in sls state. But fails with 'SaltRenderError: Jinja variable 'slspath' is undefined' if used in templated config file.
14:00 zerocoolback joined #salt
14:02 babilen hatifnatt: A template is not a SLS file and therefore doesn't have slspath
14:02 babilen Why not use "import_yaml "defaults.yaml" as default" ?
14:03 cibo pcn: true/false would work fine, but salt.utils.check_state_result not working (
14:03 colttt with salt -I 'roles:webserver' test.ping i got all server with the role webserver, but withsalt "*" pillar.ls I see only "- roles" but i don't know in which roles are the server, does exist an solution for that?
14:04 cibo pcn: and I do not know other ways
14:06 aldevar joined #salt
14:08 evle joined #salt
14:08 colttt and is it possible to make an salt -I 'roles' test.ping ? I want to just ping the server that have a role, it doesn't matter which one
14:08 pcn cibo try cmd_full_return
14:09 icebal colttt, salt -G 'role: True' test.ping should do it if its a grain
14:09 drawsmcgraw I don't suppose anyone has any progress (or experience) with this issue? https://github.com/saltstack/salt/issues/24925
14:09 saltstackbot [#24925][OPEN] reload_modules: True does not reload module dependencies | Hi,...
14:09 pcn Ah, no.  I see it judges whether the state completed, but not whether the command completed
14:09 colttt ok but it is a pillar
14:09 icebal ooo
14:10 colttt icebal: ok, but it is a pillar
14:10 tkharju joined #salt
14:10 deuscapturus joined #salt
14:10 hatifnatt babilen: Souds legit.  But I have tried it already. Got error.
14:11 hatifnatt babilen: '{%- import_yaml "defaults.yaml" as defaults %}' 'TemplateNotFound: defaults.yaml '
14:11 cibo pcn: ok, checking it now
14:11 pcn So the execution cache should have that info, just got to see if you can get that
14:11 colttt icebal: salt -I 'role:*' test.ping works
14:12 pcn cibo: it doesn't seem like cmd_full_return works, it checks that the state completed not whether the command returned successfully
14:12 icebal colttt, totally what i meant :P
14:12 icebal colttt, its still early here lol
14:14 sarcasticadmin joined #salt
14:14 jvelasquez joined #salt
14:14 keldwud joined #salt
14:15 babilen hatifnatt: Anything "special" about your setup that we should know?
14:16 colttt icebal: ahh ok, in Germany its 4pm ;)
14:16 hatifnatt babilen: Nothing, I will provide file structure in a minute.
14:16 babilen hatifnatt: So you are not using salt-ssh?
14:17 Trauma joined #salt
14:17 hatifnatt babilen: No I don't use salt-ssh
14:18 alem0lars joined #salt
14:22 cibo pcn: echo 1 results to -> {'43094b1b-50ad-4985-9d32-bcdae776399c': {'success': True, 'ret': '1'}} it returns success True if it fails too
14:24 hatifnatt babilen: https://pastebin.com/nPGrPjrN everyting very simple
14:25 pcn cibo: have you tried: lc.cmd('saltmaster', 'cmd.retcode', ['/bin/false'])
14:26 pcn cibo: substitute 'saltmaster' with whichever minion you're targeting
14:27 babilen hatifnatt: Does it work if you specify the correct relative path manually in lieu of slspath ?
14:28 babilen (so on line 14 in your paste)
14:29 hatifnatt babilen: babilen: yes if I specify '{%- import_yaml "role/haproxy_csync2/defaults.yaml" as defaults %}' - everyting is fine
14:29 babilen Please also support the green ribbon campaign for cleaner pastebins and boycott pastebin.com (or at least use raw) in favour of one of http://paste.debian.net, https://gist.github.com, http://sprunge.us, … (or any other pastebin without ads and "social media integration") ;)
14:29 pcn I don't understand why regular cmd.run doesn't provide the retcode in the returner, it seems like it should if I understand the path from localclient.cmd down to https://github.com/saltstack/salt/blob/2016.11/salt/modules/cmdmod.py#L626
14:29 babilen hatifnatt: But if you include "slspath" in there you get the error that that variable isn't defined?
14:30 babilen (just checking)
14:30 noobiedubie joined #salt
14:30 cyteen joined #salt
14:30 hatifnatt Ok I will recommended pastebin in future.
14:30 hatifnatt babilen: sure with slspath variable I got error.
14:32 drawsmcgraw joined #salt
14:32 babilen hatifnatt: tpldir ?
14:32 cibo pcn: it allways return 0
14:33 austin_ joined #salt
14:34 austin_ i'm trying to import a yaml file via {% import_yaml 'mmap.yml' as mmap %}. that file is in the same dir as the state file calling it
14:34 austin_ yet it can't find it
14:34 austin_ seems the import path is not relative
14:35 babilen austin_: Where are you doing this?
14:35 austin_ in the sls
14:35 austin_ i need that yml as a lookup map for something
14:35 hatifnatt Yes that my second question which one is better / right 'slspath' or 'tpldir'. I haven't found any mention about 'tpldir' in documentation right now. But saw it in GitHub issue.
14:35 babilen austin_: Use {% import_yaml slspath ~ '/mmap.yml' as mmap %}
14:36 babilen hatifnatt: So, you can confirm that tpldir works?
14:36 babilen hatifnatt: https://github.com/saltstack/salt/blob/develop/salt/utils/jinja.py#L121
14:36 austin_ @babilen: please tell me jinja concat is `~`
14:36 babilen austin_: Jinja string concatenation is ~
14:36 babilen (happy now?)
14:36 austin_ fml
14:37 austin_ like multiple sighs
14:37 cibo pcn: I am running it on windows slave
14:37 babilen Why the sadness?
14:37 austin_ babilen: because i was like why isn't `+` working
14:37 austin_ wtf
14:37 austin_ haha
14:37 austin_ anyway, that did the trick. thanks babilen
14:38 hatifnatt babilen: unfortunately no '{%- import_yaml tpldir ~ "/defaults.yaml" as defaults %}' error 'SaltRenderError: Jinja variable 'tpldir' is undefined'
14:38 cibo pcn: may be this is the reason, because I do not see peed or std out feelds
14:38 austin_ idk about tpldir
14:38 austin_ but slspath is what i used
14:38 babilen austin_: + is for adding two objects, ~ is for string concatenation. + has also been overridden for string to concatenate them. So 2+2 -> 4, while 2 ~ 2 → "22"
14:38 babilen hatifnatt: Which version do you use?
14:39 austin_ tpldir works (2016.11.3)
14:39 hatifnatt babilen: 2016.11.3+ds-1
14:40 dendazen joined #salt
14:41 babilen austin_: Please note that I am discussing a related problem with hatifnatt also. We were looking at tpldir in the context of his/her problem. As you are importing in a SLS you can use slspath
14:42 hatifnatt Yes slspath works flawless in state file.
14:43 babilen hatifnatt: The code (and PR) for the jinja renderer looks as if tpldir should be available in the context of jinja templates
14:44 brousch__ joined #salt
14:44 babilen austin_: I guess that you might want to use tpldir also
14:45 austin_ slspath or tpldir works for my use case without issue
14:45 austin_ i just know that slspath is actually documented
14:45 racooper joined #salt
14:46 cibo pcn: may be it would help me if I install 2017.5
14:46 cibo ?
14:46 babilen 2017.5 has been released?
14:47 mat_ Mmm, is it possible to get a "rendered" .sls file ? as in, after jinja processed it
14:48 cibo babilen: no but there is archlinux rpm
14:48 cibo + vagrant allows to install from dev
14:48 cibo install from dev for windows
14:49 hatifnatt babilen: last version which I can get from repo.saltstack.com is 2016.11.4+ds-1 0
14:49 babilen Ah, so the HEAD of develop is being packaged as 2017.5 ?
14:49 babilen hatifnatt: Yeah, that's cool
14:50 onlyanegg joined #salt
14:50 cibo https://altlinux.pkgs.org/sisyphus/classic-noarch/salt-minion-2017.5-alt1.noarch.rpm.html
14:50 N-Mi joined #salt
14:51 hatifnatt So I need to switch to git version of Salt? I already have thoughts about it, but repo is easier way :)
14:53 Sketch don't forget you need to upgrade your master before you upgrade your minions.
14:53 tiwula joined #salt
14:53 * Sketch isn't sure why everyone suddenly wants to install a dev version of salt
14:54 cyborg-one joined #salt
14:54 hatifnatt Sketch: because it have a lot of fixed bugs and features I personally need.
14:55 Sketch probably plenty of new bugs too ;)
14:55 Sketch but hey, someone's gotta be a beta tester :)
14:55 hatifnatt This one discussed above not the first
14:57 hatifnatt I have relatively small amount of states but 'Issues' section on GitHub is already my "best friend" :)
14:58 hatifnatt So is there any way to get 2017.5 as package on git is only option?
14:58 hatifnatt *or git
14:59 lubyou joined #salt
15:00 babilen hatifnatt: I don't think you have to switch to git HEAD
15:02 hatifnatt babilen: Then for now I can't import relatively in template?
15:04 babilen hatifnatt: Looks like it
15:04 babilen But then we are, more or less, at the same point right now. My feeling is that tpldir *should* work, so I'm not sure why it doesn't or what I/we are misunderstanding
15:06 hatifnatt Ok I can live with it. Will update my code when new wersion will be released. babilen thanks for help!
15:07 babilen hatifnatt: Why do you think that a new version will address this?
15:12 hatifnatt babilen: Hmm looks like code you refecenced above is same for 2016.11 and develop branch. Than new release probably will not fix my issue.
15:12 babilen (hence my question)
15:13 zerocoolback joined #salt
15:14 DammitJim joined #salt
15:15 DammitJim if I have not defined a variable 'timeout' in pillar, why is it that in my jinja template, this doesn't work?
15:16 DammitJim <session-timeout>{%- if pool['timeout'] is defined %}{{ pool['timeout'] }} {%- endif %}</session-timeout>
15:16 rem5 joined #salt
15:16 DammitJim oh, nevermind... I just figured it out
15:16 DammitJim blah
15:17 ssplatt joined #salt
15:18 Splix76 joined #salt
15:19 coredumb Hey there
15:19 Splix76 left #salt
15:19 Splix76 joined #salt
15:20 coredumb appart from state.template, is there a way to make salt-call --local execute a local state file that's not in the default file_roots ?
15:22 dragon788 joined #salt
15:22 coredumb or any other way actually to locally run an arbitrary sls file
15:23 babilen That sounds like a path into madness
15:23 drawsmcgraw joined #salt
15:24 coredumb babilen: oh maybe not :)
15:24 coredumb state.template seems to do the job quite nicely actually
15:24 coredumb was just wondering if there was a "better" way
15:25 fracklen joined #salt
15:29 Praematura joined #salt
15:30 nickadam joined #salt
15:32 babilen hatifnatt: fwiw, what are you actually trying to do in the template? If you were to use a map.jinja (as detailed in the formula conventions chapter), you could import the resulting foo_settings bit into your template.
15:35 hatifnatt babilen: I'm trying to specify defaults in one place and the use the in state and in config template too.
15:36 hatifnatt *then use them
15:39 foundatron joined #salt
15:39 riftman joined #salt
15:41 babilen hatifnatt: Take a look at https://github.com/saltstack-formulas/template-formula/tree/master/template and the way map.jinja, defaults.yaml and files are structured in there
15:43 babilen Also note that the path to defaults.yaml is given relative to file_roots
15:44 babilen You could also file a bug about that tpldir problem .. My impression is that it should be defined, but it obviously isn't traversing that code path during template rendering
15:47 hatifnatt babilen: That's exactly what I'm trying to avoid - specify path relative to file_roots :)
15:47 babilen I hadn't noticed ;)
15:47 dps joined #salt
15:48 hatifnatt babilen: Above you referenced utils/jinja.py but I can't see it in error traceback http://paste.debian.net/hidden/62237407/ only utils/template.py where tpldir only defined in 'sls' context
15:48 rmelero joined #salt
15:50 babilen hatifnatt: I'd argue that you want tpldir et al to be defined everywhere
15:50 babilen (that is in non SLS templates also)
15:51 dps joined #salt
15:53 Brew joined #salt
15:54 dezertol joined #salt
15:54 futuredale joined #salt
15:57 hatifnatt babilen: adding map.jinja increase complexity wich I don't need in simple state with 5-6 id's and still doesn't solve relative path problem as far as I understand.
15:57 mpanetta joined #salt
15:58 mpanetta joined #salt
16:00 thinkt4n_ joined #salt
16:01 babilen hatifnatt: You'd use it if you want to incorporate platform specific settings and be able to (selectively) override defaults via pillars
16:01 babilen A bug report in which you ask for tpldir would, IMHO, be entirely justified
16:03 pipps joined #salt
16:04 thinkt4nk joined #salt
16:04 pipps joined #salt
16:10 aldevar left #salt
16:10 hatifnatt babilen: I found this http://stackoverflow.com/a/34345785/2444141 solution wich I like for its simplicity, it fullfill my current needs. map.jinja + defaults.yaml looks way too complex for me for now I don't fully undersand what it does / how it work.
16:14 babilen hatifnatt: That is a
16:14 babilen quite uncommon approach, but sure .. use what suits your requirements
16:15 babilen I mean, apart from line 11-23 (the platform specific bit) it is almost as complex as https://github.com/saltstack-formulas/template-formula/blob/master/template/map.jinja while not nearly as powerful/extensible
16:18 bennabiy joined #salt
16:18 dps joined #salt
16:19 bennabiy Is there a list of best practices somewhere which covers the proper formatting for .sls files (I know there are many ways to do it, but it would be nice to have a solid goto for an answer)
16:20 bennabiy SneakyPhil: you got mentioned in the SaltStack video done by DevOps Library
16:25 hatifnatt babilen: yes it's almost same but lines 22 - 25 confuse me a bit, now I re read whole example like 5 times and I think I began to understand what it does.
16:26 dps joined #salt
16:26 hatifnatt babilen: and about bug report, how can I report a bug about 'tpldir' which is not documented anywhere? :)
16:29 pipps joined #salt
16:30 KyleG1 joined #salt
16:31 babilen hatifnatt: It's in the code, has been mentioned in other bug reports and, I'd argue, has a clear usecase. The fact that it hasn't been documented is a bug in and of itself
16:32 candyman89 joined #salt
16:34 chowmeined joined #salt
16:36 hatifnatt babilen: I will file a bug report. It's better to provide "proof of concept" or description will be enough?
16:37 edrocks joined #salt
16:37 babilen I think a description is fine. Shouldn't be too hard to see the value of this.
16:38 SneakyPhil bennabiy: can I get a link to that please?
16:38 SneakyPhil thanks for the heads up!
16:39 bennabiy https://www.youtube.com/watch?v=AsvVp-ldT2Q
16:39 bennabiy Rigth at the beginning (about 13 seconds into it)
16:40 SneakyPhil :D
16:40 bennabiy SneakyPhil: I was hoping for more information on those things as well. Did you find them?
16:40 SneakyPhil I remmember that now. Oh jees it was a good 2 years ago
16:41 bennabiy yes
16:41 SneakyPhil I'll rewatch the video and get back to you on that
16:41 bennabiy They said there were going to be more, but that was basically the last one
16:45 bd joined #salt
16:46 Lionel_Debroux joined #salt
16:46 viq joined #salt
16:47 SneakyPhil bennabiy: just in case I forget, ping in a day
16:49 raspado joined #salt
16:59 rathier joined #salt
17:00 fracklen joined #salt
17:01 bennabiy SneakyPhil: will try ;)
17:04 wendall911 joined #salt
17:05 nixjdm joined #salt
17:05 onlyanegg joined #salt
17:09 _JZ_ joined #salt
17:11 jab416171 joined #salt
17:12 pipps joined #salt
17:19 candyman89 joined #salt
17:22 rem5_ joined #salt
17:27 impi joined #salt
17:33 nikdatri1 joined #salt
17:40 fracklen joined #salt
17:44 fracklen joined #salt
17:45 SaucyElf joined #salt
17:45 hashwagon joined #salt
17:47 sjorge joined #salt
17:48 jas02 joined #salt
17:49 fracklen joined #salt
17:50 nixjdm joined #salt
17:53 cyteen joined #salt
17:57 nethershaw joined #salt
17:57 Trauma joined #salt
18:03 kiorky joined #salt
18:03 ChubYann joined #salt
18:04 drawsmcgraw joined #salt
18:05 aneeshusa joined #salt
18:08 DEger joined #salt
18:11 ronnix joined #salt
18:15 aldevar joined #salt
18:20 toanju joined #salt
18:21 pipps joined #salt
18:23 aldevar left #salt
18:23 sp0097 joined #salt
18:26 SaucyElf joined #salt
18:30 onlyanegg joined #salt
18:33 keldwud joined #salt
18:38 cyborg-one joined #salt
18:49 juntalis joined #salt
18:49 jauz joined #salt
18:50 nixjdm joined #salt
18:50 impi joined #salt
18:52 onlyanegg joined #salt
18:59 DEger joined #salt
19:04 hashwagon good day, gentle{men,women}
19:07 tapoxi joined #salt
19:09 MajObviousman silly question, but how long does it take for a salt-minion to recognize that its connection to the master is toast and start retrying?
19:10 MajObviousman I see master_alive_interval: 30 in the minion config, but I just tested it and the minion didn't figure it out even after a full minute
19:11 DEger joined #salt
19:13 cyteen joined #salt
19:17 jhauser joined #salt
19:20 onlyanegg joined #salt
19:26 jhauser joined #salt
19:29 Praematura joined #salt
19:30 DEger joined #salt
19:34 rem5 joined #salt
19:38 sjorge joined #salt
19:40 mikecmpbll joined #salt
19:44 edrocks joined #salt
19:45 edrocks joined #salt
19:47 q1x joined #salt
19:50 nixjdm joined #salt
19:55 jas02 joined #salt
19:58 pipps joined #salt
20:03 patvz joined #salt
20:03 fracklen joined #salt
20:03 hasues joined #salt
20:04 hasues left #salt
20:10 salty12b joined #salt
20:10 patvz ahoy, i have a state to create a pagerduty event when a http check fails using `onfail:`, does anyone know if i can do this without including said pagerduty state as i dont want it to run unless there is a failure
20:15 rmelero you could wrap the state in a jinja if https://docs.saltstack.com/en/latest/topics/jinja/index.html#jinja-in-states
20:16 prg3 joined #salt
20:17 Trauma joined #salt
20:19 nikdatrix joined #salt
20:24 patvz yea i suppose i could make a marker when it fails and create an if around that but seems overly complex. I just need salt to aware of a state it is not actively running
20:27 heaje joined #salt
20:37 prg3 joined #salt
20:40 MTecknology salt-call pillar.data >t; du -h t  => 137K
20:40 MTecknology best part... that's likely the smallest amount of pillar data any minion has
20:41 Bock joined #salt
20:44 Bock joined #salt
20:50 nixjdm joined #salt
20:58 ronnix joined #salt
20:59 pipps joined #salt
21:07 dps joined #salt
21:09 Trauma joined #salt
21:12 vlebo joined #salt
21:20 dps joined #salt
21:21 jhauser joined #salt
21:24 shanth joined #salt
21:26 shanth i have read the tutorial and the book mastering salt but im still stuck on how to proceed with managing a large amount of hosts. say i have 100 hosts and they have /tmp/foo.conf which is basically all the same except for one line that is specific to each host. what's the best way to define that one bit of changing data? pillars, jinja map?
21:26 shanth :(
21:27 shanth i basically dont want to end up stuck managing 100 files each time i run into a config file where the data is different per host
21:28 rmelero grains would be better for data that is constantly changing
21:28 shanth in this case the data wouldn't change, the data would just be different for each of the hosts
21:28 shanth host 1 the data would be a, host 2 the data would be b , etc
21:29 rmelero then it depends where the data is collected. if the data exists on the minion, grains, if exists on master, pillars
21:29 shanth cant wrap my head around using jinja to properly map it to that one piece of different data
21:29 whytewolf really depends on what you want. map.jinja is great for setting up a default. then pull data that would be different from grains or pillar. or external source
21:30 shanth so if i had /tmp/fruit.txt and i had 100 hosts. the file is only one line and on each host the piece of fruit would be different. where would i map the fruit names? apple, bananna, canteloupe, etc. a pillar file?
21:31 shanth host1  = apple, host2 = bananna
21:31 shanth do i have to make 100 files and map each one to each host in the top.sls for the pillar? Host 1 - apple.sls Host 2 - bananna.sls :(
21:31 whytewolf well, would be hundreds of different pillars. or maybe an ext_pillar [which still gets mapped to pillar]
21:32 whytewolf with an ext_pillar you could setup a database to hold that info
21:32 shanth is salt good at this kind of thing? managing files where the data is slightly different or does it excel when the data is all the same?
21:33 whytewolf i havn't had a problem with it
21:33 shanth cause my practical problem is setting the IP to listen on in sshd_config
21:33 shanth each of my servers has multiple adaptors. :(
21:33 whytewolf although normally the "single item being different" is something inherent to the system that is looked up such as an ip
21:34 shanth i cant figure out in my head what i need to make to map the ip's or which adaptor to use. do i need to do an external database?
21:34 shanth yes exactly whytewolf
21:34 rmelero reclass can be used to template pillar data easier than basic yaml http://www.tmartin.io/articles/2014/infra-mgmt-using-salt-and-reclass/
21:34 whytewolf shanth: is the ip you need to look up have something in common like a subnet?
21:35 rmelero you could do a mine function that collects interface info and that translates to grains
21:35 shanth different vlans whytewolf
21:35 shanth sometimes the interface is em0 sometimes it is em1 or em2, how can i easily map it to the right interface for each host to iterate over?
21:36 whytewolf thats why i was asking if there was anything common. not the differences
21:36 shanth host1 is em0 host1 is em0 host2 is em1, host3 is em2
21:36 rmelero http://stackoverflow.com/questions/30931154/salt-mine-for-all-network-interfaces
21:36 whytewolf rmelero: don't need a mine
21:36 whytewolf it is on the system in question
21:36 shanth ill read that post thanks rmelero
21:36 shanth gotta run for a bit
21:38 whytewolf ahh yeah the first answer had the right answer for that. don't use mine for the local system :P
21:39 relidy With the iptables state, is there a way to ensure the entries I specify via my state(s) are the *only* entries in the chain other than flushing the chain every highstate?
21:39 rmelero hmm ok. all our formulas collect the interface info from a mine function. figured it was the ideal way to do it
21:40 whytewolf anyway shanth if you can at least minimize the datasets. you can lower the number of datapoints you need. say if you only have 4 interfaces you can make 4 pillar files. and do a lookup of ip based on the interface.
21:40 whytewolf rmelero: if it was going from one host to another yes.
21:41 jas02 joined #salt
21:41 rmelero ah yea. like configuring a cluster where you need network info from host b,c on host a to build a node list
21:41 whytewolf exactly
21:43 drawsmcgraw1 joined #salt
21:50 Guest97338 joined #salt
21:51 nixjdm joined #salt
21:56 CeBe hi, I am trying to figure out how to match a string in jinja. could neither find anything useful in salt related docs or jinja docs so far.
21:56 CeBe {% if grains.fqdn matches 'dvm*.example.com' %}
21:56 CeBe something like that
21:57 hemebond CeBe: Jinja can't match regex
21:57 CeBe hemebond: can it match parts of a string, e.g. beginswith/endswith?
21:57 hemebond Yes
21:57 aneeshusa joined #salt
21:58 hemebond You also have https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.match.html if applicable.
21:59 CeBe can you tell me how or where I can find the docs about it?
21:59 CeBe I mean jinja string matching
22:00 CeBe the salt matching works like {% if salt.match. ... %} ?
22:02 CeBe {% if salt.match.grain_pcre('fqdn:dvm(\d+)\.example.com') %} seems to work.
22:02 CeBe thank you hemebond!
22:03 edrocks joined #salt
22:04 pipps99 joined #salt
22:06 sp0097 Hi, I am running into an issue where salt-run jobs.active takes a long time to return
22:07 sp0097 Previously, it would return in milliseconds
22:07 sp0097 I tried to clear the cache.   salt-run cache.clear_all
22:07 sp0097 False
22:08 sp0097 Any ideas as to why it’s running so slow and what do to correct?
22:08 pcn how large is your job cache?
22:08 sp0097 not sure, how do I check?
22:11 pcn salt-run jobs.list_jobs
22:12 sp0097 oh, rather large, 185
22:13 pcn gtmanfred: are there examples of using thorium?  I'm trying it out and I can't find out to use e.g. check.contains.  The docs don't really show much about the data that it's working on.
22:13 sp0097 (larger than I expected )
22:13 sp0097 pcn:  how do I clear them?
22:13 pcn sp0097: That still seems like a trivial size for listing.
22:14 rmelero have you eliminated host level issue like disk io, ram, cpu etc?
22:18 sp0097 ~29% use of disk, 4 cpu, 8gb of ram
22:18 sp0097 not too much load atm
22:19 rmelero an idea would be to attach strace to the salt-master instance and you might be able to spot where it's hanging
22:20 nikdatrix joined #salt
22:20 rmelero strace -p <pid of salt-master>
22:21 rmelero also using dstat to get an overall picture of your hosts resource usage
22:21 DEger joined #salt
22:21 sp0097 ok, trying strace to see ( first time using it for me )
22:22 sp0097 select(0, NULL, NULL, NULL, {10, 0})    = 0 (Timeout)
22:23 DanEz joined #salt
22:23 rmelero you need to look up higher to see what the '0' file descriptor is. there'll be an open(blah) = 0 higher up
22:31 sp0097 ok, I think it was due to some minions that were offline, taking a while for commands to return.
22:31 sp0097 I deleted the keys for those minions and now salt-run seems to be snappy
22:33 pcn Ah, that makes sense
22:33 sp0097 trying the deployment again…
22:33 sp0097 It seems a lot better now.
22:34 sp0097 thank you for the help.  :)
22:38 pipps joined #salt
22:38 pcn Cool.  It was all you.
22:39 pcn So, no-one has used thorium at all?
22:40 whytewolf not really. most people just use normal reactors to get things done
22:40 keldwud joined #salt
22:40 Praematura joined #salt
22:41 whytewolf not to mention this line in the docs tend to push people away
22:41 pcn Yep, I know the one.
22:42 whytewolf "Thorium was added to Salt as an experimental feature in the 2016.3.0 release, as of 2016.3.0 this feature is considered experimental, no guarantees are made for support of any kind yet."
22:42 pcn Still, having made it into the mainline, and supporting some kind of logic for reactors seems attractive enough that it would get some love and some fixing
22:43 pcn I guess the main question is whether it's wild west, or abandoned.
22:44 whytewolf well someone touched it 2 months ago.
22:52 onlyanegg In the faq, it says that you shouldn't run different versions of the master and minion. https://docs.saltstack.com/en/latest/faq.html#can-i-run-different-versions-of-salt-on-my-master-and-minion I assume this doesn't apply to minor versions though (eg. 2016.11.3 vs 2016.11.4)
22:53 onlyanegg Is that right?
22:55 whytewolf onlyanegg: well really it says they should match. but in all cases master should at the very least be higher then minion
22:56 whytewolf well higher then or equil
22:58 whytewolf and. in your example. it is possable a 2016.11.3 master would break against a new 2016.11.4 minion [as there was a minor change that happend to cert that cause new certs to have an RSA in the name. and 2016.11.3 doens't know how to handle that
23:03 onlyanegg ok, got it. thx
23:28 DEger joined #salt
23:34 rmelero I'm thinking of making a salt bae module
23:34 rmelero https://www.youtube.com/watch?v=J5GGG0PaSe4
23:41 hemebond gtmanfred: Regarding https://github.com/saltstack/salt/issues/38971 does source_hash also cause the file to be downloaded each time?
23:41 saltstackbot [#38971][OPEN] archive.extracted: lots of unnecessary file transferring, copying, and hashing | It looks like archives are being downloading when they don't need to be and duplicated in the cache. In this case I've got a large zip file to extract; I don't want to have the contents of this file checked every time state is applied (there are 1000's of files in there) so I'm using `if_missing` to indicate when the archive is already extracted....
23:42 dezertol joined #salt
23:44 aneeshusa joined #salt
23:49 xmiao joined #salt
23:50 dezertol joined #salt
23:50 druonysus joined #salt
23:51 Deliant joined #salt
23:53 jas02 joined #salt

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