16:00:14 <Qalthos> #startmeeting Ansible Network Working Group
16:00:14 <zodbot> Meeting started Wed Mar 16 16:00:14 2022 UTC.
16:00:14 <zodbot> This meeting is logged and archived in a public location.
16:00:14 <zodbot> The chair is Qalthos. Information about MeetBot at https://fedoraproject.org/wiki/Zodbot#Meeting_Functions.
16:00:14 <zodbot> Useful Commands: #action #agreed #halp #info #idea #link #topic.
16:00:14 <zodbot> The meeting name has been set to 'ansible_network_working_group'
16:00:42 <Qalthos> #topic Agenda https://github.com/ansible/community/issues/542
16:00:46 <Qalthos> #link https://github.com/ansible/community/labels/network is where you can always find the latest agenda
16:00:51 <Qalthos> #topic Core Updates
16:04:02 <Qalthos> #info ansible.utils 2.5.2 was released last week, bringing some bugfixes to various ipaddr filters
16:05:15 <Qalthos> #info We are still approaching a major release for all supported network collections, which is currently targeted for the end of April
16:05:56 <Qalthos> It's been brewing for a while now, but I'm really excited for it to finally be released
16:07:21 <Qalthos> That's all I have this week, let me know if there is something you have to say
16:07:25 <Qalthos> #topic Open Floor
16:08:05 <wayt> I'm looking for feedback on the PR I submitted here https://github.com/ansible-collections/ansible.utils/pull/146 to resolve the performance issue when interacting with large subnets.
16:09:09 <Qalthos> #topic ipsubnet filter performance improvements (https://github.com/ansible-collections/ansible.utils/pull/146)
16:10:41 <Qalthos> I've now looked at it, I don't have any specific feedback right now, but I don't see anything out of place
16:10:43 <wayt> other than it "works" is it implemented in a way we'd like to see it done? should this be done in netaddr upstream and provide a new function for us to leverage in the plugin. should this be in a plugin_utils implementation for use in other plugins? should it get merged? that kind of stuff
16:11:26 <wayt> Thx qalthos
16:12:51 <Qalthos> Can you get into a bit more detail on what you've done here? I recall the problem but I've only just seen the PR this morning
16:14:21 <wayt> Yup no worries - so in v4 or v6 if you ask the ipsubnet filter to give you a specific subnet from a large subnet like the fourth /31 from a /8 it calls a generator from netaddr, creates a list and then accesses the fourth element in the list and returns it as a string.
16:14:55 <wayt> My implementation uses math directly to calculate the fourth network of the requested size, constructs it as an IPNetwork object and returns the string
16:16:49 <wayt> The generator works fine although inefficient even for small / simple requests but especially in v6 we're going to hear a lot more about networks like /64 (of /128) being carved up into small chunks like the reporting issue at /120. that leaves 2 ** (120 - (128 - 64)) networks in that generator and subsequent list
16:18:37 <wayt> Since subnetting is just about splitting a 32 (v4) or 128 (v6) bit number into two pieces we can just math to solve the required puzzle in the filter
16:19:46 <Qalthos> In an ideal world, I'd want that fixed in netaddr upstream, as it looks like the PR now just ignores the (otherwise very handy) subnet call available. But if we can work around it here we can at least fix the problem without waiting on another project.
16:22:39 <Qalthos> In terms of organization, I don't think we need to break anything out into plugin_utils yet, but if you can make a reusable function to contain the subnet math and return an IPAddress (which I am assuming is what it would do?) that would make it easier if we did ever want to reuse it somewhere else
16:23:36 <wayt> Ya even upstream I think we'd get or want a different function in that api as "subnet" very clearly is meant to be a list of the subnets. something like 'subnet_at(<size>, <position>)' could be added there and consumed by ansible.utils
16:23:54 <Qalthos> Beyond that I'm seeing a lot of str() calls most of which should probably be to_text() if they're being returned
16:24:11 <wayt> Ah good point - i'll check the str's
16:26:13 <Qalthos> #action Qalthos put together a review of the things discussed here
16:26:34 <wayt> thx
16:27:00 <Qalthos> wayt: anything else you want from me for this PR?
16:27:10 <wayt> nope just looking to get it off my brain plate :)
16:29:12 <Qalthos> Alright. As a reminder, you can add things to the agenda issue (https://github.com/ansible/community/issues/542 which is also findable from the second link in the channel topic when a meeting isn't running) if there's anything you want to make sure we talk about in the next meeting
16:29:16 <Qalthos> #topic Open Floor
16:29:53 <Qalthos> Anyone else have anything they want to go over today?
16:39:25 <Qalthos> Thanks for coming by!
16:39:28 <Qalthos> #endmeeting