Perl 6 - the future is here, just unevenly distributed

IRC log for #salt, 2018-01-12

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

All times shown according to UTC.

Time Nick Message
00:00 saltslackbridge joined #salt
00:01 alexlist joined #salt
00:04 tduerr joined #salt
00:20 tom][ left #salt
00:22 tom[] joined #salt
00:24 _JZ_ joined #salt
00:45 nonades joined #salt
01:06 jhujhiti The minion function caused an exception: AttributeError: cffi library '_openssl' has no function, constant or global variable named '__loader__'
01:07 jhujhiti it's baaaack
01:07 jhujhiti and started with nothing happening on the minion but a test.ping
01:15 justan0theruser joined #salt
01:46 nonades joined #salt
01:54 cgiroua joined #salt
02:00 cyteen_ joined #salt
02:01 kukacz_ joined #salt
02:18 socket- joined #salt
02:26 nomeed joined #salt
02:29 zerocoolback joined #salt
02:59 rem5_ joined #salt
03:00 ilbot3 joined #salt
03:00 Topic for #salt is now Welcome to #salt! <+> Latest Versions: 2016.11.8, 2017.7.2 <+> Support: https://www.saltstack.com/support/ <+> Logs: http://irclog.perlgeek.de/salt/ <+> Paste: https://gist.github.com/ <+> See also: #salt-devel, #salt-offtopic, and https://saltstackcommunity.herokuapp.com (for slack) <+> We are volunteers and may not have immediate answers
03:01 MTecknology Anyone know how you'd go about trying to remove a child element from a few hundred yaml files?
03:01 kettlewell joined #salt
03:04 hemebond MTecknology: Python? :-)
03:04 hemebond Oh, a few hundred _file_....
03:06 MTecknology I've been trying to come up with a sed or awk solution, but I know both tools very poorly
03:13 XenophonF MTecknology: make a script with ed
03:13 XenophonF how regular is this child element?
03:14 XenophonF is it always the same thing, and always the same length?
03:14 XenophonF if so your ed script would look something like:
03:14 XenophonF /element
03:14 XenophonF dd
03:14 XenophonF dd
03:14 XenophonF dd
03:14 XenophonF etc.
03:15 XenophonF there are also tools like shyaml or yaml-cli
03:17 MTecknology sample file: http://dpaste.com/1SMSDF2   I want the networking section removed. I need to do this in ~400 files.
03:18 XenophonF is that the same in all the files?
03:18 MTecknology sometimes it's the last in the list, sometimes it's not
03:19 MTecknology every file is similar, but only the assumptions I stated can be made
03:19 XenophonF ok
03:19 saltslackbridge <gtmanfred> I mean, it would be pretty easy to just load all the files in yaml.load, del networking, then do a yaml.dumps
03:19 iggy too bad there's not something like `jq` for yaml
03:20 XenophonF yeah
03:20 saltslackbridge <gtmanfred> there is
03:20 saltslackbridge <gtmanfred> https://github.com/kislyuk/yq
03:20 iggy clutch
03:20 MTecknology there's a chance that could produce output in a different order than it went in, ya?
03:20 iggy I would imagine so
03:20 gtmanfred yeah, it is a dictionary
03:20 iggy (at least I know it can with jq)
03:21 gtmanfred i mean, do it with python 3.6 and it wont
03:21 gtmanfred order dicts by default
03:21 MTecknology I'm gonna be doing lots of diffs after this and using the cksum to hopefully make my life less hellish so it's important to keep the order
03:21 iggy maybe normalize the order of them all first?
03:22 MTecknology I'm hoping that things were mostly copy/paste when they were first build.
03:22 iggy `cat file.yaml | yq > file.yaml.sorted ; mv file.yaml{,.bak} ; mv file.yaml{.sorted,}`
03:22 MTecknology So once the networking block goes, and I remove the first two lines, I'm hoping I can find matches and merge them as one file
03:27 MTecknology I was hoping this would be as easy as removing everything /except/ the networking section.
03:32 stduolc joined #salt
03:33 swa_work joined #salt
03:33 MTecknology I think I found it...  awk '/^nodes:/{flag=1;next}/networking:/{flag=0;next}/^    [a-z]/{flag=1}flag' sv1/stg_app_1_1.sls
03:37 onlyanegg joined #salt
03:40 tiwula joined #salt
03:41 MTecknology close, that first ";next" shouldn't be there. The rest worked worked perfectly. :D
03:45 XenophonF MTecknology: here's a pcre that will capture the networking section
03:45 XenophonF networking:\n(?=((     +.*\n)+))/gm
03:45 XenophonF um i mean this: /    networking:\n(?=((     +.*\n)+))/gm
03:48 nonades joined #salt
03:49 MTecknology I'll have to play with that regex soon..
03:49 MTecknology "{% include " just includes a file verbatim, ya?
03:50 XenophonF i'm trying to get it to work with perl -pe but failing
03:57 monokrome joined #salt
03:58 MTecknology HOORAAH!!!   http://dpaste.com/0P5KS6C
04:02 RF____ joined #salt
04:02 MTecknology Too bad those don't have the right pattern to do "cluster" matching and they'll have to stay separated, but hey.. I got what I want! :D
04:03 MTecknology We're finally going to stop pushing a half gig of pillar data down to every minion!
04:18 XenophonF woah how'd you do it?
04:18 XenophonF I got that regexp to match but couldn't get it to work with a substitution.
04:19 MTecknology not a literal half gig, but a 24,000 line yaml file is passed verbatim to all of ~400 minions
04:20 Lionel_Debroux_ joined #salt
04:20 MTecknology I've been working on breaking things up into node-specific (a.k.a. networking) configs and cluster-specific configs. I'm trying to find various ways to merge that cluster stuff so that I can get it to as few files as possible.
04:20 XenophonF I was going to try converting yaml to json, using jq to remove the networking key, and converting it back
04:22 MTecknology for i in */*; do awk '/^nodes:/{flag=1}/networking:/{flag=0;next}/^    [a-z]/{flag=1}flag' "$i" >t; mv t "$i"; done
04:23 shiranaihito joined #salt
04:29 XenophonF wow nice
04:49 MTecknology Can I have jinja in files included using include?
04:49 nonades joined #salt
04:50 MTecknology I feel like the answer to that is no, but it poses a bit of a wrench into my plans.
05:15 g3cko joined #salt
05:16 zerocoolback joined #salt
05:40 mk-fg joined #salt
05:40 mk-fg joined #salt
05:44 tongpu joined #salt
05:46 golodhrim|work joined #salt
05:50 nonades joined #salt
05:55 sergeyt joined #salt
06:03 justanotheruser joined #salt
06:16 indistylo joined #salt
06:27 fujexo[m] joined #salt
06:31 NightMonkey joined #salt
06:31 aruns joined #salt
06:51 nonades joined #salt
07:04 indistylo joined #salt
07:08 Guest73 joined #salt
07:52 nonades joined #salt
07:58 Ricardo1000 joined #salt
08:00 indistylo joined #salt
08:02 BarBQ joined #salt
08:18 Hybrid joined #salt
08:18 aldevar joined #salt
08:30 Tucky joined #salt
08:30 CrummyGummy joined #salt
08:35 Guest73 joined #salt
08:51 inad922 joined #salt
08:52 nonades joined #salt
08:57 Guest73 joined #salt
09:03 Hybrid1 joined #salt
09:09 hammer065 joined #salt
09:20 Hybrid joined #salt
09:25 q1x joined #salt
09:32 mrBen2k2k2k joined #salt
09:53 nonades joined #salt
10:05 mattfoxx joined #salt
10:05 Lionel_Debroux joined #salt
10:10 mattfoxxx joined #salt
10:10 indistylo joined #salt
10:15 Hybrid joined #salt
10:31 sergeyt joined #salt
10:36 LocaMocha joined #salt
10:42 _JZ_ joined #salt
10:44 sh123124213 joined #salt
10:50 huddy joined #salt
10:53 yidhra joined #salt
10:54 nonades joined #salt
11:05 yidhra joined #salt
11:09 indistylo joined #salt
11:22 jacksontj joined #salt
11:42 nku joined #salt
11:42 oida joined #salt
11:46 demize joined #salt
11:55 nonades joined #salt
12:04 indistylo joined #salt
12:06 inad922 joined #salt
12:08 GrisKo joined #salt
12:47 Guest73 joined #salt
12:56 nonades joined #salt
13:04 sergeyt joined #salt
13:13 kwmiebach joined #salt
13:13 carlwgeorge joined #salt
13:13 inad922 joined #salt
13:18 Nahual joined #salt
13:31 inad922 joined #salt
13:31 RF__ joined #salt
13:32 BarBQ joined #salt
13:42 kettlewell joined #salt
13:45 kettlewell joined #salt
13:50 BarBQ joined #salt
13:54 jdipierro joined #salt
13:57 gh34 joined #salt
14:07 inad922 joined #salt
14:12 colttt joined #salt
14:13 sergeyt joined #salt
14:25 kettlewell joined #salt
14:30 cgiroua joined #salt
14:33 sergeyt joined #salt
14:35 racooper joined #salt
14:38 nonades joined #salt
14:45 cgiroua joined #salt
14:46 t0rrant joined #salt
14:49 sergeyt joined #salt
14:52 flagword joined #salt
15:01 edrocks joined #salt
15:07 sjorge joined #salt
15:11 daxroc joined #salt
15:15 cgiroua joined #salt
15:25 oida joined #salt
15:36 saltslackbridge <chris.ruscio> only the master needs access to an external pillar (the minion isn't accessing it directly) right?
15:38 saltslackbridge <gtmanfred> yes
15:39 m4rk0 joined #salt
15:39 m4rk0 Hello
15:40 m4rk0 Please tell me how to get gateway interface name with salt as string?
15:45 Heartsbane joined #salt
15:54 sergeyt joined #salt
16:00 kettlewell joined #salt
16:04 kettlewe_ joined #salt
16:05 shanth_ joined #salt
16:05 kettlewell joined #salt
16:08 kettlewell joined #salt
16:09 mchlumsky joined #salt
16:16 mchlumsky joined #salt
16:17 sergeyt joined #salt
16:18 Kax joined #salt
16:22 tiwula joined #salt
16:28 kettlewell joined #salt
16:33 lordcirth_work m4rk0, network.default_route
16:36 XenophonF MTecknology: a YAML include happens after Jinja's already run, so no that won't work
16:37 XenophonF you can move the relevant Jinja code/vars/macros/whatev into a "lib.jinja" or the like that gets imported by the relevant SLSes
16:37 bbradley joined #salt
16:37 scarcry joined #salt
16:37 _dp joined #salt
16:37 _dp joined #salt
16:37 Armadillo joined #salt
16:37 f3d joined #salt
16:37 qman__ joined #salt
16:37 ntropy joined #salt
16:37 dmaphy joined #salt
16:37 utahcon_ joined #salt
16:37 MTecknology joined #salt
16:37 XenophonF it ends up looking something like this - https://github.com/irtnog/salt-states/blob/development/tomcat/shibboleth-idp.sls
16:37 copelco__ joined #salt
16:37 nahkiss joined #salt
16:38 chutzpah joined #salt
16:38 petems joined #salt
16:38 XenophonF (I realize you're working with Pillar data and not States, but it's the same thing from this perspective.)
16:38 hoonetorg joined #salt
16:40 XenophonF with winrepo/winrepo-ng, is the package version string just for show?  or should it match the version numbers stored in the registry?
16:40 XenophonF e.g., I wrote the package def for Visual Studio Community 2017, and for the version number I used 15.5.27130.0, which is what it is in the registry
16:41 XenophonF but if it's supposed to be for users to select a version, I should probably change that to '15.4', b/c that's what Microsoft calls it
16:42 saltslackbridge <mts-salt> i believe it needs to match the string displayed in add/remove programs so that salt can determine if a newer version is available
16:42 tom[] joined #salt
16:42 nledez joined #salt
16:42 nledez joined #salt
16:42 jacksontj joined #salt
16:45 RandyT joined #salt
16:45 RandyT joined #salt
16:51 cgiroua_ joined #salt
16:51 XenophonF That's what I thought, but the docs say that Salt can't perform upgrades.
16:52 XenophonF which seems to be bourne out in the code
16:52 XenophonF so I'm confused :)
17:00 nonades joined #salt
17:01 saltslackbridge <mts-salt> tbh i only got our winrepo working last week, i haven't actually tried upgrading with it!
17:03 om2 joined #salt
17:10 om2 joined #salt
17:32 jdipierro joined #salt
17:42 Edgan joined #salt
17:44 sergeyt joined #salt
17:46 sergeyt joined #salt
17:48 inad922 joined #salt
17:51 Edgan joined #salt
17:56 onlyanegg joined #salt
18:04 nonades joined #salt
18:06 hashwagon joined #salt
18:07 todder left #salt
18:09 hashwagon Hello I was wondering if anyone could give me a tip on configuring a state to check if a postgres database exits, and if it doesn't to run a state file.
18:10 pipps joined #salt
18:12 dlloyd put an unless clause in the state you want to run and have it use the postgresql.db_exists module?
18:12 hashwagon Thanks, dlloyd, I'm not familiar with unless so I'll read up on it.
18:13 hasues joined #salt
18:13 hasues joined #salt
18:14 dlloyd oh unless might only do commands, hmm
18:14 saltslackbridge <mts-salt> you probably want to assert that the database exists in one state, and use onchanges to trigger the rest
18:15 saltslackbridge <mts-salt> https://docs.saltstack.com/en/latest/ref/states/all/salt.states.postgres_database.html
18:17 sol7 joined #salt
18:22 hashwagon Thanks, I'll read up on that. I appreciate it.
18:24 sjorge joined #salt
18:26 rockey joined #salt
18:26 pipps joined #salt
18:27 BarBQ joined #salt
18:34 ouzo12 joined #salt
18:34 ___[0_0]___ joined #salt
18:34 dstensnes joined #salt
18:34 toofoo[m] joined #salt
18:34 jor joined #salt
18:35 benasse joined #salt
18:35 Swant joined #salt
18:35 eightyeight joined #salt
18:35 carmony joined #salt
18:39 nledez joined #salt
18:39 nledez joined #salt
18:39 RandyT joined #salt
18:39 RandyT joined #salt
18:43 hammer065 joined #salt
18:45 Hybrid joined #salt
18:48 pipps joined #salt
18:49 stooj joined #salt
18:49 dagb joined #salt
19:00 pipps joined #salt
19:03 pipps99 joined #salt
19:03 Hybrid joined #salt
19:06 pipps joined #salt
19:11 going_to_mars joined #salt
19:14 ymasson joined #salt
19:14 DammitJim joined #salt
19:21 nixjdm joined #salt
19:35 ipmb What's the best way to structure a reactor which needs access to pillar data?
19:36 ipmb I need to compare the data in an event to a pillar to see what action to take
19:37 ipmb I suppose I could write a custom module which handles the logic and call it from the reactor?
19:58 oida joined #salt
20:11 nona joined #salt
20:31 pipps joined #salt
20:33 pipps99 joined #salt
20:35 pipps_ joined #salt
20:37 pipps joined #salt
20:42 nonades left #salt
20:45 pipps joined #salt
20:48 pipps99 joined #salt
20:49 pipps joined #salt
20:52 aldevar joined #salt
20:56 pipps joined #salt
20:58 dfinn joined #salt
21:00 nona joined #salt
21:01 ipmb Is there a way I can retrieve a pillar off the master when running orchestrate?
21:01 ipmb Trying this without any luck https://groups.google.com/d/msg/salt-users/C55m7xXzH3M/HBr0_VukAwAJ
21:02 ipmb {{ salt.pillar.get(pillar_str) }}
21:02 DammitJim joined #salt
21:22 Neighbour ipmb: But only minions have pillars, that's what you're specifying in the pillar top.sls
21:22 ipmb the master is also a minion
21:24 Neighbour how would you figure that?
21:24 ipmb that's my question :)
21:24 Neighbour in that case, the answer is no
21:24 Neighbour the master is not also a minion
21:25 Neighbour you can, however, run a minion on the same machine as the master
21:25 Neighbour and call *that* the master minion
21:25 ipmb yes, that's what I'm saying
21:25 ipmb now I'm running orchestration on the master minion
21:25 Neighbour no, orchestration always runs on the master
21:25 ipmb and I want to get data stored in the master minion's pillar
21:25 Neighbour not on the 'master minion' :)
21:25 Neighbour ah, that I can help you with :)
21:26 Neighbour use this: {% set minion_pillar = salt['saltutil.runner']('pillar.show_pillar', minion='master minion') %}
21:27 ipmb ok, I'll give that a shot
21:27 Neighbour then you can use the minion_pillar jinja variable as a dictionary in your file
21:27 Neighbour if you include more parameters between (), they'll be interpreted as grains (which can be used in your pillar sls files)
21:33 ipmb cool! looks like that worked
21:33 ipmb how do I pass custom pillar data to "salt.state" in the orchestrator?
21:34 ipmb equivalent to `salt myminion state.apply pillar='{custom: "data"}'`
21:37 pipps joined #salt
21:41 Neighbour salt-run state.orchestrate your.state.sls pillar='{"custom": "data"}'
21:41 ipmb figured it out. it's just in the list of dict args passed to `salt.state`
21:42 Neighbour ah, right, my mistake...my example was for passing custom pillar data into the orchestration, but your question was passing custom pillar data from the orchestration to the salt.state
21:42 ipmb no, actually in the sls: https://dpaste.de/cVzt
21:42 ipmb thanks for your help!
21:43 Neighbour you're welcome
21:45 darioleidi joined #salt
21:46 yeahbabyitsme joined #salt
21:46 yeahbabyitsme left #salt
21:49 ggolin joined #salt
21:51 ggolin hi guys. i am running into a problem with salt-minion on the latest suse enterpise. things we chugging along until i ran the deepsea prep stage. it installed a bunch of packages and now salt-minion fails with this message: salt-minion: error: Failed to load configuration: Failed to initialize OpenSSL library (OPENSSL_init_crypto failed)
22:01 Guest73 joined #salt
22:01 pipps joined #salt
22:10 Guest73 joined #salt
22:11 BarBQ joined #salt
22:12 pipps joined #salt
22:29 Felgar joined #salt
22:31 pipps joined #salt
22:39 Guest73 joined #salt
22:51 jpsharp What's the best way of pulling some configuration from a mysql database to push out via salt?
22:52 saltslackbridge <gtmanfred> you can store pillar data in mysql
22:52 ipmb Neighbour: starting to rethink my approach... What's the cleanest way to get a list of minions that match some matcher from orchestrate
22:52 saltslackbridge <gtmanfred> ext_pillar
22:52 ipmb https://docs.saltstack.com/en/latest/ref/pillar/all/salt.pillar.mysql.html
22:53 saltslackbridge <gtmanfred> ipmb i use the cache.grains runner which has tgt and tgt_type, then you can check what minions are in the grains cache
22:53 jpsharp Ah, excellent.  thank you.
22:54 pipps joined #salt
22:54 ipmb so the grain doesn't really matter? you're just after the keys?
22:54 saltslackbridge <gtmanfred> yes
22:56 jpsharp I just started with salt on Tuesday, so I'm most definitely a n00b.
22:56 pipps joined #salt
23:02 pipps joined #salt
23:10 cyteen_ joined #salt
23:10 XenophonF joined #salt
23:13 babilen joined #salt
23:18 eightyeight what is the proper way to upgrade the linux kernel without upgrading the rest of the packages on a salt minion?
23:20 dcrouch joined #salt
23:21 ipmb `salt '*' pkg.install [pkg-name] refresh=True`
23:24 vodik joined #salt
23:26 pipps joined #salt
23:26 eightyeight same for the kernel?
23:26 eightyeight (patching against spectre/meltdown)
23:27 ipmb replace [pkg-name] with whatever your distro calls the kernel
23:27 ipmb you'll also need to reboot
23:27 eightyeight yeah. rebooting is assumed.
23:27 ipmb ...and test first to make sure it doesn't cause problems :)
23:27 eightyeight thx
23:30 vodik joined #salt
23:31 pipps joined #salt
23:33 pipps99 joined #salt
23:41 stewgoin joined #salt
23:45 Trauma joined #salt
23:47 vodik joined #salt
23:56 vodik joined #salt
23:56 rubenb joined #salt
23:58 pipps joined #salt

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