Perl 6 - the future is here, just unevenly distributed

IRC log for #salt, 2016-01-22

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

All times shown according to UTC.

Time Nick Message
00:04 strangecolor joined #salt
00:14 ageorgop joined #salt
00:15 dyasny joined #salt
00:15 cpelon joined #salt
00:16 cpelon has anyone here used the mysql returner?
00:21 zmalone joined #salt
00:22 keimlink_ joined #salt
00:25 baweaver joined #salt
00:27 shoemonkey joined #salt
00:28 digitalhero joined #salt
00:28 digitalhero joined #salt
00:31 brianfeister joined #salt
00:35 murrdoc every single minion  needs mysql access
00:36 otter768 joined #salt
00:45 benjison joined #salt
00:45 benjison JOIN
00:46 benjison left #salt
00:47 amcorreia joined #salt
00:47 benjison joined #salt
00:47 Pie_Mage SELECT
00:47 benjison hello world
00:50 sixninetynine joined #salt
00:50 blue0ctober joined #salt
00:55 geekatcmu DELETE
00:55 kevinquinnyo1 joined #salt
00:58 digitalhero joined #salt
01:00 digitalhero joined #salt
01:03 ropes joined #salt
01:04 Corey joined #salt
01:04 terinjokes joined #salt
01:05 invsblduck joined #salt
01:10 baweaver joined #salt
01:11 invsblduck hallo.  debugging some `service' state stuff on sles 11 and can't figure out why __salt__ is being repacked with generic service.py module after `./salt/modules/rh_service.py' __virtual__() is returning a valid __virtualname__ for `service'.  my "printf debugging" has lead me to see that both are being loaded and then the generic/fallback one is being used in the end.  anyone familiar with the module-loader
01:11 invsblduck code before i go digging?
01:11 zmalone joined #salt
01:14 invsblduck Put another way, the service.running state is using generic service.py module provider instead of the rh_service.py module, which i've verified the latter has a good __virtual__() and in fact returns `service' at some point during the state.sls run.
01:16 lompik joined #salt
01:17 invsblduck ^ [TRACE   ] Loaded rh_service as virtual service
01:17 otter768 joined #salt
01:22 invsblduck I then see: "[DEBUG   ] LazyLoaded service.running", which proceeds to use `__salt__['service.status']()' from generic service.py (not rh_service.py)!
01:23 invsblduck what gives?
01:27 rem5 joined #salt
01:30 * invsblduck delving into loader.py
01:30 digitalhero joined #salt
01:43 * Pie_Mage hands invsblduck a snorkel
01:47 invsblduck What a mess.  There is ./modules/debian_service.py and ./modules/upstart.py, the latter of which is being virtual-loaded on ubuntu.  However, they will both do `service <name> status', so who knows.
01:48 invsblduck You have to, you know...like, `import logging' and add some f*@%ing debugging to figure out which it is actually using.
01:50 hasues joined #salt
01:50 hasues left #salt
01:52 invsblduck ( I don't have an irc bouncer set up right now, so I have to part and rejoin later. )
01:52 invsblduck left #salt
01:57 digitalhero joined #salt
02:01 mpanetta joined #salt
02:06 ageorgop joined #salt
02:08 digitalhero joined #salt
02:14 bhosmer joined #salt
02:14 michelangelo joined #salt
02:14 kevinquinnyo1 joined #salt
02:16 zmalone joined #salt
02:20 catpigger joined #salt
02:22 quasiben joined #salt
02:27 tmclaugh[work] joined #salt
02:35 zmalone left #salt
02:39 digitalhero joined #salt
02:51 digitalhero joined #salt
02:54 justanotheruser joined #salt
02:55 blckbit10 joined #salt
02:58 otter768 joined #salt
03:01 digitalhero joined #salt
03:01 ageorgop joined #salt
03:07 berserk joined #salt
03:08 bhosmer joined #salt
03:17 shanemhansen left #salt
03:17 digitalhero joined #salt
03:17 larsfronius joined #salt
03:20 digitalhero joined #salt
03:23 larsfron_ joined #salt
03:24 evle joined #salt
03:28 _ikke_ joined #salt
03:29 larsfronius joined #salt
03:51 quasiben joined #salt
03:54 kimball joined #salt
04:02 bhosmer joined #salt
04:03 larsfronius joined #salt
04:12 ramteid joined #salt
04:14 dyasny joined #salt
04:28 mpanetta joined #salt
04:36 om joined #salt
04:41 digitalhero joined #salt
04:42 digitalh_ joined #salt
04:47 ageorgop joined #salt
04:48 brianfeister joined #salt
04:49 brianfeister joined #salt
04:52 hightekvagabond joined #salt
04:54 anmol joined #salt
04:54 tmclaugh[work] joined #salt
04:56 bhosmer joined #salt
05:02 rdas joined #salt
05:04 anmol joined #salt
05:06 pmcg joined #salt
05:09 anmol joined #salt
05:14 pmcg joined #salt
05:34 _JZ_ joined #salt
05:36 digitalhero joined #salt
05:39 shoemonkey joined #salt
05:52 hightekvagabond can I jinja inside a jinja in an sls?
05:54 hightekvagabond For example, if I want the ip of eth0 I can get it with this code:  {{ salt['network.interfaces']()['eth0']['inet'][0]['address'] }}   but if I want to configure a custom grain per machine to say which network device I want the ip for is there a way to use a grain instead of eth0?
05:57 ageorgop joined #salt
06:03 Pie_Mage hightekvagabond: you can use a grain
06:04 Pie_Mage I think pillars are the more accepted way of handling it
06:05 Pie_Mage {{ salt['network.interfaces']()[salt['grain'get']['ethernet_fanciness_value']]['inet'][0]['address'] }}
06:05 Pie_Mage i think that's how it is using jinja...
06:05 Pie_Mage my syntax could be off, but that's the general idea
06:05 calvinh joined #salt
06:07 av_ joined #salt
06:22 kshlm joined #salt
06:25 _JZ_ joined #salt
06:35 hightekvagabond it was simpler than that, turns out I just had to replace 'eth0' with grains.dcinterface which is the name of my grain and it worked
06:38 Pie_Mage huzzah!
06:38 Pie_Mage \o/
06:44 joejoba joined #salt
06:45 bhosmer_ joined #salt
06:45 NV joined #salt
06:49 malinoff joined #salt
07:07 _JZ_ joined #salt
07:08 zulgabis joined #salt
07:09 ageorgop joined #salt
07:20 k_sze[work] joined #salt
07:21 k_sze[work] Can I run salt and only do one particular state?
07:21 Pie_Mage yes!
07:22 Pie_Mage salt 'somesystem.yourorg.com' state.sls network.external_firewall_rules
07:22 k_sze[work] but that would do a whole sls file.
07:22 Pie_Mage yes it would!
07:22 k_sze[work] I want one state in an sls file.
07:23 Pie_Mage ahh ok
07:23 Pie_Mage there is a function for that
07:23 k_sze[work] (while letting salt resolve the dependencies that may lie in other sls files)
07:23 Pie_Mage sls_id
07:23 k_sze[work] state.single, I think.
07:23 cilkay joined #salt
07:23 Pie_Mage https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.state.html
07:23 Pie_Mage reference to the salt state module
07:25 Pie_Mage it should work for resolving all the other dependencies
07:26 Pie_Mage for most of these functions you can pass test=true and it'll dry-run the state, so you don't wind up breaking stuff if it doesn't run correctly
07:27 Pie_Mage then you can experiment freely :D
07:30 k_sze[work] It's not resolving a dependency. :(
07:30 Pie_Mage you mean imports specifically?
07:32 pwalsh joined #salt
07:32 colttt joined #salt
07:33 rominf joined #salt
07:37 netcho joined #salt
07:40 shoemonkey joined #salt
07:40 hightekvagabond hmmm…. So, I can get file.replace to work, but the append_if_not_found is not working with it:
07:41 hightekvagabond file.replace:
07:41 hightekvagabond - name: /home/gmuser/testreplace
07:41 hightekvagabond - pattern: fart = .*
07:41 hightekvagabond - repl: fart = stinks
07:41 hightekvagabond - not_found_content: fart = stinks
07:41 hightekvagabond - count: 1
07:41 hightekvagabond - append_if_not_found: True
07:42 hightekvagabond when I have "fart = foo" in testreplace it replaeces fine, but if the line isn't there it doesn't append
07:43 pwalsh joined #salt
07:45 Pie_Mage what version of salt are you using?
07:46 hightekvagabond salt 2015.5.3 (Lithium)
07:46 Pie_Mage it should be there!
07:46 hightekvagabond I agree
07:47 hightekvagabond but I get this result by setting my state:
07:47 hightekvagabond ID: /home/gmuser/testreplace
07:47 hightekvagabond Function: file.replace
07:47 hightekvagabond Result: True
07:47 hightekvagabond Comment: No changes needed to be made
07:47 hightekvagabond Started:
07:47 hightekvagabond Duration:
07:47 hightekvagabond Changes:
07:48 hightekvagabond thats when there is no match
07:48 hightekvagabond because the line doesn't exist
07:48 Pie_Mage are you certain the line doesn't exist?
07:48 hightekvagabond yeah, I'm looking at the file
07:48 Pie_Mage hmm
07:48 hightekvagabond it was set up just to figure out how the the thing works, thats why it's called testreplace
07:50 hightekvagabond pwd
07:50 hightekvagabond /home/gmuser
07:50 hightekvagabond gmuser@krjnuntng923:~$ cat testreplace
07:50 hightekvagabond this is my test replace
07:50 hightekvagabond this is in my replace
07:50 hightekvagabond no file
07:50 hightekvagabond err no line
07:51 Pie_Mage there could be a bug in the version you're using, that is a possibility
07:51 Pie_Mage any reason you're not using 2015.8.3?
07:52 hightekvagabond because this is the version that came from apt-get install
07:52 Pie_Mage you can install 2015.8.3 with apt-get from their repos
07:53 Pie_Mage https://docs.saltstack.com/en/latest/topics/installation/index.html#quick-install
07:54 pwalsh joined #salt
07:54 brianfeister joined #salt
07:54 federicob joined #salt
07:56 Pie_Mage https://github.com/saltstack/salt/issues/23294
07:56 saltstackbot [#23294]title: file.replace fails to append if repl string partially available | Hi,...
07:56 Pie_Mage that bug might be related
07:57 hightekvagabond updated the master, still no joy
07:57 Pie_Mage you would need to update the minion
07:57 hightekvagabond salt 2015.8.3 (Beryllium)
07:58 KermitTheFragger joined #salt
07:58 Pie_Mage as a suggestion in the future, use a pastebin instead of pasting into the chat
07:59 hightekvagabond k
08:01 Pie_Mage what are the contents of the file you're trying to replace?
08:02 hightekvagabond updating the minion version fixed the problem
08:04 Pie_Mage \o/
08:04 dgutu joined #salt
08:05 * Pie_Mage calls off the hounds
08:05 slav0nic joined #salt
08:08 elsmo joined #salt
08:10 sjorge joined #salt
08:10 sjorge joined #salt
08:11 Pie_Mage in using yaml + jinja to generate pillar data, can I output a list just doing {{ my_super_fancy_list }}?
08:11 Pie_Mage or do I have to iterate over the whole list?
08:19 viq joined #salt
08:19 AndreasLutro {{ mylist | json }} is a safe way
08:20 sjorge joined #salt
08:20 sjorge joined #salt
08:21 kawa2014 joined #salt
08:22 larsfron_ joined #salt
08:22 fgimian joined #salt
08:25 Pie_Mage I like safety!
08:25 KermitTheFragger joined #salt
08:25 Pie_Mage thanks AndreasLutro
08:27 shiriru joined #salt
08:30 jhauser joined #salt
08:33 bhosmer_ joined #salt
08:47 Rumbles joined #salt
08:51 amcorreia joined #salt
08:59 honestly_ why doesn't salt abort a state run when rendering the pillar fails? :/
08:59 honestly_ (salt-ssh version 2015.8.3)
09:01 keimlink joined #salt
09:02 geomacy joined #salt
09:02 linjan joined #salt
09:07 AlberTUX joined #salt
09:19 malinoff_ joined #salt
09:20 malinoff_ joined #salt
09:24 fredvd joined #salt
09:29 GreatSnoopy joined #salt
09:30 slav0nic joined #salt
09:36 om Hi
09:37 om I am trying to run a loop over files in a directory
09:37 om then place each file in new directory
09:37 Rumbles joined #salt
09:37 om the files are located in the saltstate/files/sites/****
09:38 om its there a way to get the file names into an array?
09:39 om then loop over the array into a file.managed?
09:39 om or something like that?
09:40 babilen om: Are you sure that you have to loop? Would https://docs.saltstack.com/en/latest/ref/states/all/salt.states.file.html#salt.states.file.recurse maybe work as well?
09:41 om no
09:41 om because the recurse would set the owners and perms the same on all dirs
09:41 shoemonkey joined #salt
09:42 om the dirs need root.root but the files inside them need www-data
09:42 babilen You could use https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.cp.html#salt.modules.cp.list_master to list content on the master and filter that as required ...
09:42 babilen Ah, but file.recurse allows you to specify file_mode and dir_mode
09:43 brianfeister joined #salt
09:43 om I also need to take the path for the docroot and add it to a new nginx conf
09:43 elsmo joined #salt
09:43 babilen I'd configure that from pillars
09:44 babilen There's https://github.com/saltstack-formulas/nginx-formula
09:45 impi joined #salt
09:45 om I need to build this from scratch
09:46 anmol joined #salt
09:47 om basically want a new config and document root setup when salt runs and finds a new dir/files in the files/sites directory
09:47 zerthimon joined #salt
09:48 chiui joined #salt
09:56 Ztyx joined #salt
09:56 Ztyx left #salt
09:57 Pie_Mage can't you just file.recurse and set it to www-data:www-data?
10:00 goudale joined #salt
10:00 goudale hello all
10:01 Pie_Mage \o
10:01 goudale is it a good idea to set up a cron task to highstate my minions everyday ?
10:01 Pie_Mage depends on a lot of things
10:02 Pie_Mage particularly how intensive your states are
10:02 goudale well, there is not that much computing in my states
10:02 goudale mostly configurations
10:03 Pie_Mage why would you need to repeat it over and over again?
10:04 Pie_Mage salt is smart enough to know if changes need to be re-applied
10:04 Pie_Mage so probably for the most part nothing will have changed
10:04 goudale I do not need to "repeat" my state
10:04 goudale I want to be sure that my systems are in the states I expect them to be
10:04 Pie_Mage then that shouldn't be an issue
10:05 Pie_Mage all of the states which are already executed will just come back as completed
10:05 goudale indeed
10:05 Pie_Mage and it'll generally say "changes: none"
10:06 brianfeister joined #salt
10:06 Pie_Mage so, in your case, i'd say 'yes'
10:06 Pie_Mage :D
10:07 chrisw joined #salt
10:07 Pie_Mage it might be worthwhile to make sure though that you don't have anything that would constantly rerun
10:07 chrisw hey all, where’s the code that implements the include: functionality in a pillar’s .sls?
10:18 babilen chrisw: https://github.com/mitsuhiko/jinja2/
10:19 Guest78090 joined #salt
10:19 Jimlad joined #salt
10:21 keimlink joined #salt
10:21 bhosmer joined #salt
10:26 hems joined #salt
10:26 babilen chrisw: Anything in particular you want to know?
10:27 hems hello there,can anyone plz help me that how can I use saltstack to manage my hyper-v machines from centos 6??
10:27 om Pie_Mage and babilen:  even file.recurse isn't placing the files/* in the location
10:27 om it's not creating new dirs
10:27 om and not adding new files
10:28 om http://pastebin.com/EmMaFzQU
10:28 om this is what I used for file.recurse
10:28 chrisw babilen: er, yeah, no… (to the jinja link) - I think the code I want is around line 2815 of salt/state.sls
10:29 Pie_Mage om: I just had another thought that you could use pyobjects or pure python renderers tobuild your state
10:29 Pie_Mage if you needed a bit more logic
10:30 om will need more logic at times for sure
10:30 chrisw babilen: I’m trying to conditionally generate includes for pillars, but only if that pillar exists
10:30 om like this...
10:30 s_kunk joined #salt
10:30 s_kunk joined #salt
10:30 om I thought we could just do a for loop over an array of the files/*
10:31 om and store it in a var
10:31 chrisw babilen: the recipes I’ve found online are a bit sad: http://grokbase.com/t/gg/salt-users/148m57601n/pillars-conditionally-add-pillar-file-in-top-sls
10:31 om then for loop to create new configs
10:31 om I added a pastbin link above to show what I did for file.recurse that does not work
10:33 voidspacexyz_ joined #salt
10:33 hems hello there,can anyone plz help me that how can I use saltstack to manage my hyper-v machines from centos 6??
10:34 Pie_Mage om: what is it doing?
10:34 Pie_Mage is it doing anything?
10:35 om it just creates /var/www/sites but not adding the files in alt://nginx/files/sites
10:35 chrisw hems: sounds like something to ask on the mailing list or stack overflow, also worth asking a specific question: http://www.catb.org/esr/faqs/smart-questions.html#beprecise
10:35 voidspacexyz_ joined #salt
10:35 Pie_Mage om: what version are you running?
10:37 hems i want to manage my virtual machines remotely from my linux system. so i want to use saltstack for this. need some guidance regarding this
10:38 om local:
10:38 om 2015.8.3
10:39 chrisw hems: still way too vague, why don’t you try it and see what happens
10:39 babilen chrisw: Why is that sad? It pretty much does exactly what you want
10:39 babilen chrisw: That being said, why not look into file_tree? I strongly dislike the way in which it mixes targeting and pillar data layout, but it would do exactly what you want
10:41 voidspacexyz_ joined #salt
10:41 chrisw babilen: soo, x.y.z might resolve to x/y/z.sls or x/y/z/init.sls, right? (that’s one hurdle)
10:42 chrisw babilen: I have a list of pillars I’d like to conditionally plug in, looks like Jinja does’t allow list comprehensions, so not sure how to plug the filtering logic in
10:42 Pie_Mage seems to work for me
10:42 Pie_Mage is there anything in your sites directory?
10:42 Pie_Mage om:
10:42 slav0nic joined #salt
10:42 chrisw if I do an if statement inside the include: section, I end up with invalid yaml if none of the classes have pillars…
10:42 babilen chrisw: Why is that a hurdle?
10:43 babilen classes?
10:43 Pie_Mage chrisw: you can use pyobjects or the python renderers
10:43 Pie_Mage if you want more PYTHON POWAH
10:43 babilen https://docs.saltstack.com/en/latest/ref/pillar/all/salt.pillar.file_tree.html
10:43 chrisw sorry, we have a grain called ‘classes’, dot-separated list of states to apply to that host
10:43 babilen But then, it is easy to write pillars in any other supported renderer
10:43 denys joined #salt
10:44 voidspacexyz_ joined #salt
10:44 babilen jinja was never a good choice as default renderer
10:44 Pie_Mage babilen: i totally agree
10:44 chrisw babilen: the 'file.file_exists’ example in that list thread doesn’t take that into account, no?
10:45 babilen The fact that jinja wasn't a good choice ? ;)
10:45 Pie_Mage yes :P
10:46 giantlock joined #salt
10:46 Pie_Mage i'm a full-on pyobjects convert
10:46 chrisw babilen: also agreed on the jinja choice, but sadly not something I’m in a position to change
10:46 chrisw sadly this quite a fundamental part of our salt infrastructure, and I don’t want to fuck to much with something that’s managing 8k-ish hosts :-S
10:47 Pie_Mage chrisw: you can change your renderer/templating on a per-file basis if you feel like it
10:47 babilen I would have preferred mako as default renderer. That is primarily due to the fact that it allows you to drop in arbitrary Python blocks in which you can do some data-munging. If you really need more power pyobjects and/or py are more than sufficient.
10:47 chrisw Pie_Mage: what’s pyobjects in a salt context?
10:47 babilen It is just that one often only needs that "tiny" bit of extra logic in a SLS that jinja simply can't cope with.
10:47 chrisw babilen: ++
10:47 babilen chrisw: A specific renderer
10:47 chrisw ah
10:48 Pie_Mage i was toying with py briefly, but it's lack of other-sls import ability really rubbed me the wrong way
10:48 Pie_Mage super pythonic
10:48 babilen https://docs.saltstack.com/en/latest/ref/renderers/all/salt.renderers.pyobjects.html
10:48 Pie_Mage if you're into that kinda thing
10:49 Pie_Mage I don't want to lead you too far off course, but it's something worth keeping in mind
10:50 Pie_Mage om: any luck so far?
10:50 chrisw babilen / Pie_Mage: hmm winding right back, I’m looking to generate an include key in a pillar, the values of that pillar come from a list of dot-separated strings, I want to filter to those that exist, that do-able?
10:51 babilen Sounds like something you want to write in Python
10:51 babilen But then, wouldn't file_tree do exactly what you want?
10:52 babilen I mean it is super annoying that it conflates targeting and data, but at least you could define nodegroups based on your "classes" grain ..
10:52 babilen (I will never understand why people want to save classes in a distributed manner on the minions that allows them to fake it)
10:52 chrisw I read the file_tree stuff, but honestly couldn;t understand any of it
10:52 babilen s/classes/roles
10:53 babilen chrisw: Essentially: You have a directory structure FOO/a/b/c.sls which means that a.b.c is being targeted to FOO. FOO can be hostnames or nodegroups.
10:53 chrisw it doesn’t “feel” like it’ll work with our existing tree, but that’s caveat’ed by me not userstanding how it works at all
10:54 chrisw babilen: ah ,yeah, major re-structure of our pillar tree is not going to fly I’m afraid :-S
10:54 babilen It is unfortunate as it would have been much more powerful if you simply had top.sls + a/b/c.sls and the ability to target entire files in there ...
10:55 babilen You are essentially looking for a nice way to define parametrisation for individual hosts?
10:55 Pie_Mage can you 'retarget' inside init.sls?
10:55 N-Mi joined #salt
10:56 Pie_Mage so you have your top file call a.b, and in b there is an init.sls which defines which state file to actually load based on pillar/grain data
10:58 chrisw babilen: no, we have an existing strategy that I can’t change, I’m just looking to handle the case where an empty pillar.sls has to be created for every one of these classes, even though the pillar may not exist...
10:58 favadi joined #salt
10:58 chrisw (mainly because I forgot to create them, and then we get a bunch of failed salt runs!)
10:58 anmol joined #salt
10:59 chrisw Hmm, what would cause the shebang ‘# !py’ to work? I have that at the top of this .sls, but it’s hand no effect, still being treated as jinja :-/
10:59 Pie_Mage the space
11:00 chrisw eesh
11:00 babilen Spaces in shebangs were always evil
11:01 chrisw if I change the .sls extension to .py, would that have the desired effect or would that just mean the file is ignored?
11:01 babilen chrisw: I might have missed that, but why can't you use the filtering strategy detailed in the thread you mentioned earlier?
11:02 Pie_Mage salt won't recognize it as a salt state file
11:02 babilen chrisw: No, leave it at .sls and use a suitable shebang
11:02 chrisw babilen: the list might be empty, so I end up with a f’ed yaml setup
11:03 nidr0x joined #salt
11:03 babilen chrisw: Then check if the list is empty and only render the block if it isn't. But then ... use Python for this.
11:04 chrisw right
11:04 chrisw soo… what’s the renderers.py equivalent of import_yaml ?
11:05 babilen Where do you want to read it from?
11:06 babilen Ah, bbl .. telephone
11:06 Pie_Mage one thing to keep in mind, the py renderer doesn't support the salt:// syntax for imports
11:07 CeBe joined #salt
11:08 chrisw this newly-!py’d .sls
11:08 chrisw (is where I need to do import_yaml)
11:08 voidspacexyz joined #salt
11:10 Pie_Mage the py renderer is pretty annoying about imports
11:10 Pie_Mage as in, you can't really import anything INTO them
11:11 Pie_Mage as for importing from a file which does support imports... perhaps?
11:12 babilen How about #!py|yaml and emit sensible yaml from Python?
11:13 Pie_Mage that would be pretty awesome if that could work
11:13 chrisw meh, I’m out of time on this, 2hrs is too much sadly
11:13 * chrisw head -> desks and goes on with life...
11:13 Pie_Mage does... that work?
11:13 chrisw thanks for the help guys, much appreciated though, I’ve learned a fair amount and you were both a great help
11:14 Pie_Mage no problem!
11:14 chrisw sadly, solution is “remember to create the empty .sls in the pillar tree :-/)
11:14 babilen Pie_Mage: You can chain renderers
11:14 babilen In fact the default renderer is jinja|yaml
11:15 Pie_Mage I knew you could chain things together, but I figured it would just be between a templating system and a renderer
11:16 AlberTUX1 joined #salt
11:16 Pie_Mage that opens up a whole new arena
11:16 babilen hehe
11:16 babilen What if I use Python to generate mako that emits yaml?
11:17 Pie_Mage sounds like it would be a crazy powerful toolchain
11:18 babilen https://docs.saltstack.com/en/latest/ref/renderers/#composing-renderers
11:19 babilen Has a "#!jinja|mako|yaml" example
11:22 Pie_Mage this might be a good way to solve my issue of not being able to use anything but yaml in my topfiles
11:23 Pie_Mage just use a good yaml lib, and I can build my topfiles using something that makes more sense, and probably just do yaml.dumps(topfile_dict)
11:29 peters-tx joined #salt
11:39 geomacy joined #salt
11:42 shoemonkey joined #salt
12:01 kbaikov joined #salt
12:05 om Pie_Mage:
12:05 om I was thinking about what you mentioned
12:06 om I really need to be able to loop through arrays and assign them to var
12:06 om the arrays should be generated, say, by a list of dirs
12:06 om so the arrays are names of dirs
12:07 om then loop through that array to generate different config files with their names and docroots
12:07 om I am just thinking of how it's done with chef ruby and puppet DSO
12:08 om so looking for way to do this with salt DSO or python (since it's native to salt)
12:08 jespada joined #salt
12:10 bhosmer joined #salt
12:11 om is their an intermediate to advanced tutorial on saltstack?
12:11 om I think I ran through all the intro stuff.  conditionals, jinja, pillars, grains
12:14 nidr0x joined #salt
12:15 om I mean, if it's a logical thing that salt doesn't support, I suppose I know the way around.
12:15 om It's just a bit uphill
12:16 robbbb joined #salt
12:17 om manually adding the vars to pillars or elsewhere is possible.  and duplicating each instance of creating an nginx config with proper jinja vars
12:27 om probably making custom formulas and using renderers
12:31 slav0nic joined #salt
12:32 giantlock joined #salt
12:33 IanV0rn2341 joined #salt
12:39 jhauser joined #salt
12:40 babilen Pie_Mage: Absolutely. Glad I mentioned it if it makes your life easier! :)
12:47 tmclaugh[work] joined #salt
12:55 Pie_Mage om: salt is very data driven, so you'd probably be better served moving upstream and working from pillars to push the data to your minions
12:58 DammitJim joined #salt
13:04 bhosmer joined #salt
13:10 DammitJim so, silly questions
13:10 DammitJim if you hav ea minion
13:10 KennethWilke joined #salt
13:10 DammitJim do you configure EVERYTHING for it with salt?
13:10 chiui joined #salt
13:13 AndreasLutro just the things you care about
13:13 DammitJim LOL
13:13 AndreasLutro I don't do stuff like network and disks, I assume those are set up before the salt process comes into play
13:13 AndreasLutro for example
13:14 DammitJim maybe I'm just very inefficient, but this one guy is doing an upgrade on the server
13:14 DammitJim and I thought it was a little overkill to spend the time to do it all with salt
13:14 DammitJim ya know what I mean?
13:15 AndreasLutro depends on if you're doing it for 10, 100 or 1000 servers
13:15 DammitJim 1
13:16 Pie_Mage it could just be a learning thing
13:16 DammitJim especially since this is a windows server
13:16 DammitJim a lot of the things is like you have to spend time trying to figure out what file is getting changed through the GUI
13:17 DammitJim sorry to vent... just some operational frustrations
13:17 DammitJim thanks guys! you are always very helpful and supportive
13:17 Pie_Mage is salt very useful on windows?
13:17 Pie_Mage I just can't imagine it has the usefulness like it does on linux
13:18 KennethWilke unless it can reimage your machine ;)
13:18 KennethWilke i kid
13:18 Pie_Mage but do you? DO. YOU?
13:18 Pie_Mage :P
13:19 KennethWilke sometimes you just msoffice
13:19 KennethWilke but i'd never run it on a server, but mostly because i don't know the first thing about running a windows server
13:19 KennethWilke seems complicated
13:20 KennethWilke probably would try to use salt!
13:20 KennethWilke eager to see what pkg.* does
13:20 goudale joined #salt
13:21 Pie_Mage haha
13:24 DammitJim there are some things that work well through powershell
13:25 DammitJim or just straight python on Windows
13:25 DammitJim but one has to know the inner workings
13:25 KennethWilke yeah, i've seen some windows folks work some mighty powershell-fu
13:26 Pie_Mage i stopped windowsing just before powershell came out, so I dunno
13:26 Pie_Mage the whole windows ecosystem is totally uninteresting to me
13:27 DammitJim if you are a .net developer, you can do pretty cool stuff with powershell
13:27 DammitJim they've come a long way
13:27 KennethWilke i learned to program on linux, so have gotten really accustomed to package managers and easy to use things
13:27 DammitJim but I agree with you, salt on linux is such a breeze in comparisson
13:27 DammitJim comparison
13:27 DammitJim I need to learn how to package stuff on debian
13:28 DammitJim *sigh*
13:28 Pie_Mage OH!
13:28 KennethWilke windows does have one of my favorite package managers
13:28 KennethWilke steam!
13:28 Pie_Mage do I have something for you!
13:28 Pie_Mage fpm
13:28 DammitJim for who?
13:28 Pie_Mage yyou!
13:28 KennethWilke deb packaging is a lil odd at first for sure
13:28 Pie_Mage DammitJim:
13:28 DammitJim oh yeah?
13:28 KennethWilke but easier than rpm packaging i think
13:28 DammitJim I'm all for learning that!
13:28 Pie_Mage https://www.digitalocean.com/community/tutorials/how-to-use-fpm-to-easily-create-packages-in-multiple-formats
13:29 morissette joined #salt
13:29 DammitJim let me ask you something different but kinda similar
13:29 KennethWilke Pie_Mage: that looks pretty handy!
13:29 Pie_Mage it's incredible
13:30 Pie_Mage you can go all out and produce repository-worthy packages, or you can just package up a directory
13:30 DammitJim would you package software for your own company to be deployable on debian servers?
13:30 DammitJim or would you just update files on the servers?
13:30 KennethWilke depends on the project
13:30 DammitJim oh really?
13:30 KennethWilke for me
13:30 DammitJim so, packaging can be anything, right?
13:30 DammitJim it can be just copying files
13:30 DammitJim it could be copying files and "running" an in staller?
13:30 KennethWilke i think that's like, something various people will have different opinions about
13:31 KennethWilke if we're talking about like a java codebase
13:31 KennethWilke i'd rather package it
13:31 DammitJim that page has been bookmarked Pie_Mage thanks!@
13:31 KennethWilke for python though, i'd rather just use salt and git
13:31 DammitJim I use something called enlightenment and I have been using it for 10 years... every time there is an update, I do everything manual instead of creating an update package
13:31 DammitJim KennethWilke, java code base
13:31 DammitJim war files for tomcat
13:32 shoemonkey joined #salt
13:32 KennethWilke yeah, definitely for that kind of stuff
13:32 DammitJim hhhmmmm
13:32 KennethWilke so i guess my general rule of thumb is, salt+git for interpreted languages and packages for compiled
13:32 anmol joined #salt
13:32 DammitJim I've been thinking that to myself in this new company
13:33 DammitJim they deploy war files, but they never take into account the software as a whole.. the dependencies
13:33 KennethWilke yeah, it's nice if you use salt in multiple environments
13:33 KennethWilke use it for cicd and stuff, to validate you have all your dependencies in order and stuff
13:34 KennethWilke salt-cloud can be pretty handy for those things
13:35 treaki joined #salt
13:35 dyasny joined #salt
13:35 DammitJim I hate the cloud
13:36 Pie_Mage i love clouds, they're fluffy and they look like things!
13:36 KennethWilke most of my stuff is pretty... cloudy
13:36 keimlink joined #salt
13:36 bhosmer joined #salt
13:37 kimball joined #salt
13:37 geomacy joined #salt
13:38 yidhra__ joined #salt
13:40 XenophonF joined #salt
13:43 solene joined #salt
13:43 solene hi, is it safe to use salt-stack over the internet without VPN ?
13:44 Pie_Mage you could always use an ssh tunnel
13:44 XenophonF i think so
13:45 KennethWilke it does use encryption that they try to ensure is secure
13:45 KennethWilke i'd feel reasonably safe using it over the internet
13:46 babilen solene: It is
13:46 babilen fsvo "safe"
13:46 XenophonF heh
13:48 solene I could also use a ssh tunnel but this look like a bit "DIY way", if would rather create a VPN if it won't be safe to use salt on the internet
13:49 solene i don't know the english word to say "something that's ugly but do the job"
13:49 KennethWilke i'd probably call that hacky
13:49 babilen Windows?
13:50 IanV0rn2341 joined #salt
13:50 solene yes, hack, that's nice. Use salt throught a ssh tunnel established everytime I need to use salt look like a hack
13:51 KennethWilke well salt actually has some built in ssh support
13:51 KennethWilke so that wouldn't be too hacky
13:51 akhter joined #salt
13:51 totzky joined #salt
13:51 KennethWilke solene: this might have some good details regarding security in salt https://docs.saltstack.com/en/latest/topics/hardening.html
13:52 KennethWilke and for the ssh stuff: https://docs.saltstack.com/en/latest/topics/ssh/index.html#salt-ssh
13:53 solene thanks KennethWilke
13:53 KennethWilke you're welcome
13:55 subsignal joined #salt
13:55 Pie_Mage do most people run the salt daemon as non-root?
13:56 babilen master as salt, minion as root
13:56 KennethWilke i run it as root, on the minion side i think it could be a little more difficult to get the full usefulness without running it as root
13:56 KennethWilke on the master side i don't think it matters what user you run it as
13:56 KennethWilke so might as well run non-root to feel a touch safer
13:57 dgutu joined #salt
13:57 Pie_Mage i still run it as root
13:57 Pie_Mage mind you, i've only been salting for two weeks
13:57 Pie_Mage so i'm still pretty new
13:59 KennethWilke no problem, a lot of folks in this room are pretty willing to help out
14:01 Pie_Mage i've got a surprisingly good handle on it already, so that says something about salt's intuitiveness
14:09 shoemonkey joined #salt
14:15 solene KennethWilke: salt-ssh is a pretty fun feature
14:15 solene don't even need minions !
14:17 quasiben joined #salt
14:18 VR-Jack Is minion reactor done yet?
14:20 racooper joined #salt
14:24 StogblenToast this is annoying, I've got minions who can salt-call things fine but won't respond to the master-initiated states
14:25 XenophonF same versions of salt on both sides of the connection, StogblenToast?
14:25 StogblenToast yes
14:25 StogblenToast kind of an old version, possibly a bug
14:26 StogblenToast 2015.5.3
14:26 XenophonF what happens if you run a "salt <minion> test.ping" from the master?
14:27 StogblenToast "not connected"
14:27 StogblenToast a salt-call test.ping (on the minion) returns True
14:27 subsignal joined #salt
14:27 StogblenToast ok I think I may have solved it by rebooting the minion process
14:28 XenophonF great!
14:28 XenophonF sorry i'm not sure what happened there
14:28 StogblenToast I'd like to find out, this happens a lot
14:29 VR-Jack if you are restarting iptables on the box, that flushes state, which can seriously kill minion connections
14:29 lompik joined #salt
14:29 VR-Jack one reason to use packages like firewalld which changes things without flushing
14:31 StogblenToast I'm not messing with the firewall
14:31 StogblenToast it's also not a consistent problem, so it's hard to track down
14:31 VR-Jack Might also check the minion keepalives
14:31 solene StogblenToast: do you say that sometimes when you use a state on minions it hangs ? I have to problem sometimes
14:32 XenophonF minions should automatically reconnect to the master, though
14:33 VR-Jack They should, but not always in a timely manner. It can cause issues with the master sending it's messages.
14:33 babilen Look into "ping_on_rotate: True", StogblenToast
14:39 VR-Jack anyone know the status of minion reactor? Yes, I'm too lazy to look it up. :P
14:42 Tyrm joined #salt
14:44 StogblenToast sorry got called away for a minute
14:44 StogblenToast solene: what do you mean by hang?  Sometimes I get "stuck" highstates
14:45 DammitJim do you guys have salt join a machine to a domain or do you keep that separate?
14:45 StogblenToast I suspect it's from duplicate minion entries in the pki folder
14:46 StogblenToast babilen: is that a master or minion setting?
14:46 ntropy StogblenToast: master
14:46 ntropy its the master that pings the minions on rotate
14:48 Brew joined #salt
14:48 rubendv joined #salt
14:48 rubendv joined #salt
14:49 gnudon joined #salt
14:50 perfectsine joined #salt
14:50 VR-Jack I would think ping on rotate is designed to fix situations where salt-call would break vs salt?
14:50 solene StogblenToast: I use salt 'machine1' state.sls something
14:51 solene sometimes this hang awaiting the machine to respond, nothing in the log of the minion, then I restart both sides and do the same thing and I takes 10 ms to executes
14:51 StogblenToast ping_rotate will hopefully stop minions from failing to respond silently after the first call of the day, which is something that has happened
14:51 solene i did not have the time to investigate
14:51 zmalone joined #salt
14:51 StogblenToast does it hang forever?
14:52 DammitJim oh man... ruby? really?
14:52 digitalhero joined #salt
14:52 ntropy solene: i think the delay when minion or both ends are restart is 'normal' - it takes a few seconds for 0mq connection to establish
14:53 solene StogblenToast: a few minutes until I kill it because I get mad
14:53 StogblenToast ah, mine usually don't hang for more than 120s (the timeout)
14:53 StogblenToast with "no response"
14:54 robbbb joined #salt
14:54 solene StogblenToast: this is often happening when using a pkg state
14:54 StogblenToast could it be the packmanager is taking a long time to install?
14:55 solene no, even if it only check if the package is installed it hangs
14:55 StogblenToast I know I have salt yum install some packages that take a really long time (weird packages)
14:55 StogblenToast ok
14:55 ntropy solene: i'd try two things - enable debug logging on master and also trace the minion process when it hangs
14:56 ntropy that should give you some idea about what its doing
14:57 digitalhero joined #salt
14:57 DammitJim wow... I can see how using fpm is very simple
14:57 solene ntropy: I need to find some spare time to debug it and this is not very common
14:58 DammitJim Pie_Mage, so, one doesn't need to know anything about ruby to use fpm, right?
15:00 ntropy DammitJim: probably not, it would suck if to use unix you'd have to grok c :)
15:01 DammitJim LOL... good point
15:01 Pie_Mage nope!
15:01 Pie_Mage I don't know a line of ruby, and I use fpm all the time
15:03 perfectsine_ joined #salt
15:03 Brew joined #salt
15:03 DammitJim Pie_Mage, what if you aren't building something
15:04 DammitJim and you just have to ensure that you update war files
15:04 DammitJim and verify that the proper jar files are available, tomcat configurations are there and such?
15:05 GnuLxUsr joined #salt
15:05 bhosmer_ joined #salt
15:05 Pie_Mage debian packages allow you to specify pre-and-post install scripts
15:05 Pie_Mage i would assume rpm has something similar
15:05 DammitJim so, one creates the scripts to verify such things?
15:06 bhosmer_ joined #salt
15:06 Pie_Mage yes!
15:06 DammitJim I don't use rpm.. yuck... moving away from that
15:06 Pie_Mage haha
15:06 DammitJim a script would verify that one has the proper dependencies?
15:06 DammitJim how would I check that I have another package installed?
15:06 Pie_Mage well, you can do that in your package manager by specifying dependencies
15:07 DammitJim the package manager? like fpm?
15:07 Pie_Mage apt
15:07 Pie_Mage dpkg
15:07 DammitJim huh?
15:07 Pie_Mage aptitude
15:07 DammitJim I thought that was a function of the creator of the package
15:07 Pie_Mage yes, it is
15:08 giantlock joined #salt
15:08 Pie_Mage fpm just generates the package files according to your specs
15:08 DammitJim oh, you are saying I specify the dependencies by using dpkg in my scripts?
15:08 DammitJim and one of my specs would be to check with dpkg if a package has been installed, right?
15:08 DammitJim oh, cool... you can also do this with maven
15:08 Pie_Mage dependencies are linked to a package, so you would have to specify them to fpm, and they would get used by apt (and dpkg iirc)
15:09 DammitJim yes, sir
15:09 DammitJim makes sense
15:09 DammitJim there are always grey areas... do I just check for the existence of a jar file or do I check that the package that installs that jar file has been installed
15:09 DammitJim ugh
15:10 Pie_Mage i don't use java ever, so I don't really know
15:10 DammitJim no, I meant in general
15:10 DammitJim let's say you are creating a package that relies on the existance of x file
15:11 DammitJim you could either: 1) check with a script for the existence of that file or 2) check for the package that should have installed that file
15:11 DammitJim right?
15:11 Pie_Mage yes
15:11 DammitJim decisions decisions decisions
15:11 Pie_Mage PACKAGE ALL THE THINGS!
15:11 DammitJim with fpm, do you also have to create something to "uninstall" a package?
15:12 Pie_Mage I don't believe so
15:12 Pie_Mage https://github.com/jordansissel/fpm
15:13 Pie_Mage there is a wiki at the bottom of the readme that has lots of info that I don't know
15:13 Pie_Mage i don't really add dependencies to the package
15:14 XenophonF DammitJim: if your package management system supports dependencies, then enumerating those package dependencies in your package is the Right Thing To Do
15:14 DammitJim si, I get it
15:14 XenophonF you can belt-and-suspenders it by checking for the needed file in a post-install script
15:16 Pie_Mage i like that phrase
15:16 rubendv joined #salt
15:17 DanyC joined #salt
15:18 XenophonF should i be migrating my salt deployments to raet?
15:19 XenophonF right now everything uses zeromq
15:19 XenophonF maybe salt-ssh or powershell remoting for bootstrapping
15:20 andrew_v joined #salt
15:23 berserk joined #salt
15:23 mapu joined #salt
15:25 XenophonF left #salt
15:27 berserk joined #salt
15:29 norii is there a benefit of using raet vs zeromq?
15:30 zmalone norii: raet hasn't been seeing many updates lately, unless you have a compelling reason to try and adopt it, I'd avoid it.
15:31 berserk joined #salt
15:31 zmalone tornado is the new salt approach, but 2015.8 had a lot of warnings about it not being ready for production in the release notes
15:31 norii zmalone: thx i tend to stick to defaults wherever possible was just curious
15:31 norii oh interesting
15:31 berserk joined #salt
15:31 shoemonkey joined #salt
15:32 quasiben joined #salt
15:33 alvinstarr joined #salt
15:33 berserk joined #salt
15:35 berserk joined #salt
15:37 DaveQB joined #salt
15:37 berserk joined #salt
15:44 DanyC joined #salt
15:45 dsaard joined #salt
15:47 DammitJim is there a way to stop a state from running once it's been started?
15:49 babilen You could kill it
15:50 andrew_v joined #salt
15:50 dsaard hi, i try to manage php_browsecap.ini from browsecap.org, but salt-call with file.manage or file.recurse stucks by fetching the file, its the only file from  about 1k other files, could someone check this?
15:50 babilen DammitJim: https://docs.saltstack.com/en/latest/topics/jobs/
15:51 babilen Not that I would necessarily do it
15:51 DammitJim it's alright
15:51 DammitJim it's done
15:51 DammitJim I was afraid of something happening, but it didn't ;)
15:51 DammitJim normally I run test=true before running the stuff on a new server
15:52 tmclaugh[work] joined #salt
15:52 shoemonkey joined #salt
15:52 deedubs left #salt
15:54 XenophonF joined #salt
15:57 Brew1 joined #salt
16:00 perfectsine joined #salt
16:01 permalac joined #salt
16:04 rem5_ joined #salt
16:05 oida joined #salt
16:06 akhter joined #salt
16:06 DammitJim is it easy to change the name of a minion according to the master?
16:07 DammitJim so, like if salt-key -L shows server1 and I want it to now be addressed as myserver1
16:08 zmalone DammitJim: edit your minion id in /etc/salt, restart the minion, and accept the new minion_id:key pair on the master
16:08 zmalone or go to the master and rename the key there, update the minion_id, and restart the minion
16:08 zmalone I didn't specify a file because there are a few places you can update the minion_id
16:09 zmalone It can be an option in your minion config, exist in the minion_id file, or exist as a config line in a .d config file directory
16:11 totzky joined #salt
16:17 zsoftich1 joined #salt
16:17 racooper Is there any way in salt file state to set selinux context?
16:18 racooper hrm...nevermind. I don't actually need to. it gets the correct context from parent.
16:20 Diling joined #salt
16:20 DammitJim zmalone, update the minion_id on the minion?
16:20 DammitJim I renamed the key
16:22 jhauser joined #salt
16:22 shoemonkey joined #salt
16:23 zmalone DammitJim: yes, otherwise the minion will keep reporting itself as the old id to the master
16:23 zmalone so the master will target the "new" id, but nothing is trying to consume messages for the new id
16:23 zmalone both need to match
16:27 godzirra_ left #salt
16:28 neogenix joined #salt
16:34 traph joined #salt
16:34 traph joined #salt
16:36 ALLmightySPIFF joined #salt
16:38 ALLmightySPIFF joined #salt
16:40 _JZ_ joined #salt
16:41 andrew_v_ joined #salt
16:42 igorwidl joined #salt
16:43 thetoolsmith joined #salt
16:44 tmclaugh[work]_ joined #salt
16:44 thetoolsmith Hey all. when using cloud map files, can I specify the provider that a profile will use. In other words, can I use maps to call the same profile with different provider setting?
16:45 norii thetoolsmith: oh that sounds useful if thats how it works keep me posted
16:48 igorwidl is there a way to tag a volume for an instance created using cloud map file?
16:49 igorwidl i did find a way to tag an instnace in cloud map file
16:49 neogenix joined #salt
16:51 berserk joined #salt
16:52 spiette joined #salt
16:54 akhter joined #salt
16:55 impi joined #salt
16:55 jfindlay thetoolsmith: I think cloud profiles have to be unique across all providers
16:56 voidspacexyz joined #salt
16:56 thetoolsmith jfindlay: bummer, thanks!
17:02 akhter joined #salt
17:03 Tyrm_ joined #salt
17:03 kaptk2 joined #salt
17:04 Tyrm__ joined #salt
17:07 gtmanfred thetoolsmith: jfindlay is correct
17:07 gtmanfred but
17:08 gtmanfred well, my issue request doesn't pertain to this
17:08 numkem joined #salt
17:09 onlyanegg joined #salt
17:12 anmol joined #salt
17:15 digitalhero joined #salt
17:16 digitalhero joined #salt
17:17 digitalhero joined #salt
17:18 jimklo joined #salt
17:19 berserk joined #salt
17:19 digitalhero joined #salt
17:20 Tyrm joined #salt
17:20 digitalhero joined #salt
17:21 digitalhero joined #salt
17:27 Bryson joined #salt
17:28 berserk joined #salt
17:30 dlam joined #salt
17:33 CheKoLyN joined #salt
17:35 grumm_servire joined #salt
17:39 perfectsine joined #salt
17:39 kitplummer joined #salt
17:40 Tyrm_ joined #salt
17:42 ageorgop joined #salt
17:43 Tyrm_ joined #salt
17:44 writtenoff joined #salt
17:45 jnilsson joined #salt
17:45 kimball joined #salt
17:47 perfectsine joined #salt
17:52 perfectsine joined #salt
17:53 Tyrm joined #salt
17:56 shoemonkey joined #salt
17:57 rm_jorge joined #salt
18:00 wendall911 joined #salt
18:05 digitalh_ joined #salt
18:05 relicanth joined #salt
18:05 digitalh_ joined #salt
18:07 shoemonkey joined #salt
18:09 woodtablet joined #salt
18:09 quasiben joined #salt
18:09 * woodtablet woodtablet@scale
18:10 woodtablet hmm.. i forgot the command on how to change my name
18:11 Pie_Mage /nick
18:11 geekatcmu First you go see the judge...
18:12 Pie_Mage Judge.change_name('change_woodtablet_name', name='FancyWoodtablet')
18:12 digitalhero joined #salt
18:13 woodtablet pie_mage - thanks! i was trying name
18:14 digitalhero joined #salt
18:15 Pie_Mage woodtablet_at_tenagra
18:15 wdtblt_at_scale lol
18:15 wdtblt_at_scale there seems to be name size limit or something
18:15 wdtblt_at_scale =D
18:15 Pie_Mage woodtablet_his_arms_wide
18:16 Pie_Mage woodtablet_the_walls_fell
18:16 wdtblt_at_scale star trek?!
18:16 Pie_Mage :D
18:16 wdtblt_at_scale thats awesome
18:17 babilen The river Temarc in winter!
18:17 Pie_Mage HIS ARMS WIDE!
18:18 wdtblt_at_scale njilhjkdrvhvlibegtlggutbhutuihuntrgifcbrfcek
18:18 wdtblt_at_scale sorry
18:18 Pie_Mage that's a mouthful!
18:18 wdtblt_at_scale i touched something
18:21 wendall911 joined #salt
18:22 snarfy joined #salt
18:23 denys joined #salt
18:26 shoemonkey joined #salt
18:30 wdtblt_at_scale njilhjkdrvhvgtbtbncjjtbjftuiculgkgclkrhvrbtt
18:30 wdtblt_at_scale njilhjkdrvhvjkbbfvkekntnnvbucfbfhhnfvvebcffu
18:33 wdtblt_at_scale gotta logout, i cant stop touching my 2nd factor, sorry everyone
18:33 wdtblt_at_scale left #salt
18:37 relicanth joined #salt
18:37 relicanth joined #salt
18:38 shoemonkey joined #salt
18:38 subsignal joined #salt
18:42 shoemonkey joined #salt
18:47 baweaver joined #salt
18:54 shoemonkey joined #salt
18:56 baweaver joined #salt
18:57 wendall911 joined #salt
18:57 dlam arg noob here,  whats the thingy syntax to do  `file.absent` on like a list of files?
18:57 dlam like you can start a state with  `file.absent` or theres that other syntax that starts it with /the//file/to/remove:  and file.absent under it, dunno how you call those 2
19:01 PsionTheory joined #salt
19:04 jfindlay dlam: file.absent doesn't work on a list, unfortunately
19:05 jfindlay but if you can create the list in jinja, you can use that to loop over the files with file.absent
19:06 berserk joined #salt
19:07 berserk joined #salt
19:09 jfindlay dlam: https://gist.github.com/jfindlay/53e3fbd5bf69b9efe7c9
19:10 dlam ahhh ok ok thanks
19:10 jfindlay this also explains SLS data structure formatting and conventions: https://docs.saltstack.com/en/latest/ref/states/highstate.html
19:10 gtmanfred or use names
19:10 jfindlay gtmanfred: does names work with file.absent?
19:10 gtmanfred names works with literally everything
19:10 gtmanfred it creates a unique stateid for every one in names, and they all run independently
19:10 gtmanfred with the same variabels as above, unless you use this
19:11 jfindlay that must be a feature internal to the state compiler
19:11 gtmanfred it is
19:11 gtmanfred it is a reserved state keyword
19:12 gtmanfred you can also override stuff from the above state with lower dictionaries
19:12 gtmanfred https://github.com/taplists/taplist-salt/blob/txlf/repos/init.sls
19:12 gtmanfred that is an example
19:12 * gtmanfred wrote that :)
19:12 baweaver joined #salt
19:13 jfindlay cool
19:13 gtmanfred https://github.com/saltstack/salt/pull/13489
19:13 saltstackbot [#13489]title: [RFC] Allow names to override chunk variables. | This feels gross and I haven't thought of a better way of doing this...
19:13 kawa2014 joined #salt
19:14 gcorey joined #salt
19:14 gtmanfred but yeah, names is a keyword, that just says, take each in the list of names, and create another state with each one as the name
19:15 gtmanfred and they all share the same stateid
19:15 gtmanfred it is magic
19:15 gtmanfred simplifies a lot of extra things that are really similar
19:15 shoemonkey joined #salt
19:15 jfindlay yeah, better than jinja
19:15 gtmanfred https://github.com/gtmanfred/openstack-salt-states/blob/master/novaapi/service.sls
19:15 gtmanfred dlam: like that ^^
19:16 dlam ohhhh ok, so i guess replace the "service.running" with "file.absent" and maybe it work :D
19:16 gtmanfred yeah
19:17 gtmanfred names is a build in special state word
19:17 gtmanfred so it is on all of them
19:17 dlam oh ya that works, woot!   thanks all <3
19:17 gtmanfred np
19:17 gtmanfred and in 2015.8.3 i think i fixed it so that you could override more than just one thing in the extra chunk data
19:19 btorch hmm I got something weird , I have a salt.loader CRITICAL error that seems to happen when trying to load grain define a custom net.lldpinfo function
19:19 btorch it only seem to happen though when the server is restarted and I guess salt is loading grains into memory or cache
19:20 btorch running the grain.item lldpinfo using salt or salt-call doesn't actually show any errors even on debug mode
19:20 quasiben joined #salt
19:21 btorch is there a way to force this error to happen without having to restart the server ? restarting salt also didn't cause the error to happern
19:21 ageorgop joined #salt
19:22 btorch http://pastebin.ca/3344905
19:24 jfindlay does `sudo lldpctl eth0` only return 1 the first time it's run?
19:24 ageorgop joined #salt
19:25 iggy does saltutil.sync_grains reload grains? (don't know, worth a try)
19:32 baweaver joined #salt
19:33 shoemonkey joined #salt
19:35 shiriru joined #salt
19:36 CheKoLyN joined #salt
19:36 btorch jfindlay: if by first time you mean when salt first starts up
19:36 btorch iggy: yeah I was about to that then lost net :)
19:38 jfindlay btorch: it seems that I was misunderstanding before.  Does the loader error happen every time the custom grain is run?  If so, is the return value of 1 something you should resolve/ignore?
19:39 berserk joined #salt
19:39 btorch na sync didn't do it
19:39 shoemonkey joined #salt
19:40 btorch jfindlay: no it doesn't, indeed we need to patch to catch that exception or use Popen
19:40 btorch I wonder if salt is starting up and eth0 is not up yet during start up or something like it, which sounds weird though
19:41 AlberTUX joined #salt
19:45 mapu joined #salt
19:47 chiui joined #salt
19:48 mapu joined #salt
19:50 relicanth joined #salt
19:56 toddejohnson joined #salt
19:56 racooper joined #salt
19:56 r05c03 joined #salt
20:04 r05c03 joined #salt
20:06 scarcry joined #salt
20:08 digitalhero joined #salt
20:10 hal58th_ joined #salt
20:12 rotbeard joined #salt
20:17 kimball joined #salt
20:18 r05c03 joined #salt
20:24 subsigna_ joined #salt
20:24 gcorey1 joined #salt
20:26 giantlock joined #salt
20:26 shoemonkey joined #salt
20:26 IanV0rn2341 joined #salt
20:33 berserk joined #salt
20:40 gcorey2 joined #salt
20:41 IanV0rn2341 joined #salt
20:42 Diling left #salt
20:45 psojourner joined #salt
20:48 GreatSnoopy joined #salt
20:52 KennethWilke joined #salt
20:52 viq joined #salt
20:52 viq joined #salt
20:54 gcorey2 joined #salt
20:56 IanV0rn2341 joined #salt
21:00 [C]hris joined #salt
21:00 bhosmer_ joined #salt
21:00 chiui joined #salt
21:02 baweaver joined #salt
21:03 [C]hris So i have recently got salt working on my aws servers and I am using https://github.com/saltstack/salt-contrib/blob/master/grains/ec2_tags.py which works great. But now I need some help on how to work with the ec2_tags I have pulled into my master? Anyone care to help?
21:04 perfectsine joined #salt
21:05 forrest joined #salt
21:07 CheKoLyN joined #salt
21:10 igorwidl joined #salt
21:12 ageorgop joined #salt
21:14 hasues joined #salt
21:14 hasues left #salt
21:16 baweaver joined #salt
21:17 cyborg-one joined #salt
21:17 perfectsine joined #salt
21:18 snarfy [C]hris, for give me if i'm wrong but I assumed that module puts ec2 tags into minion grains
21:19 snarfy or rather, it's a custom grain module that translates tags into grains
21:19 snarfy I have a question about salt mine. I'm trying to get the IP of an alias
21:19 snarfy eth0:0
21:20 [C]hris snarfy: You are correct, my question is more how to use the ec2_tags now
21:21 [C]hris I'm getting the data, just confused on how I can declare ec2_tags lets say tags with production or development values
21:21 [C]hris or rather how i get salt to assign groups per their ec2_tags
21:22 berserk joined #salt
21:24 andrew_v joined #salt
21:25 snarfy er, so i'm not a python genius, but I think you'll have to make some modifications to the grains.py module in order to get it to write tags to grains that you want
21:25 snarfy it looks like that script is primarily concerned with a 'roles' tag/grain
21:27 baweaver joined #salt
21:27 snarfy so if you generated your ec2 instances with a tag of roles:foo and had some salt-logic in your top file to key off of 'roles' grain, and the grain syncs before highstate, salt will do highstate stuff based on the roles grin match that was translated from the aws ec2 tags
21:27 snarfy clear as mud?
21:27 babilen snarfy: eth0?
21:28 snarfy babilen, yeah but then i get a list of two ips
21:28 snarfy and i have a hard time differentiating between them. if i want to use the alias ip for a particular function (clustered resources) then I need to be able to refer to it specifically
21:29 snarfy i'm trying to figure out if I need to add a whole new network interface (in aws) or if I can get this to work with the private ip as an alias
21:30 [C]hris i can use roles, and that's what i want. sorry i just started using salt yesterday. My tags in aws are, environment:production\|development. I can see them with salt "*" grain.get ec2_tags. But where do I tell salt to look for that role or tag?
21:30 babilen snarfy: Okay, you can go down the way of "first IP on eth0", but I would personally recommend to filter with network.ip_addrs by CIDR.
21:30 snarfy yeah... same cidr P
21:31 snarfy though I suppose it needn't be.
21:31 snarfy I wonder if i could use a different subnet for that traffic
21:31 baweaver joined #salt
21:32 snarfy [C]hris, targeting. command line salt -G  or - match: grains in the top file
21:33 snarfy my topfile just looks like dev: - match: grain {% for role in roles %} - {{ role }}
21:33 snarfy or. something
21:33 snarfy similar
21:34 babilen snarfy: Let me show you what I typically do: https://www.refheap.com/113969
21:34 [C]hris okay cool thanks, snarfy
21:37 babilen snarfy: That way you collect your minion's IP addresses indexed for different networks (I then also include mine_functions for more specific ones) and you can easily tailor it to your needs by setting the target expression and mine_function
21:37 heaje joined #salt
21:37 baweaver joined #salt
21:37 heaje Is there any supported salt module to get the list of block devices on a host?
21:38 heaje I should rephrase that and say, not including partitions
21:40 snarfy babilen, looks good, but i think i'd have the same problem if my ips are like 10.0.15.61 and 10.0.15.69?
21:41 patrek joined #salt
21:41 heaje I've attempted to use scsi.ls, but on CentOS 6 it fails due to the lsscsi binary not supporting one of the flags it needs (-s).  I've tried it on CentOS 7, but it fails with a Python exception.
21:41 babilen snarfy: Your box has two addresses in the same network?
21:42 snarfy well yeah. it's an aws machine. and i can add additional private IPs (in the same network) cheaply, but adding additional network interfaces costs more money
21:42 snarfy or using elastic IPs
21:43 babilen snarfy: Why would you do that?
21:44 snarfy that's a fair question. It's a workaround for a zookeeper cluster allowing me to transfer IPs between machines
21:44 snarfy so I can make a new cluster member, re-assign the private ip, and make no config changes
21:44 snarfy this is less of an issue with the new ZK that supports config changes without restarting
21:45 snarfy but we're not on that yet
21:45 whytewolf why is it everytime i hear something that breaks the brain with odd setups zookeeper seems to behind it
21:45 * snarfy shrugs
21:45 babilen snarfy: Fair enough .. how would you decide between the IPs then?
21:45 snarfy it was that way when i got here :)
21:45 snarfy babilen, exactly.
21:46 babilen I mean .. you could always filter by /32 :)
21:46 brianfeister joined #salt
21:46 subsignal joined #salt
21:46 babilen heaje: Aren't they part of grains?
21:47 heaje @babilen: Not from what I can see.  I can't see any block devices in grains.items
21:48 snarfy yanko
21:48 snarfy i am setting up some dev machine on which to try the new zk. maybe I can solve this issue another way
21:49 moogyver heaje - couldn't you just 'cmd.run lsscsi'?  or do you need it in a module?
21:49 Rumbles joined #salt
21:49 heaje moogyver: Yes, I could just run that, but I was looking for some other more "official" way if possible
21:50 snarfy cmd.run all damn day!
21:50 snarfy :D
21:50 heaje moogyver: mainly because I need the list in a state, but how do I convert string output from cmd.run to a jinja list?
21:50 heaje I couldn't find any split() function for jinja
21:53 kevinquinnyo1 joined #salt
21:53 [C]hris So this command works: salt -G "ec2_tags:environment:development" test.ping. but when I try to add 'node_type: development': - match: grain - ec2_tags to my top.sls, then issuing salt development test.ping fails. Again sorry for my newb questions just getting started with salt
21:55 whytewolf [C]hris: your grains don't match. you are using "ec2_tags:environment:development" one place and 'node_type: development' in another
21:57 babilen heaje: Write a custom grain that analysis /proc/partitions
21:58 moogyver heaje - looks like -s is in newer versions of lsscsi and shows the size.
22:04 heaje moogyver: Yeah, it's on CentOS7, but even on that OS the command fails with a python exception
22:04 moogyver what's the exception?
22:05 heaje moggyver: https://gist.github.com/heaje/4fef27a82108a96117d7
22:05 akhter joined #salt
22:06 heaje oops, moogyver ^^^
22:06 AndreasLutro that just means there's no : in majmin
22:07 heaje AndreasLutro: Fair enough, but this is a problem in vanilla 2015.8.3.  I don't have any fancy custom stuff that would cause a problem with this
22:07 heaje and the lsscsi command as salt tries to run it works just fine
22:08 heaje babilen: Yeah, that's definitely a possibility.  I was just looking for something more "official" as I mentioned earlier.  I'm not adverse to writing my own stuff if I have to.
22:08 AndreasLutro oh ok, report it as a bug
22:09 AndreasLutro I thought it was something in your own code, didn't look properly at the stacktrace
22:11 whytewolf hummm oddly scsi.ls works fine on my centos7 boxes even the two that have raid10 drives setup. and the lsscsi command between redhat and centos should be no different
22:11 slav0nic joined #salt
22:12 heaje whytewolf: hmmm, odd
22:12 whytewolf do you have any drives showing up in lsscsi without lun info [how that would be possable i can not say]
22:13 shoemonkey joined #salt
22:14 heaje whytewolf: https://gist.github.com/heaje/c8a7e7622dba9ea7bb3c
22:14 kitplummer joined #salt
22:15 whytewolf strange.
22:15 shoemonk_ joined #salt
22:15 netcho joined #salt
22:16 whytewolf I wonder if this one is doing something to the output [i have not gotten deep to the code yet] [0:3:0:0]    storage HP       P420i            6.68  -               -
22:17 whytewolf ahh yeah that one doesn't have a majmin
22:18 heaje well, for anyone that cares, I logged this at https://github.com/saltstack/salt/issues/30565
22:18 saltstackbot [#30565]title: scsi.ls fails to run both on CentOS 6 and CentOS 7 | The "scsi.ls" module doesn't appear to work correctly on CentOS 7 or 6.  ...
22:19 brianfeister joined #salt
22:19 whytewolf it does look like that last drive. since it doesn't have an actual device assigned to it.
22:20 whytewolf but yeah lsscsi isn't going to work with cent6. but in any case. i would recomend setting up a custom grain like babilen sugested.
22:21 hal58th joined #salt
22:21 whytewolf which would be the next logical and none cmd.run version
22:22 heaje Thanks for the suggestions and help.
22:23 digitalhero joined #salt
22:23 digitalhero joined #salt
22:24 * whytewolf really wishes there was a fix for ipcidr matching working with single ip's and really small subnets.
22:24 digitalhero joined #salt
22:26 shoemonkey joined #salt
22:27 relicanth joined #salt
22:27 moogyver i'm actually wondering how the pop even worked for the majmin that's missing
22:28 moogyver running that locally gives me a diff. err
22:28 whytewolf moogyver: most likely grabbed the -
22:28 moogyver yeah, that's what I figured.
22:29 moogyver ah yeah, was something i messed up looking at it locally.
22:30 whytewolf if that major,minor split happened below the rest of the pop's then yeah would have had pop errors.
22:30 shoemonk_ joined #salt
22:31 moogyver yeah, was just a stupid error on my part.  put his output as part a of multiline str and didn't split it for the loop.
22:31 digitalhero joined #salt
22:31 whytewolf ahhh
22:33 whytewolf I find it odd that there is a device that has no repersentation in /dev
22:36 norii how is that even possible
22:36 shoemonkey joined #salt
22:37 akhter joined #salt
22:38 shoemonkey joined #salt
22:42 berserk joined #salt
22:42 moogyver probably because it's the controller card and not a storage device
22:42 moogyver well, not a disk, in any case.
22:43 zenlot1 joined #salt
22:45 onlyanegg joined #salt
22:49 bhosmer_ joined #salt
22:49 whytewolf well it is a controller. compleatly missed that it said it is "storage" not "disk"
22:51 Rumbles joined #salt
22:58 twork okay, here's a new one on me. i have a minion, working fine from the master side, but when i try to run 'salt-call [anything]', i get the error we expect when a minion's key hasn't been accepted yet.
22:59 twork so far, google has only told me "accept the key", which... anybody else seen this?
23:00 twork aha! fixed.
23:01 whytewolf what was it?
23:01 twork as usual, the solution becomes both obvious and stupid when i ask out in the open somewhere.
23:01 digitalhero joined #salt
23:01 twork the minion had a wrong entry for salt in /etc/hosts
23:01 whytewolf lol. that would do it
23:02 digitalhero joined #salt
23:02 whytewolf must have changed after the salt-minion was started though for the master to have worked
23:03 digitalhero joined #salt
23:03 akhter joined #salt
23:03 twork whytewolf: yeah it was, there's a new master in the early stages, and this was a test minion
23:04 twork ...long ago, and i had forgetted.
23:04 digitalhero joined #salt
23:04 digitalhero joined #salt
23:06 digitalhero joined #salt
23:06 digitalhero joined #salt
23:07 digitalhero joined #salt
23:08 digitalhero joined #salt
23:09 digitalhero joined #salt
23:10 digitalh_ joined #salt
23:14 bbbryson joined #salt
23:14 baweaver joined #salt
23:15 shoemonkey joined #salt
23:16 Rumbles joined #salt
23:17 lompik joined #salt
23:21 snarfy joined #salt
23:26 shoemonkey joined #salt
23:36 relicanth joined #salt
23:40 keimlink joined #salt
23:41 mapu joined #salt
23:56 moogyver heaje - can you post a gist of the lsscsi on your CentOS 7 box without the '-s'? Curious if it still has 2 dashes at the end or not.
23:57 heaje moogyver: https://gist.github.com/heaje/17e040577115b46bb262
23:57 moogyver heaje - thanks.  looks like the -s is adding one of the dashes.
23:59 digitalhero joined #salt

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