19:09:02 #startmeetingĀ ansible core community meeting 19:09:02 Meeting started Tue Jun 19 19:09:02 2018 UTC. 19:09:02 This meeting is logged and archived in a public location. 19:09:02 The chair is shertel. Information about MeetBot at http://wiki.debian.org/MeetBot. 19:09:02 Useful Commands: #action #agreed #halp #info #idea #link #topic. 19:09:02 The meeting name has been set to 'ansible_core_community_meeting' 19:09:28 o/ 19:09:35 #chair sdoran 19:09:35 Current chairs: sdoran shertel 19:09:51 Hello 19:09:53 #info Agenda https://github.com/ansible/community/issues/317 19:09:58 #chair abadger1999 19:09:58 Current chairs: abadger1999 sdoran shertel 19:10:37 #topic https://github.com/ansible/ansible/pull/41656 19:11:35 PR #41656 is a follow up from last week (PR #41297), where original module submission was broken up into 3 for better user experience. 19:12:21 This PR is for first of 3 modules. Other modules are complete but will be submitted separately. 19:12:28 Okay. Just need reviews? 19:12:43 Yes need reviews. 19:13:12 Nothing fundamental has changed from last week (which was already reviewed) but can review again 19:13:47 All recommendations from last week were addressed. 19:14:25 I'll review it. 19:14:50 thanks sdoran. Also requested that the people who initially reviewed could look it over again. 19:14:53 Thank you 19:15:09 Should category be implemented with a default (perhaps all?) and be able to take more than one value? 19:15:57 Or will do each of these facts exist on separate machines (so you'd never use all of them at once)? 19:17:30 Category does not have a default value, there is an exception handler if category is not valid. In fact, added choices[] so it's caught there. 19:17:42 I mean, *should* 19:18:03 Prefer that user provides specific category/command rather than use default values. 19:18:22 if you will gather multiple categories from the same host, it is inefficient to have separate tasks to ask for hte facts on that host. 19:18:42 Pretty much exactly the feedback I was going to give. :) 19:18:53 Allowing the user to batch them into a single task by taking multiple categories would help them out. 19:18:56 The facts module should accept a list of what categories to gather. 19:19:07 And default to the most common one. 19:19:40 That's a good point. Keeping them separate though allows playbooks to be easier to understand and write. 19:19:48 Doing more work in a single task is much more efficient. 19:20:00 jdelaros1: Why? 19:20:18 You can have both with what we're suggesting. 19:20:32 If someone wanted to have multiples tasks, they could. 19:20:54 But they could also pass a list to `categeory` to get them all at once. 19:21:11 I need to look at where these get stored to make sure they're won't be clobbering each other. 19:21:16 redfish_facts: category=["Inventory", "Accounts"] seems as understandable as two tasks. 19:21:18 Agreed, that is possible. One thing to know though, is that each time we ask for information, the Redfish URI to be built will be different, so there's no savings there 19:21:56 jdelaros1: I figured that would be the case. But it's still more efficient from an Ansible perspective. 19:22:03 jdelaros1: The savings is from transferring and ivoking the module mltiple times. 19:22:38 The Ansible module 19:22:54 Also, information returned is kept separate, asking for more than one type of info might be difficult to keep output files separate rather than just dumping everything into one file 19:23:33 But agree can send more than one command at a time. 19:23:51 As for having a default.... We've been tlaking about ways to allow the user to automatically run fact modules (making them first class citizens in facts). If there's a required parameter, this module will never be able to fit into that framework. that's why I suggest having a default. 19:24:08 Will take a look, if you don't mind adding that feedback to the PR> 19:24:15 +1 19:24:28 Will do. 19:24:36 ok for the default as well 19:26:15 thanks abadger1999 and sdoran 19:26:19 Skipping https://github.com/ansible/community/issues/317#issuecomment-398225131 until there are more than two people 19:26:23 #topicĀ Open Floor 19:26:45 What about the four PRs from jtyr? 19:27:07 it says he wants to discuss on the 21st 19:27:14 Roger 19:27:26 Q: Once updates are done, is discussion done in the PR itself of do I have to come back here for this PR 19:27:56 jdelaros1: We can continue in the PR. Only show up here or #ansible-devel if it seems to have stalled. 19:28:06 We're human and have limited attention. :) 19:29:15 Are these suggestions considered must-fix before merging? Could that be considered a future improvement? 19:29:50 I would say yes since it's a pretty big UI change. Want to get that right before it gets merged. 19:29:55 My thing about default is not a blocker... if you feel it makes little sense, I don't even require it. 19:30:11 But the request about categories should be a blocker. 19:30:39 OK I will take a look at that 19:30:39 sorry, had late lunch didnt realize the time 19:30:40 Changing parameters after the fact can cause issues for people who have already started using the module i their playbooks. 19:31:07 #chair bcoca 19:31:07 Current chairs: abadger1999 bcoca sdoran shertel 19:32:29 ok... if nothing else ending meeting in a minute 19:32:46 ping? 19:32:58 Go ahead 19:33:02 thanks 19:33:02 https://github.com/ansible/ansible/pull/41058 <-- I'd like to get another quick look and a merge, if possible 19:33:13 as anyone considered addin jsonnet support the the parser ? 19:33:23 like as alternative to json 19:33:26 agaffney: remove WIP if you expect a merge/final review 19:33:37 s/the the/to the/ 19:33:47 bcoca: done :) 19:33:51 stoned75: which parser? 19:34:01 lib/ansible/parsing/utils/yaml.py 19:34:10 nope 19:34:30 I find it handly in some cases, especially for var files 19:34:46 doesnt seem somthing we would add as a parser, more as a template action 19:34:48 I make a more or less satisfactory implementation, cf. https://github.com/stoned/ansible/commit/8469aaf6b6b6dddb41026e665ccb01fed2caafd1 19:35:01 I'm working on a |jsonnet filter 19:35:32 that can be used trivialy in template or copy with content: 19:35:50 We would accept a filter. 19:35:54 as a plugin 19:35:58 i think it makes more sense as lookup 19:36:04 We wouldn't change the playbook format at this point 19:36:09 I also did a lookup 19:36:11 as we already have template lookup and its easy to assing 19:37:13 ok. thanks for your answers 19:37:18 Except that it's not a lookup... 19:37:35 * abadger1999 needs to write the "generic jinja function" proposal 19:38:11 no the code I posted a link to is not a lookup.. I have it somewhere else :) 19:38:17 It does seem like a filter... in jsonnet; out json 19:38:28 I mean, it doesn't lookup anything. 19:38:35 a file 19:38:38 and it isn't a list => list transform 19:38:40 as template lookup does 19:38:48 So it doesn't fit eithe rdefinition of lookup that we have. 19:39:04 i agree it can fall in several parts, just thinking that as looup we can keep yet another language from inside playbooks/vars 19:39:09 we agreed that should have only been a filter before. 19:39:12 (template 19:39:17 anyhow... 19:39:26 tempalte filter makes no sense, since you are alreayd in template 19:39:58 and lookup IS a generic jinja2 funciton, those are already possible 19:41:46 jsonnet as a template filter makes it easy to integrate, that's the selling point 19:42:22 it would be 2 in th end ? to_ or from_ liek we do with json and yaml? 19:42:26 and so you can use it as copy: content="{{ document | jsonnet }}" 19:42:32 the issue for me, its not a data format, its a templating language 19:42:44 stoned75: that is a point against it 19:42:52 ok 19:44:23 another use case, a bit contrived may be, is: set_fact: foo="{{ document | json | json_query() }}" 19:44:32 s/json/jsonnet/ 19:44:54 would the jsonnet document be able to reference other hostvars? 19:45:10 stoned75: he was joking. (about the copy content comment) 19:45:17 nicolas17: yes there's a jsonnet api for that 19:45:39 is there any other filter that can access variables like that, that weren't explicitly passed as arguments? 19:46:00 that's what I'm currently debugging in the trivial jsonnet filter I wrote (uncommited) 19:46:07 nicolas17: as filter, no, lookup does get vars 19:46:54 my test use case is something like: set_fact: myvar="{{ doc | jsonnet(ext_vars=hostvars[inventory_hostname]) }}" 19:47:30 of course you could also do jsonnet(ext_vars=hostvars) 19:47:38 oh, if you pass ext_vars that's different, it does act only on its arguments then 19:47:49 dont do that, last thing you want is to force full hostvars expression 19:47:59 eh :) 19:48:13 hostvasrs is NOT a dict, just looks like one 19:48:34 its a lazy loaded object that 'acts like a dict' but we try to avoid copying teh whole thing as it tends to get huge 19:48:41 it's a set of nested lazy loaded dict-like objects 19:48:52 * bcoca was not going to mention hostvarsvars 19:48:58 ooooh yes ! thanks ! that may exactly be source of the troubles I'm having 19:49:10 also, hostvars does NOT contain all the vars availabel to the task 19:49:20 bcoca: nobody should mention that. I'm proud and ashamed of it at the same time, if only for the name 19:49:27 also why we havea a lookup('vars' ... 19:51:18 so if I understood you well: a template would be more appropriate, is that it ? 19:51:58 s/a template/template support/ 19:52:06 an action or as a lookup, both get vars 19:52:30 ok IC 19:52:31 it IS a template 19:53:02 You could do it as a module w/ action plugin if you want and that's the majority of hte use cases. 19:53:45 varname: ''{{lookup('template' ,'path'))}} is one way to do include_vars + templating language 19:53:55 s/template/jssonnet/ 19:54:49 bcoca: ok great! and anyway, that's the use case that got me started ;-) 19:55:53 you still have a problem as some vasr might reffer to jinja2 templates so you wont be able to resolve those 19:56:02 i.e var1: '{{othervar +2 19:57:27 bcoca: yes, but I think that can't be helped, and well if it is really needed one would have to to something along the line of lookup('jsonnet', 'path', ext_var={'myvar': myvar}) 19:58:06 you should not need to do that myvar will already be available 19:58:33 and you can define more vars in 'vars:' part of task 19:59:20 oh you will be in favor of injecting the current tasks' vars and hostvar, by default, to the lookup ? 19:59:51 that is ALREADY the case 19:59:56 why i told you to use lookup 19:59:58 filters dont get those 20:01:39 yes I understood, it's only that I was not inclined, at first, to pass by default the available vars to the jsonnet engine 20:02:19 I somehow understood that a jsonnet document is supposed to be self standing 20:03:23 unsure how usefule it is if user needs to know all vars consumed and pass them explicitly 20:03:32 unless you only template 1 or 2 vars ... 20:05:02 well, if nothing else, ending this in 1min 20:05:22 ok. thanks again for your ansers and inputs! 20:06:14 #endmeeting