15:00:17 #startmeeting ansible core 15:00:17 Meeting started Thu Dec 14 15:00:17 2017 UTC. The chair is thaumos. Information about MeetBot at http://wiki.debian.org/MeetBot. 15:00:17 Useful Commands: #action #agreed #halp #info #idea #link #topic. 15:00:17 The meeting name has been set to 'ansible_core' 15:00:31 good afternoon :-) 15:00:35 gm 15:00:36 * mikedlr waves 15:01:31 howdy 15:02:20 #chair sivel 15:02:21 Current chairs: sivel thaumos 15:06:23 i'm here ... distracted by tech support 15:06:31 * gundalow waves, just in another meeting at the moment, should be done in a few minutes 15:06:51 #chair jtanner gundalow 15:06:51 Current chairs: gundalow jtanner sivel thaumos 15:06:57 .hello2 15:06:58 maxamillion: maxamillion 'Adam Miller' 15:07:00 sorry I'm late 15:07:03 o/ 15:07:16 #chair maxamillion mkrizek 15:07:16 Current chairs: gundalow jtanner maxamillion mkrizek sivel thaumos 15:07:35 Olá 15:07:43 #chair abadger1999 15:07:43 Current chairs: abadger1999 gundalow jtanner maxamillion mkrizek sivel thaumos 15:07:50 ok, let's get started. 15:08:19 @abadger1999 do we still need to cover the argspec key=true topic or we cool there? 15:08:30 That was covered as handled already in last meeting 15:08:32 We are cool there. It's been reverted. 15:08:41 I thought so, I just wanted to verify. 15:08:43 thought we already voted on that 15:08:46 I found something new in argspec if we have time in open floor. 15:08:47 overwhemlingly -1 15:08:50 ok 15:08:51 moving on 15:09:03 #topic unexpected behaviour in when conditions 15:09:09 #link https://github.com/ansible/ansible/issues/33306 15:09:13 It's me 15:09:19 yesh 15:09:31 Gist: a user can explicitly type `when: []` in a playbook, and it passes as true 15:09:34 ^ 'fix' is easy , just 'if self.when' added to conditional evaluation 15:09:42 this is because the default value for `when` is a empty list 15:09:46 question really is 'do we want to allow this'? 15:09:49 there is no real use to doing what the user did 15:09:58 the user found it by just playing around 15:10:07 Principle of least surprise, it should be False. 15:10:11 Do we care to change that behavior? 15:10:15 mostly that happens when debugging whne: [1,2,] ... start removing items and end up with when: [] 15:10:20 so if the fix is easy I'd make hte fix. 15:10:23 +1 to making it false 15:10:32 i have pr 15:10:37 I personally don't care that much, but bcoca has the code ready 15:10:44 just need to add tests to verify that behavior 15:10:45 Cool. +1 15:10:51 +1 15:10:54 I am +0 15:10:56 +1 15:11:00 which is why I brought it here 15:11:11 I'm with abadger1999 about "principle of least surprise" 15:11:26 Cool, bcoca proceed with your PR, and please add tests to validate 15:11:49 #action bcoca to do a PR to make false. 15:12:11 #topic review/merge of keycloak_clienttemplate module 15:12:19 #link https://github.com/ansible/ansible/pull/33419 15:12:19 heya :) 15:13:19 sivel: our tets already assume this 'when = when or [] 15:13:52 who'd like to take the action to review eikef's module? 15:13:58 bcoca: yeah, I was just saying, right now all of our tests pass, make a test that fails due to it being true, apply the change, validate the test no longer fails 15:14:30 thaumos: I'll read through and provide some comments 15:14:36 thx sivel 15:14:39 Thank you. 15:14:45 #action sivel to start review of the pr 15:15:02 It should be fairly similar to the last one, and a bit shorter. 15:15:13 #topic proposal to not warn on not matching 'all' 15:15:20 #link https://github.com/ansible/ansible/pull/32806 15:16:10 * thaumos is reading the issue 15:16:25 I want to test something before I comment 15:17:23 I personally am for over-warning users. 15:17:32 i don't see the point of taking it away 15:17:39 i feel warning is redundant, since it can only occur when localhost is 'only available host' 15:17:49 I personally do not like the `all`, specifically when I have a playbook that specifically targets `hosts: localhost` 15:18:00 that warning is meaningless if I don't care about `all` 15:18:01 lots of noise, it basically always happens in a group of 4 warnings, at that point user tunes out 15:18:14 that is fair ^ 15:18:19 sivel: +1 15:18:22 yeah, the warnings drive me crazy with implicit localhost 15:18:33 but I might be in the minority with using implicit localhost so much 15:18:41 but if we make an assumption, a lot of people use all as a catch all 15:18:44 as that is the foundation fo 90%+ of my testing 15:19:02 cloud/networking use it a lot also 15:19:04 I think the warning might be too early 15:19:17 -1 15:19:23 if it was in context of needing to use `all` it might be better 15:19:24 But I do think we should change the message 15:19:31 issue is that no matter what 'play says' we ALWAYS do an 'all' search 15:19:50 bcoca: I haven't looked through the code, but what is the purpose of that? 15:19:58 I don't have familiarty with that 15:20:24 sivel: we traverse all hosts in inventory to ensure they are in 'all', 'ungrouped' and meet other inventory requirements 15:20:27 at least 1 time 15:20:32 I use implicit localhost a lot but don't mind the warning, but do agree they could be better and more explicit 15:21:03 bcoca: if there are no hosts to begin with, is that really a pertinent warning? 15:21:23 wouldn't it be covered by another warning? 15:21:31 I'm guessing you have the same questions 15:21:40 the warning is generic for 'empty hostpattern' 15:21:48 it happens to hit 'all' when 0 inventory 15:22:08 ^ my patch only avoids the 'all' case 15:22:57 I think this warning is probably the most informative of the group of three. 15:23:03 So we definitely want to keep it. 15:23:52 No hosts matched seems redundant. 15:24:03 I get hit with 4 warnings on nearly every playbook run. I'm just a +1 to reduce that 15:24:09 [WARNING]: Unable to parse /etc/ansible/hosts as an inventory source 15:24:11 [WARNING]: No inventory was parsed, only implicit localhost is available 15:24:13 Although probably that gets triggered when it's not part of this set of warnings? 15:24:13 [WARNING]: Could not match supplied host pattern, ignoring: all 15:24:15 [WARNING]: provided hosts list is empty, only localhost is available 15:24:27 So we'd need to keep it there. 15:24:28 So I get 2 warnings about implicit localhost 15:24:43 abadger1999: only time that woudl be triggered w/o the other ones .. would not be with 'all' 15:24:57 and that is the only exception im making, 'all' 15:25:03 The implicit localhost warning I could see getting rid of but it has a good chance of being the reason that all did not match anything so... 15:25:28 abadger1999: only reason 'all' does not match any hosts is that 'only implicit is available' 15:25:52 sivel: Hmm... you have two implicait localhost warnings. That's definitely something to get rid of. 15:26:02 * abadger1999 sees sivel already said the same thing 15:26:06 I would actually love if implict localhost worked in `hosts: all` as well, but maybe another topic 15:26:23 but again, minority here 15:26:30 probably not useful for most users 15:26:33 sivel: that breaks many plays 15:26:39 bcoca: right. Which means. We need to say that 'all' does not match otherwise the user has no idea what's wrong with their playbook. 15:26:42 im open to a toggle, but off by default 15:26:55 abadger1999: the 'all' is not from the play, its internal 15:27:16 I am +0 on removing the warning, but +1 on making less warnings in general at that point 15:27:17 we CAN agument 'implicit localhost' msg to indicate 'btw, it is not included in 'all' 15:27:22 bcoca: sorta untrue. 15:27:30 bcoca: I tested your patch with hosts: all 15:27:39 and your removes the warning there as well. 15:27:56 at least, IIRC... that was a month ago that I tested. 15:28:01 abadger1999: only if no hosts in play 15:28:23 'all' is only a warning when impllicit is only host available 15:28:37 we always use 'all' even if play does not 15:28:57 i did not say that hosts: all would not be affected, the problem is that hosts: anything is 15:29:01 even hosts: localhost 15:29:08 k 15:29:10 cause we use 'all' internally 15:29:37 so lets sayd this, remove the 'all' as pr does, but add ', this host will not match the 'all' group for selection in play' to 'implicit warning' 15:29:44 So if you fix the internal warning without changing the warning with explicit use of all then I think I'd be fine with it. 15:29:53 jinkx? 15:29:57 But removing it when the user has specified all in the playbook is wrong. 15:30:09 15:30:16 That would be fine, I think. 15:30:18 we dont have a way to distinguish implicit vs explicit 15:30:28 Hmm... 15:30:34 would have to add new param 15:30:38 +1 15:30:47 or remove 'all' as default 15:31:00 errr, sorry, I was behind in reading ... +1 to the thing y'all jinx'd on :) 15:31:09 abadger1999: you woudl still get a 'no hosts matched' from play 15:31:10 Heh. I've always wanted localhost to be the default instead of all ;-) 15:31:16 ha 15:31:27 (Knows that probably won't fly, though) 15:31:49 hosts: has no default, 'all' is default for inventory queries 15:31:54 +1 to removing but adding note about all to the implicit localhost warning. 15:31:56 really only used when called internally 15:32:08 ok, i'll ammend PR to add that info to implicit warning 15:33:22 +1 15:33:58 Ok, are we good for open floor? 15:34:16 #action bcoca to ammend the pr to add info about implicit localhost warning 15:34:21 what sivel said ^^ 15:34:28 #topic Open Floor 15:34:48 Is there a meeting next thursday? 15:35:24 is that a holiday? 15:35:36 * thaumos is unsure about shutdown days 15:35:37 I don't see why not, at least US holiday starts Friday (22nd) 15:35:39 oh, no it's friday 15:35:42 nm 15:35:45 k 15:35:48 barely made it :) 15:35:51 heh 15:37:53 #info There will be a meeting next Thursday per normal. 15:37:54 any other topics? 15:37:57 So I was looking at AnsibleModule's arg_spec and found it has a check_invalid_arguments parameter which does this: https://github.com/ansible/ansible/blob/devel/lib/ansible/module_utils/basic.py#L1616 15:38:16 Basically, it allows a module to turn on or turn off checking for extra parameters. 15:38:45 -1 ... how did that make it in? 15:38:48 I'd like to deprecate that and fix the three modules that use it to either deprecate the usage or remove it if it's in error. 15:39:18 uri, zfs, and bigpanda (probably using it accidentally) are the three modules 15:39:18 https://github.com/ansible/ansible/pull/27119 15:39:22 networking folks ;) 15:39:26 uri uses it for headers. 15:39:32 sivel: it's older than that. 15:39:42 doesnt uri have a 'headers' arg? 15:39:44 networking folks just propogated it. 15:39:52 ah, yes I see 15:40:02 but yes, I don't like that -1 15:40:02 bcoca: it does now... there's a note in the code that the old way is deprecated. 15:40:32 +1 to deprecate and fix modules to not use 15:40:47 zfs uses it essentially for "extra args to use with zfs"... I suppose for backwards compat we'd add a zfs_extra_args for that. 15:40:50 Cool. 15:40:54 I'll make a PR for it. 15:41:23 iirc zfs maintainer gave up on keeping up with diff options, thought he had done extra_args already 15:41:38 zfs keeps getting new options and they are diff across OSs 15:42:00 and zfs implementations (though i think finally there is clear winner on linux side) 15:42:43 (there is?) 15:43:07 i might be wrong 15:43:50 i think someone in irc mentinoed that there is just 'one option' now .. but dont believe everything you read on the interwebs 15:44:44 https://github.com/ansible/ansible/pull/33466 <= bikeshed on 'lookup short name' 15:45:03 there very well might be and I missed it, I don't follow ZFS very closely but it would be pretty cool if that was a "solved problem" 15:46:19 I commented in github, but I'll re-iterate here, I like the llookup idea since it's a little more explicity and might at least hint at what's going on ... but on the fliip side, it could either be a typo or considered a typo so I dunno 15:46:41 #topic alias for lookup to make it easier to use in loops https://github.com/ansible/ansible/pull/33466 15:46:47 can we use ⚲ 15:46:59 no 15:47:02 lol 15:47:16 * thaumos was joking 15:47:21 thaumos: I can see the flamewar now 15:47:22 i had to look that up 15:47:22 nn^nn 15:47:59 🐄 15:48:22 GTFO 15:48:26 implementation aside, as I still believe we should just make lookup default to returning lists, I'm really not a fan of either L or llookup 15:48:34 llookup is going to always look like a typo 15:48:48 abadger1999: YEEEEEESSSSSSSSSS 15:48:50 sivel: the new method defaults to wantlist=true 15:49:04 Are we okay to break backwards compatibility like that? 15:49:06 bcoca: yes, I am saying I want to original want to use wantlist=true by default 15:49:13 it does not break backwards compat, its new 15:49:21 (I mean, sivel's idea) 15:49:30 sivel: that breaks many things, i attempted that before i added wantlist 15:49:42 i added wantlist because i could not change the default 15:50:03 L is not veryf self explanatory 15:50:20 ^ as i introduced this topic, please bikeshed name 15:50:36 I'm thinking, I just got some weird phone call that distracted me 15:50:40 but give USABLE suggestions, turd emoji is NOT usable 15:51:34 I tend to not give turd emoji suggestions 15:52:12 just thinking "out loud" here, and there was the comment yesterday that most lookups could be filters 15:52:24 since they are not really looking anything up 15:52:32 just manipulating data 15:52:57 like with_dict is basically |dictsort 15:53:00 sivel: was not pointing at you with :turd: , just trying to stop every unicode char from being used like above 15:53:19 oh, I didn't see the cow, I do now 15:53:21 sivel: i am creating filters for 'transformation' lookups 15:53:26 https://github.com/ansible/ansible/pull/33102 15:53:43 sweet 15:53:49 but other lookups, i.e password/redis/sequence/pipe/etc do work AS lookups, but it would be nice to give a shorthand 15:53:59 maybe we could call it "query" ;) instead of lookup 15:53:59 lookup('name', ...) is very cumbersome for most 15:54:05 q() 15:54:21 q('redis', ...) 15:54:28 I'm jst trying to think of a different term 15:54:48 honestly I'd be ok with `q` I think, but also have a `query` form too 15:54:58 i kinda like that too 15:55:37 abadger1999: ? 15:55:39 maxamillion: ? 15:55:40 wfm 15:55:50 q|query ? 15:55:56 bcoca: yes 15:55:57 yeah 15:56:01 +10 15:56:19 ^ we should hire that guy 15:56:21 yeah, I'm in 15:56:24 yes, but just to confirm for those not following we will be keeping lookup as well for backwards compat 15:56:42 yeah, never said i would remove lookup, though i expect people to use q() 15:56:46 right i know 15:56:59 but others that look at this chat and scroll through now see my statement 15:57:36 just to make sure I understand correct, q/query is the "new lookup" for things that aren't actually lookups ... yes? 15:57:41 correctly* 15:58:12 no 15:58:24 q/query are an alias to lookup that defaults to wantlist=true 15:58:39 aside from that, i'll be adding 'filters' for 'non lookup lookups' 15:58:52 ah ok 15:58:54 then yes, +1 15:58:55 like flatten/toghether/nested/items 15:59:50 and like I said dict can be achieved with dictsort 15:59:53 or even .items() 16:00:22 i have to go over each one, create filter examples, then deprecate with example 16:00:38 with_items == |flatten(levels=1) 16:00:44 with_flatten == |flatten 16:00:51 with_list == 16:01:18 bcoca: I had an example for deprecating filters, using a closure if you are interested 16:01:30 sivel: with_dict creates item.key/value, not sur ewe can do with items() but filter should be easy 16:01:48 sivel: ??? 16:01:55 true, but I question the real need, since item.key == item.0 and item.value == item.1 16:02:14 that is indexed_items lookup, not dict lookup 16:02:16 bcoca: a closure you can wrap the actual lookup with, to emit the warning on use 16:02:42 sivel: we already have deprecation facility, not sure why we need the closure? 16:03:04 bcoca: you are missing what I was saying, dict creates item.key/item.value whereas with dictsort it would be item.0/item.1 16:03:21 bcoca: we can chat later, it may not be useful for your need, but removed a lot of duplicate code when I was doing it 16:03:28 k 16:04:17 I do love removing code :) 16:06:50 Ok, sounds like we are good here then? 16:07:29 #action bcoca to create a q|query alias for lookup that defaults to wantlist=true 16:07:43 kk 16:07:50 thanks everyone for today's meeting! 16:07:56 #endmeeting