19:05:12 #startmeeting ansible public core meeting 19:05:12 Meeting started Tue Aug 29 19:05:12 2017 UTC. The chair is bcoca. Information about MeetBot at http://wiki.debian.org/MeetBot. 19:05:12 Useful Commands: #action #agreed #halp #info #idea #link #topic. 19:05:12 The meeting name has been set to 'ansible_public_core_meeting' 19:06:23 o/ 19:06:36 #chair rohitkum jtanner bcoca abadger1999 19:06:55 Hello everyone 19:06:56 #seat abadger1999 actually 19:07:32 bcoca: If you chair some other people, they can help with administrivia (chairing others, #info, #action, etc) 19:08:30 abadger1999: want to run with it .. helping someone right now 19:09:23 #chair 19:09:44 bcoca: chair me and i'll chair some other people who can run it. 19:10:23 #chair rohitkum jtanner bcoca abadger1999 19:10:23 Current chairs: abadger1999 bcoca jtanner rohitkum 19:10:33 #chair dag 19:10:33 Current chairs: abadger1999 bcoca dag jtanner rohitkum 19:10:35 #chair dag1 19:10:35 Current chairs: abadger1999 bcoca dag dag1 jtanner rohitkum 19:10:39 i thought that was automatic .. then i realize dag did it 19:10:56 #chair rohitkum 19:10:56 Current chairs: abadger1999 bcoca dag dag1 jtanner rohitkum 19:10:58 * dag1 learned something new 19:11:47 Agenda is here: https://github.com/ansible/community/issues/220 19:12:19 jtanner: Are you able to run the meeting? my group will be up for boarding in ~ 15 minutes 19:13:47 checking 19:13:56 ok .. seems like we are going to lack quorum , anyone have anything 'urgent' to discuss? 19:13:59 i have hard stop at 4 19:14:23 #topic A common practice I have seen in modules is that the input parameters are put in the result output dictionary 19:14:34 dag, most issues still left are yours, fine with waiting till thursday? today seems to be bad day 19:14:40 bcoca and I agree that this is wrong. 19:14:42 Yeah, this is about introducing a new module for placement groups in AWS 19:15:07 abadger1999: that is 'invocation' , which was 'feature' we added in 2.2? 19:15:13 dag1: would you be willing to write it up? 19:15:27 abadger1999: its only there on -vvv 19:15:31 for debugging purposes 19:15:51 bcoca: I think dag is talking about modules which explicitly place the params into the json return value. 19:16:04 ok 19:16:08 (something that sdoran and I saw in an older module yesterday) 19:16:23 Cool 19:16:25 ah, then i agree, but that is a bug specific to those modules 19:16:45 yes, it seems to be very prevalent in the Windows space 19:16:46 Yep 19:16:52 and stupid since it is redundant to 'invocation' feature 19:17:02 dag1: that explains why i have not seen it 19:17:14 #action dag to PR a guideline to say "do not place params into the module's return value" 19:17:17 indeed, one argument in favor was that if you template values, the templated value could easily be reused 19:17:19 #topic From time to time new parameters are proposed with the unit as part of the parameter name, 19:17:25 it seems dumb to have to do this, but yes, lets add 'developer guildeline' 19:17:26 abadger1999: Perfect 19:17:46 dag1: what's desired here? standardize on secs vs seconds? 19:18:03 ^ i would argue to not make unit part of optoin name 19:18:10 time: not time_secs or time_seconds 19:18:18 have description clearly state unit 19:18:25 abadger1999: Python modules do not do this (or haven't seen it really) 19:18:32 abadger1999: in the Windows world this seems to be preferred 19:18:42 nitzmahone ^ 19:19:17 so during review I always remark this, but it would be nice if this was also a guideline 19:19:43 https://github.com/ansible/ansible/issues/20160#issuecomment-272053518 19:19:49 sorry, why don't we want inputs in the return json? 19:19:59 So it looks like nitzmahone and bcoca are on opposite sides of this. 19:20:36 if I follow the same reasoning, it could be useful to know if a parameter is a string or a list 19:20:55 (or always support both :D ) 19:21:02 nitzmahone: :-) 19:21:17 but here the discussion is largely what the default name would be 19:21:23 because we can indeed create aliases 19:21:28 jtanner: the inputs are already handled via a different facility. 19:21:31 (invocation) 19:21:35 k 19:21:47 i guess we're talking about having a duplication in the return json? 19:22:02 jtanner: yep (that was the previous topic) 19:22:05 k 19:22:08 ignore me then 19:22:22 I just got here too 19:22:24 i just prefer time: vs time_secs + time_mins 19:22:27 #chair sivel 19:22:27 Current chairs: abadger1999 bcoca dag dag1 jtanner rohitkum sivel 19:22:45 I'm mildly with bcoca but I'm okay either way. 19:22:50 Is there additional background on this topic? 19:22:55 I bring it up here, because today a Windows module that is using _seconds is being proposed 19:22:56 other than what the topic states? 19:22:56 unit-free things like that don't make the playbook as readable IMO 19:22:57 (ie: standardize on one) 19:23:20 On things like PS it doesn't matter because we have a `TimeSpan` type that can be anything you want. 19:23:36 I mean, things like Golang have a standard here, where they do like 3h15m which is parsable. python itself generally asks for either straight up seconds, or has kwargs for each unit 19:23:36 But here it's just an arbitrary number. 19:24:13 but generally I'd like to see just `seconds` 19:24:14 Unless we want to define a 'timespan' module_args type like what Sivel's saying 19:24:16 I'd be all for that 19:24:17 `time` is misleading 19:24:22 so the reboot and win_reboot, while having the same options, Windows adds _secs 19:24:42 descriptions normally have the 'unit' 19:25:12 I've personally been nailed by that one though- where I wrote a playbook and it took minutes instead of seconds, etc. 19:25:18 on the python side most modules with 'unit based options' dont have it in name .. I dont think this should be a windows only standard 19:25:21 "why isn't this timing out?!" 19:26:07 my opinion, is that if we are expressing an amount of time, it should be seconds, unless otherwise noted, but I don't think we should add a _secs postfix 19:26:12 I'd be happy to put that on my 2.5 list (parseable generic timespan type) if people like that idea. 19:26:32 yeah, or we do like a golang like time spec 19:26:36 time duration* 19:26:39 im fine with having type=time 19:26:49 but we probaly will end up with type=datetime 19:26:59 I like where this is going 19:27:05 A datetime != timespan though 19:27:08 https://golang.org/pkg/time/#ParseDuration 19:27:18 datetime vs duration 19:27:18 Yeah- I'd be all for that 19:27:31 26 minutes into the meeting, can we decide ? 19:27:35 type=duration and type=datetime 19:27:39 +1 19:27:47 and dag will write it 19:27:50 I say for now, it should just be generic, and accept seconds, and not have a postfix 19:27:50 +1 19:27:51 haha 19:27:53 +1 for a standard. Don't care which standard we adopt. I'm boarding now. 19:28:07 +1 to no postfix 19:28:09 If duration is the direction we're moving in, I'd agree with sivel on that 19:28:11 bye abadger1999 19:28:11 #chair nitzmahone 19:28:11 Current chairs: abadger1999 bcoca dag dag1 jtanner nitzmahone rohitkum sivel 19:28:17 +1 to no postfix (keep aliases around) 19:28:29 +1 to implement duration/datetime 19:28:30 (and unitsless durations == seconds) 19:28:45 for future backcompat 19:28:46 sounds like an agreement 19:28:50 yup 19:29:15 #agreed no 'unit' postfix on options 19:29:22 OK, so we'll keep the ones that have it now as aliases, but docs will standardize on unitsless and we'll be set up for duration in the future. 19:29:31 #action implement duration and datetime types for argspec 19:30:00 #action add duration/datetime argtypes to 2.5 roadmap 19:30:03 #action migrate existing 'unit suffixed' options to aliases and make 'unitless' the main focus 19:30:40 I had another new topic: required_by functionality 19:30:57 is that similar to required_with/required_if? 19:31:29 #topic required_by 19:31:37 https://github.com/ansible/ansible/pull/28662 19:31:54 so required_if allows you to add dependencies if a parameter has a specific value 19:32:11 but what we need is: 'if parameter X is defined, then we need parameter Y too' 19:32:37 hrm, I don't like adding more of these, that are so...inflexible. It would be nice if we had a more generic way to express this 19:32:50 required_together has a commutative property, so if one is defined, the other is required too 19:33:21 sivel: agreed 19:33:39 i have no idea what a more "generic" thing would look like 19:34:12 I feel like required_if is potentially the solution, but it needs to be more flexible 19:34:24 instead of just evaluating a value, maybe accepting a callable 19:34:40 not sure, I just don't kike the idea off all these roughly similar required_ args 19:34:46 s/kike/like/ 19:34:57 damn, so many typos in that last... 19:35:00 now, as a side-note, this functionality is completely missing from the documentation 19:35:39 it's true that they all appear similar, and they all accept a different datastructure 19:35:51 I always have to look up how it worked on someone's blog :) 19:35:55 It just feels like required_if could maybe be more generic, and having some predefined evaluations and accepting callables could be useful 19:36:34 not sure if callables will make it easier, we would still have a shared set of callables 19:37:21 I guess where I was getting at is it could be like, paramB is required when paramA is between 1 and 5 19:37:30 no way to express that in the arg spec currently 19:37:36 we already have callable at type level .. not pretty 19:37:48 maybe we are asking too much of argspec? 19:38:02 some conditions are just easier to have each module write the actual python 19:38:02 I see the need, although I don't like it 19:38:23 Good escape hatch for custom stuff, but yeah, at some point I'm not sure if passing callables for oneoffs is easier than just writing imperative validation after the declarative has dnoe all it can 19:38:25 the need is to have standard errors for argument constraints 19:38:51 but bcoca raises a good point, at some point I think we are asking too much from the argspec, and this almost feels like we've hit that 19:38:53 But if you're doing imperative checks there, how will you standardize it anyway? 19:39:13 you standard becomes a programing langauge 19:39:19 " I think we can get away with: [ "parameter", "condition", ("set", "of", "parameters") ], where the condition is n evaluation 19:39:52 I'm not sure we have an answer, but I don't think I like the current implementation 19:40:09 At some point there we're just reimplementing jinja 19:40:11 but it will make mutual_exclusive and required_one_of very hard 19:40:20 but I'm now leaning towards, I think it;s best to not add, and just handle it in the specific module outside of argument spec 19:40:26 +1 19:40:29 +1 19:40:45 sivel: I disagree, the python code would be a lot harder than the statements we now have 19:41:17 sounds like we are +1 for adding, and -3 for not adding 19:41:18 dag1: unlike using modules in a play .. the guy using these functions is already programming in python 19:42:11 bcoca: true, but if everyone has to implement mutually_exclusive, it's not going to be easier to maintain (or understand) how parameters work together 19:42:39 we introduced this for a purpose 19:42:39 How many modules need a required_by right now? 19:42:46 and required_by has the same purpose 19:43:01 sivel: it didn't exist, so I don't know 19:43:05 I tend to look at things from an 80/20 rule. Do the 80% need this, or do some amount of the rest? 19:43:12 I think this is a less than 20% need 19:43:23 well, that's true for all of the options 19:43:33 most modules don't have parameter dependencies 19:43:37 sivel: i know of a copule that just implemented same rule in cod 'if state == present: ... if xyz is none: fail_json 19:43:43 sivel; it's quite a common thing in the AWS modules; e.g. rds_instance has a very different set of parameters for aurora vs other databases. 19:43:59 bcoca: yeah, I have done that exact thing 19:44:09 we end up writing our own parameter validation functions. 19:44:17 which is fine 19:44:48 * dag1 still thinks this is a lot easier and more consistent, than asking people to write it themselves (with custom error messages) 19:45:03 dag1: i would say that of whoel modules 19:45:14 fact is that none of this is documented, so most module developers don't know it exists 19:45:25 which, to be honest, seems to me to be the right thing. I'd do it as a functional thing - pass a validator to the module - but we can do it pythonic by having a function we call. 19:45:27 that is bigger issue imo 19:45:56 #chair mikedlr 19:45:56 Current chairs: abadger1999 bcoca dag dag1 jtanner mikedlr nitzmahone rohitkum sivel 19:46:25 so everyone who is in favor of not adding required_by, are they also in favor of getting rid of required_if, required_together, mutually_exclusive and required_one_of ? 19:46:30 at present the problem is that when you do your own parameter validation you don't end up with the standard error messages in the standard way like when ansible module does the validation 19:46:54 dag1: i'm +1 until we have "generic" 19:48:00 translate the example in https://github.com/ansible/ansible/pull/28662 into python 19:48:20 that's just silly in my opinion 19:48:45 but right now only 1 module is asking for it 19:48:47 ^ read above, i just did 19:48:50 it's time better spend on other stuff, and it's error-prone if these would be if-then-else cases 19:48:58 bcoca: not for the xml module you didn't 19:49:07 no, for 'every' module 19:49:29 bcoca: this functionality is useful not if you have a single dependency, but if you have complex dependencies 19:49:44 We have a rule at work, repeat yourself 3 times, if you need to repeat yourself a 4th time, then it's time to abstract the code 19:50:26 Would agree that it feels like premature generalization 19:50:27 sivel: so I find 3 modules that need it, and I'll come back 19:50:34 fine by me 19:50:40 now I know you are just trying to subvert the rule 19:50:53 that is why rules are made 19:50:59 do I need to find 20% ? :-) 19:51:08 in any case, I am still -1 19:51:16 because none of the other functionality ever had 20% of modules using it 19:51:51 even at max count, I see maybe +3 and confirmed -3, which still isn't grounds for approval 19:52:06 sivel: my count is 3 against, 1 in favor 19:52:23 jtanner: said he was +1, and mikedlr seemed to indicate a +1 kinda 19:52:25 jtanner: not sure which direction your vote was in 19:52:40 * dag1 thinks this is silly, it's 7 lines of code, that saves me maybe 50 lines of code 19:52:41 i think i'm +1 for 2.4, but prob -1 for 2.4 19:52:48 err, +1 for 2.5 19:52:54 and could be reused by plenty of others 19:53:03 50 lines of code? You couldn't add the same 7 to your module? 19:53:07 jtanner: what for 2.5 the generic method or dag's required_by 19:53:26 sivel: sure I could add it to my module, but it wouldn't be integrated in the argument_spec 19:53:34 if generic is happening in 2.5, then generic. If not, required_by in 2.5 19:53:45 * mikedlr secretly feeds dag1 an example.. 19:54:02 i presume dag is asking to get it into 2.4 though 19:54:19 ok, so it seems there i not enough support to add now, going to table this and revisit in future (probably by 2.5) 19:54:27 #action tabled till 2.5 19:54:28 jtanner: I need it for the xml module, which is new in v2.4, but it's been merged without it 19:54:46 #topic open floor 19:54:56 well, we still have the undecided sleep module 19:54:57 closing in 5 19:55:01 haha :) 19:55:06 thought we did sleep last time 19:55:19 inconclusive by lack of votes 19:55:22 still -1 on my side 19:55:24 lambda_policy went in with some bunch of other lambda related changes. 19:55:41 everybody with AWS accounts start creating serverless systems fast please. 19:56:04 * bcoca still does not understand 'serverless servers' 19:56:30 cloud means "you agree we can lie to you about where the servers are" 19:56:33 translation: the credit bill goes to someone else 19:56:40 so they work like imaginary numbers 19:56:48 serverless means "you agree we can lie to you about how many and how they work" 19:57:17 mikedlr: sooo ... 'cloud' 19:57:28 in real life it may reduce your AWS bill by 90% or so for a low usage system 19:57:30 or more 19:57:30 cloud == "other people's computers" 19:57:57 nitzmahone: not even that is guaranteed. If we could run it on your computer without telling you we would be even happier 19:57:57 serverless needs an analogue 19:58:18 mikedlr: so ... 'cloud' 19:58:25 serverless == 'botnet' 19:58:42 yes. "other people;s botnets" 19:58:44 'your' computer is normally somebody else's" 19:58:49 pwned 19:59:11 s/botnet/miner 19:59:34 once you accept that all home computers are likely owned, if by nobody else, by intel/NSA/ etc then you see that "other people's botnets" have no real security differences. 19:59:44 serverless == soviet cloud ... the server uses you! 20:00:18 * jtanner goes to next meeting 20:00:25 #endmeeting