Perl 6 - the future is here, just unevenly distributed

IRC log for #salt, 2018-05-08

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

All times shown according to UTC.

Time Nick Message
00:00 onslack joined #salt
00:28 dxiri joined #salt
00:30 zwliu joined #salt
00:35 zwliu joined #salt
00:39 zerocoolback joined #salt
00:42 zerocoolback joined #salt
00:48 zwliu joined #salt
00:50 zerocoolback joined #salt
00:59 justan0theruser joined #salt
01:24 jesusaur joined #salt
01:47 shiranaihito joined #salt
01:55 dxiri joined #salt
01:57 ilbot3 joined #salt
01:57 Topic for #salt is now Welcome to #salt! <+> Latest Versions: 2017.7.5, 2018.3.0 <+> 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
01:58 stooj joined #salt
02:13 DammitJim joined #salt
02:21 zerocoolback joined #salt
02:28 dxiri joined #salt
02:46 dendazen joined #salt
03:08 jrklein joined #salt
03:13 jrklein joined #salt
03:39 Eugene DammitJim - my personal 2c: don't manage people-users in Salt; use LDAP or some other directory service for that; its what its designed to do. Do use Salt to manage system users(UID <500). It breaks a lot less assumptions when you do it this way.
03:55 MTecknology I think that suggestion has been made a few times..
04:15 hemebond joined #salt
04:15 hrumph joined #salt
04:41 sugarfree joined #salt
05:19 jesusaur joined #salt
05:28 Pjusur joined #salt
06:10 stooj joined #salt
06:13 dwfreed joined #salt
06:14 GnuLxUsr joined #salt
06:22 chesty joined #salt
06:43 briner joined #salt
06:46 briner_ joined #salt
06:46 jesusaur joined #salt
07:14 Pjusur joined #salt
07:22 jrenner joined #salt
07:30 Ricardo1000 joined #salt
07:33 inad924 joined #salt
07:37 tys101010 joined #salt
07:40 CrummyGummy Hi
07:40 CrummyGummy I'm trying to work out how many parts there are in an array generated by tokenising the hostname on '-' . The length operator isn't being recognised. Below is my code. Can anyone assist?
07:40 CrummyGummy https://gist.github.com/waynegemmell/f438fc28a51da3841b0b2de5d001e441
07:42 Naresh joined #salt
07:46 CrummyGummy {% if parts|length < 4 %}
07:46 CrummyGummy Jinja variable 'length' is undefined
07:48 orichards joined #salt
07:55 zwliu joined #salt
08:06 sayyid9005 joined #salt
08:12 awerner joined #salt
08:13 Mattch joined #salt
08:19 DanyC joined #salt
08:23 xet7 joined #salt
08:25 xet7 joined #salt
08:29 Elsmorian joined #salt
08:40 Arendtsen joined #salt
08:42 mrueg joined #salt
08:42 Elsmorian joined #salt
08:42 tom29739 joined #salt
08:46 orichards1 joined #salt
08:51 inad924 joined #salt
08:52 orichards joined #salt
08:59 exarkun joined #salt
09:00 gmoro joined #salt
09:16 inad924 joined #salt
09:34 rollniak1 joined #salt
09:39 Malte joined #salt
09:39 hemebond CrummyGummy: Worked for me.
09:40 hemebond Wait...
09:41 MTecknology |foo vs |foo() ?
09:41 hemebond |length works for me.
09:44 yidhra joined #salt
09:46 gmoro joined #salt
09:46 xet7 joined #salt
09:48 xet7 joined #salt
09:51 jhauser joined #salt
09:54 ExtraCrispy joined #salt
10:13 inad924 joined #salt
10:21 arlyon joined #salt
10:23 stooj joined #salt
10:33 av_ joined #salt
10:37 rollniak1 joined #salt
11:00 nku_ left #salt
11:00 nku joined #salt
11:31 Pjusur joined #salt
11:34 Pjusur joined #salt
11:41 sjorge joined #salt
11:43 dendazen joined #salt
11:48 zulutango joined #salt
11:49 GnuLxUsr joined #salt
11:51 briner joined #salt
11:56 exarkun left #salt
11:58 dxiri joined #salt
12:00 CrummyGummy hemebond: Sorry, was afk.I wonder why it works for you and not me.
12:00 CrummyGummy Any idea?
12:04 hemebond No idea. Did you paste your actual code?
12:04 hemebond What version are you running?
12:05 hemebond Is it in a pillar or a state?
12:12 CrummyGummy yes, actual code
12:12 zerocoolback joined #salt
12:12 CrummyGummy it's in the pillar
12:12 CrummyGummy version 2017.7.4
12:13 CrummyGummy I'll update quick
12:14 zer0def i'm curious, which version of jinja are you running, CrummyGummy?
12:14 Nahual joined #salt
12:14 CrummyGummy zer0def: Whatever comes with Salt I guess.
12:15 CrummyGummy I'm not aware of it being installed separately
12:15 zer0def it's a dependency, so yum should list it
12:15 CrummyGummy I'll check when this update is done
12:16 CrummyGummy python-jinja2:all/xenial 2.8-1 uptodate
12:20 zer0def i was suspecting some sort of old version of jinja, which wouldn't have had the `length` filter, but as far as i can tell, that shouldn't be the case, so i didn't ask
12:25 hemebond The fact that it thinks it's a variable suggests some code issue.
12:27 fernie hmmh, salt.states.file.comment, is there a way to comment multiline splitted with \
12:28 xet7 joined #salt
12:29 arlyon joined #salt
12:30 xet7 joined #salt
12:32 xet7 joined #salt
12:33 DammitJim joined #salt
12:48 edrocks joined #salt
12:53 AngryJohnnie joined #salt
12:57 crux-capacitor hi all, when a new minion connects to my master for the first time, the reactor accepts its key and then runs the highstate. One state included in the highstate relies on some values kept in pillar, which in turn relies on a custom grains script running. It seems like the custom grains are not getting sync'd automatically
12:58 crux-capacitor I have to manually run a saltutil.sync_grains, and then the pillar values are there and the highstate can run. Any idea what could cause that?
12:58 user389 joined #salt
12:59 hemebond crux-capacitor: That's normal.
13:01 crux-capacitor oh, i read in the docs that running a highstate syncs grains automatically
13:01 crux-capacitor but now I see this: https://docs.saltstack.com/en/latest/topics/reactor/index.html#syncing-custom-types-on-minion-start
13:02 crux-capacitor yes here it says that they are automatically synced when the highstate is called: https://docs.saltstack.com/en/latest/topics/grains/#syncing-grains
13:02 hemebond They are, but pillars are compiled on the master
13:02 hemebond And then sent to the minion
13:03 hemebond Where the minion compiles the states
13:05 crux-capacitor got it, thanks for the sanity check
13:09 DammitJim joined #salt
13:20 whyzgeek joined #salt
13:27 jbkc85 joined #salt
13:32 tiwula joined #salt
13:37 XenophonF eureka!
13:37 XenophonF I have certbot sending Salt events at certificate renewal time.
13:38 XenophonF And I have certbot-managed certificates available in Pillar
13:39 XenophonF All I have left to write is a Reactor that starts a highstate job on the appropriate minions whenever a certificate gets renewed.
13:52 crux-capacitor ok so I added another reactor to sync_grains, as described in the first article I linked to. It's running, but the grains arent syncing quickly enough for the highstate to run without error
14:00 crux-capacitor its complaining of a pillar render error. would I have to use orchestration to make sure grains and pillar are set up prior to the initial highstate running?
14:00 cgiroua joined #salt
14:01 arlyon joined #salt
14:03 hrumph_ joined #salt
14:03 sayyid9006 joined #salt
14:06 gmoro joined #salt
14:08 Ricardo1000 joined #salt
14:08 megamaced joined #salt
14:10 Elsmorian joined #salt
14:10 whyzgeek joined #salt
14:10 stooj joined #salt
14:12 xet7 joined #salt
14:12 alvinstarr joined #salt
14:15 AngryJohnnie joined #salt
14:16 _dp joined #salt
14:16 _dp joined #salt
14:19 edrocks joined #salt
14:21 dxiri joined #salt
14:29 arlyon joined #salt
14:30 mchlumsky joined #salt
14:30 xet7 joined #salt
14:39 dezertol joined #salt
14:42 XenophonF so apparently Salt Pillar doesn't merge contents of pillar_roots and ext_pillar?!
14:43 XenophonF so given pillar_roots=['/usr/local/etc/pillar','/home/certbot/etc/live'] and ext_pillar pointing at a Git repo
14:43 XenophonF an SLS in /usr/local/etc/pillar can import_text stuff in /home/certbot/etc/live
14:43 XenophonF but if you try the exact same import_text statement in an SLS in the Git repo, it fails
14:43 XenophonF now what do I do?
14:45 onslack <gtmanfred> edgan <https://github.com/saltstack/salt/pull/47541>
14:48 xet7 joined #salt
14:49 XenophonF maybe file_tree + pillarstack?
14:55 briner joined #salt
14:58 jeffspeff joined #salt
14:58 openstacking_123 joined #salt
15:06 xet7 joined #salt
15:08 edrocks joined #salt
15:10 XenophonF no that won't work either
15:13 XenophonF I wonder if I can use file.read instead?
15:14 edrocks joined #salt
15:14 nixjdm joined #salt
15:16 Virgo_ joined #salt
15:22 XenophonF works locally - let's see if that works from an SLS in my git_pillar repo
15:25 dendazen joined #salt
15:32 dezertol joined #salt
15:34 Deliant joined #salt
15:34 ddg joined #salt
15:35 briner joined #salt
15:37 inad924 joined #salt
15:38 Pjusur joined #salt
15:38 CrummyGummy joined #salt
15:40 edrocks joined #salt
15:47 XenophonF looks like it
15:47 DammitJim joined #salt
15:47 XenophonF well that's ugly but whatever
16:02 DammitJim1 joined #salt
16:12 DanyC joined #salt
16:13 DanyC_ joined #salt
16:15 xet7 joined #salt
16:20 unixdude joined #salt
16:24 dxiri joined #salt
16:28 arlyon joined #salt
16:33 xet7 joined #salt
16:34 Edgan gtmanfred: :)
16:35 Edgan gtmanfred: Thanks
16:36 druonysuse joined #salt
16:39 rcvu joined #salt
16:43 Edgan XenophonF: Can you give a short description of pillarstack?
16:43 rcvu Hey trying to get pyvmomi and salt-cloud to play nice
16:43 rcvu I got pyvmomi installed through pip but salt-cloud doesnt recognize itsince it is in /usr/local/lib/python27/...
16:44 rcvu So what should I be adding to my env to make salt-cloud look there for modules?
16:44 Edgan rcvu: what distro/release?
16:44 rcvu this is the latest ubuntu docker imagew
16:44 rcvu so 18.04
16:44 onslack <gtmanfred> add /usr/local/lib/python27/site-packages to PYTHONPATH and set it in a dropin file for the salt-minion.service
16:45 Edgan rcvu: You intending to run this out of Jenkins or, just using docker on your laptop?
16:45 rcvu Jenkins
16:45 Edgan rcvu: Trying to spin clusters with salt-cloud?
16:45 rcvu Sure am
16:46 rcvu Had it working before using Alpine but now am switching to ubuntu as base
16:46 Edgan rcvu: How are you planning on writing the yaml for salt-cloud?
16:46 onslack <gtmanfred> if you are doing it for a jenkins job, and use docker containers as the jenkins nodes, you could add PYTHONPATH=/usr/local/python27/dist-packages
16:48 rcvu What did you mean by set it in a dropin file for the salt-minion.service ?
16:48 onslack <gtmanfred> look up systemd unit dropin files
16:49 rcvu Ok will do, I have been trying the export PYTHONPATH like you mentioned and no luck
16:50 rcvu Edgan: I just hack it together with sed and bash stuff
16:51 rcvu onslack: It did work I just wasn't exporting the var to the right user's shell
16:51 rcvu Thanks
16:51 onslack <gtmanfred> :+1:
16:52 Edgan rcvu: You would probably be better off using jinja like in Salt to macro the yaml generation.
16:53 rcvu Yes, I assumed there was a better way to do it but I don't need it to be extensible right now.
16:53 rcvu Thanks for the headsup though
16:55 Elsmorian joined #salt
16:57 xet7 joined #salt
17:03 tiwula joined #salt
17:04 xet7 joined #salt
17:04 lane_ joined #salt
17:06 xet7 joined #salt
17:12 AngryJohnnie joined #salt
17:13 arlyon joined #salt
17:20 exarkun joined #salt
17:20 openstacking_123 joined #salt
17:25 unixdude what is the correct way to generate a password hash for freebsd?
17:25 unixdude for use in user.present
17:31 onslack <gtmanfred> <https://lists.freebsd.org/pipermail/freebsd-questions/2008-October/183727.html>
17:31 onslack <gtmanfred> now, i know they don’t use openssl anymore, and instead they use libressl, probably best to actually ask freebsd people
17:32 unixdude ok thanks
17:34 sastorsl joined #salt
17:34 unixdude hmm
17:35 xet7 joined #salt
17:35 unixdude well i just tested it, i set the same password on two different systems and the hashes were different due to salting
17:35 onslack <gtmanfred> yes
17:35 unixdude but the different hashes still work on each system with the same password
17:35 onslack <gtmanfred> yes
17:35 onslack <gtmanfred> because that is how salts work
17:36 unixdude yeah, i was just unsure if it would work like that in saltstack
17:36 unixdude and no problem.
17:36 unixdude (on freebsd)
17:56 openstacking_123 joined #salt
18:07 exarkun left #salt
18:16 jbkc85_ joined #salt
18:23 stooj joined #salt
18:30 Yamakaja joined #salt
18:30 Red_Devil joined #salt
18:32 oida joined #salt
18:40 AngryJohnnie joined #salt
18:40 arlyon joined #salt
18:44 XenophonF anyone on with commit access to apache-formula? just filed a break-fix for FreeBSD - https://github.com/saltstack-formulas/apache-formula/pull/225
18:47 pcn Has grains.get fqdn_ip4 always returned a list?  Or is that a documented change in 2018.3?
18:48 wryfi_ i believe it was a list in 2017.x and 2016.x
18:48 rjc joined #salt
18:48 wryfi has anyone here solved the issue where salt minion disconnects after an ip change, and won't reconnect until the minion is restarted?
18:48 Edgan pcn: https://pastebin.com/0C0UEeZH
18:49 c4rc4s joined #salt
18:49 wryfi i see a couple of related github issues but they're all a bit long in the tooth
18:50 rjc hi all
18:50 pcn Oh, it's always been a list, but it didn't used to make 127.0.0.1 first
18:50 Edgan wryfi: Most people using VMs wouldn't see such an issue. You expect a VM's ip to not change out from under you.
18:50 pcn Yeah, I think I'm goign to see if I can write a filter that just gets rid of localhost
18:51 wryfi Edgan: it's an issue for us at provisioning.
18:51 rjc I'm running into an issue where 1 out of my 4 test minions does not run when starting the service
18:51 wryfi the first highstate run sets the machine's permanent static addrss
18:51 Edgan pcn: The link above is probably a better way than trying to filter out unknown number of ips, and then they change the order again in the future
18:51 Edgan wryfi: Not using "static" dhcp?
18:52 wryfi no
18:52 Edgan wryfi: It is a better way
18:52 wryfi thanks, that's not the question i asked.
18:52 rjc I removed the keys from the server, uninstalled it, removed all config files, etc. reinstalled to no avail
18:52 rjc http://ix.io/19OZ
18:52 Edgan wryfi: There is more than way to solve a problem, and there is a reason most people don't have this problem.
18:52 pcn I have a pretty controlled environment
18:53 rjc the remaining three work absolutely fine
18:53 Edgan pcn: ?
18:53 whytewolf or, use https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.network.html#salt.modules.network.ip_addrs instead of trying to parse the grains.
18:53 wryfi Edgan: then why are there multiple open issues in the issue tracker, if "nobody" has this problem. please stop telling me the "right" way to run my infrastructure. thanks.
18:53 Edgan wryfi: I didn't say nobody, I said most people. Also why did no one fix it? Maybe they used a workaround.
18:54 * wryfi didn't come here for an argument
18:54 arlyon_ joined #salt
18:59 whytewolf wryfi: have you tried https://docs.saltstack.com/en/latest/ref/configuration/minion.html#ping-interval and https://docs.saltstack.com/en/latest/ref/configuration/minion.html#master-tries the default settings generally don't allow the minion to detect and reconnect in a few cases. but are set that way to avoid flooding the masters.
19:02 shoogz joined #salt
19:07 dxiri joined #salt
19:09 pcn Edgan: I'm going to avoid the custom grain for now because I only need that value for my saltmaster in one place.  Thanks for pointing me in the right direction.
19:12 wryfi whytewolf: no, i haven't tried fiddling with those knobs. will experiment. thank you!
19:14 arlyon joined #salt
19:18 rollniak1 joined #salt
19:19 rollniak joined #salt
19:33 fuhry joined #salt
19:33 openstacking_123 joined #salt
19:33 fuhry oh hey there's more people here (I shall suggest a change to the /topic in #saltstack, which is where I tried first).
19:34 fuhry I am wondering if there is an API to query a matched list of minions without attempting to execute any command on them. Specifically I am looking for a way to do this through the REST API
19:34 fuhry right now I can see that `GET /minions` returns a giant JSON array of all minions and grains, but there is no server side filtering. We have over 3000 minions in our deployment so I would like to filter these results server-side.
19:35 mavhq joined #salt
19:35 pcn Another 2018.3 question: are there any changes that would break actions on aws instances?
19:35 onslack <gtmanfred> you can use the salt runner to check the grains cache
19:36 pcn Specifically ec2 disable_term_protect seems to be saying it's an invalid action on an ec2 instance?
19:39 LostSoul joined #salt
19:41 edrocks joined #salt
19:47 briner joined #salt
19:55 pcn Yeah, it looks like in develop cloud/clouds/ec2.py doesn't have disable_term_protect anymore?  https://github.com/saltstack/salt/blob/develop/salt/cloud/clouds/ec2.py
20:02 pcn How did that happen?
20:03 whytewolf pcn do you know when it last existed?
20:08 pcn Not yet.  I know it's on line 3651 of 2017.7.2, but I'd have to start bisecting from there.  I need to run an errand, but I'm curious myself.
20:08 hrumph__ joined #salt
20:08 whytewolf well i just checked and it is in 2017.7.5
20:09 pcn And still there in 20...
20:09 pcn Yeah, you beat me to it.
20:09 pcn I'll look when I et back in a few
20:18 rollniak joined #salt
20:31 sjorge joined #salt
20:42 defsdoor joined #salt
20:43 Zachary_DuBois joined #salt
20:53 whytewolf pcn: looks like the commit in question https://github.com/saltstack/salt/commit/ba17b2865f46a790b0c80a1e8f78e57af8a97f83#diff-0768a1f659018eb6a72d43930aba9cdd
20:54 dendazen joined #salt
21:00 pcn Yeah, looks like it was me.
21:00 pcn The irony
21:00 pcn I'll put in a PR to fix that.
21:01 pcn And the best part is the commit subject: "Now I understand how this is supposed to work."  Bwa...bwa......
21:01 whytewolf welp ...
21:08 briner joined #salt
21:30 miruoy joined #salt
21:33 Felgar joined #salt
21:36 pcn SO sorry
21:36 pcn https://github.com/saltstack/salt/pull/47549
21:37 onslack <gtmanfred> pcn, is this fixing the 2018.3 branch? if yes, please open that pr against 2018.3
21:42 pcn K
21:42 CeBe joined #salt
21:46 druonysus joined #salt
21:54 pcn Here: https://github.com/saltstack/salt/pull/47550
22:03 obimod joined #salt
22:03 obimod hey guys!
22:04 obimod anyone interested in helping me out with merging a specialized state into a default state?
22:04 obimod :D
22:04 hemebond obimod: What does that mean?
22:07 obimod Well, I have a dict in a #!py state that has the boilerplate state, i pull in the specific state via "slsutil.renderer" and merge it in using __salt__["slsutil.merge"](default_state, rendered_state)
22:07 druonysus joined #salt
22:08 obimod Merge it into the default state that is... specifically there are a bunch of docker_container.running params (i.e. {restart_policy: 'on-failure:12'}). My issue right now is that the slsutil.merge method isn't merging OrderedDicts together
22:10 hemebond Can you paste an example or the code itself?
22:10 hemebond (into a pastebin of course)
22:10 obimod for sure!
22:21 obimod hemebond: here's the gist -- https://pastebin.com/3tBMc2Lc (I'd like to deep-merge OrderedDicts / itemized dicts)
22:22 hemebond Right, it's not having trouble merging the dict, it's merging a list.
22:24 hemebond Have you tested with one of the other merge strategies?
22:24 hemebond Or tried slsutil.update() ?
22:25 onslack <gtmanfred> probably try the recurse strategy
22:35 obimod recurse strategy doesn't seem to work, i'll test out the update method
22:36 obimod although I may be applying it in a non-optimal manner
22:46 obimod i think it's me pulling in OrderedDicts via slsutil rendering, and attempting to merge those with raw lists with dicts
22:50 obimod or maybe the encoding...
22:50 obimod u'keyname' :/
22:57 obimod nope, hmm
23:24 valkyr2e joined #salt
23:26 obimod doesn't look like we're recursing into lists within the slsutil.merge methods -- https://github.com/saltstack/salt/blob/d1d966abc7fb484ea6b4082df7ff4d6488272467/salt/utils/dictupdate.py#L59
23:33 obimod or rather, not recursing into OrderedDicts / itemized objects... we're recursing into lists but not detecting if they are actually OrderedDicts / itemized objects
23:43 hemebond So what you really need is the extends functionality.
23:43 hemebond Which appears to be what you're actually trying to do.
23:55 obimod right--my issue is that i was using a list of dicts instead of an OrderedDict object. and i suppose it would be an anti-pattern to add support for detecting lists which really want to be ordered dicts

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