Tuesday, 2024-04-23

KSR-DKHi jm1[m]14:06
KSR-DKjm1[m] - I'm trying to read the https://opendev.org/openstack/ansible-collections-openstack/src/branch/master/plugins/modules/identity_domain.py module.. But I'm not smart enough it seems.. Anyway, it is used by https://opendev.org/openstack/openstack-ansible-os_keystone/src/branch/stable/2023.1/tasks/keystone_federation_sp_idp_setup.yml and it seems like it's breaking my default domain. My default domain if defined with id defa14:10
KSR-DKOn top my user_variables contain federated_identities - domain: default, and whenever the task - name: Ensure domain which remote IDP users are mapped onto exists - in playbook keystone_federation_sp_idp_setup.yml - is called, it changes the name of my default domain to lower case "default"14:13
KSR-DKIs this intended ? jm1[m]14:15
gtemaksr-dk: you refer to openstack-ansible and I now think it is responsible for changing data, not the module itself. The module is ensuring resource is having attributes as passed by the caller (and here it does not have any own defaults)14:17
KSR-DKgtema - yeah I know, and you might be correct - I'm just wondering if it is intended functionality, that if the module finds a domain with the name if it, should correct the casing, or if it should just update the description and wether it's enabled like it did in the previous versions.14:21
gtemaopenstack-ansible is not what we are here responsible for - we take care of the module itself, not the playbooks that use it14:22
KSR-DKthe functionality I'm refering to is in - https://opendev.org/openstack/ansible-collections-openstack/src/branch/master/plugins/modules/identity_domain.py14:23
gtemanoonedeadpunk can help you further14:23
gtemaksr-dk: what you refer to would ensure resource has properties set as passed by the caller. And if the caller ignores case the module will apply this14:25
* noonedeadpunk looking14:25
gtemathe module is not doing any case operations (at least not on purpose)14:25
jrosser_KSR-DK: it would be helpful if you could illustrate what you think is happening by providing the ansible output with -vvv showing the name having been changed14:26
noonedeadpunkhuh, so my guess would be that module finds name by ID and then changes name to the id14:27
KSR-DKYes14:27
KSR-DKThat's my guess as well.14:28
noonedeadpunkthat's fun kinda14:28
KSR-DKNot when deploying in production ;-)14:28
KSR-DKor rather upgrading 14:28
noonedeadpunkgtema: I kind of tend to agree, that domain `name` should not be updated, as I don't see any way on how to do that intentionally14:32
noonedeadpunkor whell14:33
KSR-DKActually I think the module uses the "name" aka the Domain name input, to find the domain by id, and then corrects the name of the Domain with the same variable 14:33
noonedeadpunknow i do14:33
noonedeadpunkyeah, but then you need to provide it as ID14:33
gtemathe only current potential explanation I have is that Keystone is doing case insensitive search. In that case module may decide to update the value14:34
noonedeadpunkbut I guess module allows names to be resolved to id14:34
gtemaI do not have access currently to anywhere with admin access so can't verify assumption14:34
noonedeadpunkyeah, so I wonder if it would be reasonable to drop name from attributed if id is not provided?14:34
noonedeadpunkor like populate `non_updateable_attributes` maybe...14:35
KSR-DKthe module seems only to take "name" as input, not id14:36
noonedeadpunkit can take ID from what I see14:36
noonedeadpunkoh, wait14:36
noonedeadpunkit's return, lol14:36
noonedeadpunkok14:36
KSR-DK;-)14:36
noonedeadpunkyeah, ok, so back to my statement that I don't see how you can intentionally update domain name with the module at all14:37
gtemamaking name unchangeable by default is definitely not what you want to do14:37
noonedeadpunkbut how you can change it?14:38
gtemaand I checked at one cloud - keystone is doing case insensitive search (at least for projects)14:38
noonedeadpunklike as a user14:38
noonedeadpunkin order to change name you should be able to suppluy uuid, right?14:38
noonedeadpunkand there's no argument for that14:38
noonedeadpunkand when you provide "name" - you shouldn't attempt to change it, imo14:39
noonedeadpunklike it's the only identifier14:39
gtemaI was for a very long time stating that interface of modules evolved in the wrong direction, nobody was listening to me14:39
gtemanow we have more and more of the tricky cases, and all in the sake of "backwardscompatibility"14:40
noonedeadpunkI'm not sure if it's tricky - more consequence of refactoring I assume14:41
noonedeadpunkbut dunno14:42
noonedeadpunklooking at 1.0.0 it's also.... wierd in a different way14:42
gtemait's tricky by default - looking at all openstack apis there is an ocean of corner cases14:42
noonedeadpunkbut there we fetched list of domains and supplied uuid to the update request and name...14:43
noonedeadpunkso it should have behaved pretty much the same 14:43
noonedeadpunkyeah, I'm not arguing that14:43
noonedeadpunkhttps://opendev.org/openstack/ansible-collections-openstack/src/branch/stable/1.0.0/plugins/modules/identity_domain.py#L145-L14714:43
gtemaI fear that if you pass uuid here the domain name will become this uuid14:43
noonedeadpunkactually14:44
noonedeadpunkit would give more funny consequence I guess14:44
noonedeadpunkas if you supply uuid as name, your name will become uuid?14:44
noonedeadpunkyeah14:44
noonedeadpunkexactly14:44
noonedeadpunkbut Domain/domain will work :D14:44
noonedeadpunkcrap14:44
gtemathat all means that assumption to have interface like "name": "Name or ID of the resource" is completely wrong14:45
gtemaI mean such interface should not exist14:45
noonedeadpunkunless we say that name can not be changed through the module14:46
noonedeadpunkbut yes14:46
noonedeadpunknow it's non-functional in this way14:47
noonedeadpunkhowever, I totally get that such interface should exist14:47
gtemain this interface from the code we never know what user actually passed: name or id and whether the server side applied regex like search14:48
noonedeadpunkas you can decide what you have only during runtime, so it might vary from execution to execution14:48
noonedeadpunkSo, I assume that name should be palced as `non_updateable_attributes` atm14:49
gtemaso the best way is to get rid of all "assumptions" and make modules like the new CLI: pure api wrap. This will let consumer to be very explicit in what he does and have less of such cases14:49
noonedeadpunkand then mark as todo fixing way of updating name, as that should involve new attribute introduction14:49
gtemaif you place name into non_updatable_attributes you have absolutely no way in controlling the name14:49
gtemathis is surely not what you want14:50
noonedeadpunkso you mean even for resource creation?14:50
gtemafor creation it would, but no update would be ever possible14:50
gtemaI mean with this module14:50
noonedeadpunkas I guess otherwise we agreed that it's not possible anyway?14:50
noonedeadpunkother then Default -> default14:51
noonedeadpunklol14:51
gtemaoption 1) add everywhere explicit "id" param as readOnly. This will allow preventing name->uuid renaming and control over the name14:52
gtemaoption 2) I forgot already. option 1) is the only proper solution14:53
KSR-DKI guess It's not possible to update the uuid for a domain anyway.14:54
gtemauuid is not updatable ever14:54
KSR-DKPrecise.. Maybe I'm not getting you option 1 then.14:55
noonedeadpunkI guess my point still is that without adding another input attribute - it's no way to update name either14:55
noonedeadpunkLike current `name` is the only thing that does search basically14:55
gtemamodule input must include both "id" and "name" to give user possibility to say explictly: what I am passing is ID14:55
noonedeadpunkyes14:56
gtemain this case param name would be enforced on the found resource14:56
gtemaif name is passed - treat it as name and set it as name in the found entity14:56
noonedeadpunkwell, I personally think that one of these could be name_or_id...14:57
noonedeadpunkbut then you don't update name14:57
noonedeadpunkbut it's another wierd solution I guess...14:57
gtemathen you have id+name+name_or_id - which is again unnecessary complexity14:57
gtemaI would rather leave the _info modules to behave like name_or_id and in the regular modules have explicitly id+name14:58
noonedeadpunkwell, as I said - you don't always know what you have. And as in ansible it's impossible to "undefine" variable - it becomes even more tricky when passing arguments, as you'd need to make complex logic in role to detect if you have id or name to pass accrodingly14:58
jrosser_part of this stems from there being a bunch of missing _info modules14:59
gtemafor that you use _info to actually locate resource first14:59
jrosser_which makes it super tricky to always ensure you have the id14:59
gtemaand it's response is both name and id14:59
noonedeadpunkin perfect world... which we are not in yet15:00
KSR-DKNow that we are brainstorming.. How about adding a parameter to the module called - action: (values - create,readm update,delete) - If it's create it will only create and not change anything existing..15:00
gtemaif only I would have employer paying me for resolving this I would be glad to work from openapi side on generation of all avaiable modules15:01
KSR-DK:-)15:01
gtemaksr-dk: I am not going to explain in detail, but we abandoned such ideas in past since it makes things even more complex and unmaintainable15:01
KSR-DKOk15:02
noonedeadpunkyeah..........15:02
jrosser_that is also not really matching the pattern in core ansible modules for idempotency15:02
KSR-DKI'm a newcommer with no history15:02
KSR-DKOk, well I can the add to the when clause of os_keystone/src/branch/stable/2023.1/tasks/keystone_federation_sp_idp_setup.yml that it should only execute if domain NOT default15:03
KSR-DKBut that of cause does not solve the core issue15:04
gtemamy current strong stand opinion: get rid of any "assumptions" and provide stable and complete pure API wrap. If any additional "usability" modules are desired they can be provided on top by combining individual modules, but we SHOULD STOP coding this into standard API wraps15:04
gtemaas a workaround (I think now that was supposed to be option 2) you invoke identity_domain_info module first to find the domain and further pass it's name into the identity_domain module15:05
gtemaI know how "bad" it is15:05
gtemabut that is what "declarative" approach in reality is about15:05
noonedeadpunkwell, frankly, it's easier to re-write into separate module. at least in terms of execution efficiency....15:06
gtemaI am strongly opposed to just giving a birth to another modules that nobody really maintains. Unless maintenance issue is solved there should be no new modules15:07
jm1[m]agree 100% with gtema. Basically he is the only maintainer left for openstack.cloud15:12
jm1[m]name vs id vs name_or_id caused issues in the past but introducing a clear distinction between id and name met too much resistance 15:14
gtemaright, and now we see why it is just unavoidable (to have a clear interface)15:15
jm1[m]openstacksdk correctly does this distinction in id and name, but openstack.cloud has always mixed up both. no way to change that. except...15:15
noonedeadpunkwell, imo, we can really leave name as name_or_id, while passing ID as ID only15:16
noonedeadpunkthen, when user passes id and name - name is updated15:16
noonedeadpunkwhen it's only name - name is added to non_updateable_attributes15:16
gtemaand how are you going to treat cinder which does a prefix based search?15:17
gtemaand in the domain case it will still lowcase the name15:17
jm1[m]if your openstack api of interest allows it, you can use the openstack.cloud.resource module as a workaround. basically it offers you a passthrough to openstacksdk resources15:17
gtemaI am stongly against of "fixing" inteface and leaving inconsistent naming (with "name" working as something else)15:18
jm1[m]agree with gtema again. its unmaintainable and confusing.15:18
noonedeadpunkit will locase only for search? which is again api issue15:18
noonedeadpunkwell, it's also question of how usable it would be when name can be only name, and uuid only uuid15:19
gtemanoonedeadpunk - there are no api issues. API is working as designed (and declared, hopefully). Problem is when you try to stretch one standard way of handling across all openstack services. It just doesn't work15:20
noonedeadpunkand ansible is really too slow to doublecheck everything through _info15:20
noonedeadpunkok, I was quite focused on the current issue frankly speaking... Like I got that it affects everything.... 15:20
gtemaapi-sig failed and my learning of last 6 years in openstack apis: stop trying to fix them. Find the way of dealing with that by letting user tell explicitly what he wants15:21
noonedeadpunkThough, openstackclient also almost always treat name as uuid. And I gues what everyone expects, to be able to use ansible modules as cli more or less15:21
noonedeadpunkbut not sure15:21
noonedeadpunkit can be only my wish ofc15:22
gtemaosc is invoking the same search. But since this is an explicit input parameter (and not the final expected value) you don't have this particular issue15:23
gtemainput/search15:23
gtemaand honestly - I hate this behavior in OSC also - there are just way too many assumptions that do not work across all apis and require very dirty hacks15:24
noonedeadpunkit's all about tradeoff of usability/maintenance cost15:24
noonedeadpunkso there should be some kind of tolerated middle-ground 15:24
gtemadisagree, the usability is not affected. It's a "used to" effect more15:25
gtemaall middle-ground requires manual maintenance with no possibility to automate things. What we really need to have is 1-to-1 API wrappers. If API is bad - cli/ansible/etc usability is bad. And API developer is to blame. It should not be a maintenance burden of the ecosystem tooling15:26
gtemanobody, literally nobody now is willing to spend on maintenance.15:27
gtemaall CTOs are only chasing features15:27
noonedeadpunkyeah15:28
noonedeadpunktrue15:28
noonedeadpunkI know15:28
noonedeadpunkThough I'm not sure who are "we" that needs to have 1-to-1. As openstack users unlikely need that :D15:29
gtemaif you would use other cli (gh, kubectl, etc) they offer you precisely what API is providing15:30
noonedeadpunkneither of them are as shattered15:31
gtemathere are some additions, but majority of the day2day things are just what API provides15:31
noonedeadpunkthese are single-repo/project things15:31
noonedeadpunkopenstack is jsut very different15:31
gtemaI mean here is that from the usability pov they offer you 1-to-1 API wrappings15:31
noonedeadpunkkubectl doesn't deal with all ecosystem around k8s15:31
gtemaand users are happy with that15:32
noonedeadpunkand openstacksdk is15:32
noonedeadpunkand openstack _is_ ecosystem15:32
gtemawhich is part of a problem. It should not be all treated as "core" openstack, but similarly as "openstack-affiliated" things. This will allow making it similar to kubectl plugins or gh extensions15:33
gtemawhere service developer is responsible for the usability, not the core cli maintainer15:33
noonedeadpunkyeah, and I guess that's where service clis become pluggable?15:34
noonedeadpunkand I totally do agree that service developers probably should pull their weight in ansible/terraform as well...15:34
gtemaright. But here you will again say: usability. Every thing becomes like a thing on its own with own standards15:34
noonedeadpunkyup15:35
gtemaactually no, service developers should not take care of ansible/tf/etc. They need to be aware of those and challenges coming from the different mgmt concepts15:35
noonedeadpunkAnd it's not like I have solution rather then put more ppl on the problem, as like you said - nobody wants to pay for that15:35
gtemabut what they absolutely SHOULD do is provide openapi spec what make it possible to generate 1-to-1 api bindings trying to have some sort of standartization15:36
jm1[m]what do we do short-term though? due to lack of maintainers for openstack.cloud and no improvement in sight, shouldn't we mark openstack.cloud as unmaintained?15:39
jm1[m]communicating the maintenance problems openly would be more honest and useful to users, wouldnt it?15:41
gtemaI would rather state: "nearly unmaintained" I am afraid that declaring it "unmaintained" will make more governance problems15:42
gtemaor "very close to be unmaintained"15:42
jm1[m]governance problems?15:42
noonedeadpunkeventually, I kind of wonder how SIG is even extended15:43
noonedeadpunkas it's very unlcear, for instance15:44
gtemayeah. TC may decide to kick it off from opendev.org/openstack or similar stuff15:44
jm1[m]openstack.cloud is not an official openstack project, at least not in the same sense as neutron or openstacksdk.15:44
noonedeadpunkyeah, ^ that is very confusing part15:44
noonedeadpunkas it's not clear how to step in with some maintenance help15:44
gtemalooking at all the discussions around active/unactive/unmaintained/etc discussions in TC (and I know collections is not an official project) I just fear there might be additional long discussions jsut sucking energy15:45
jm1[m]ack, you have better insights here so leave it up to you :D15:48
gtemathks jm115:49
opendevreviewTom Clark proposed openstack/ansible-collections-openstack master: Add missing network quota options  https://review.opendev.org/c/openstack/ansible-collections-openstack/+/91680515:54
noonedeadpunkas frankly, until breaking changes will arrive, I think we still should keep current modules at least basically reviewed/maintained15:55
noonedeadpunkand actually sigs activity is really another topic....15:56
opendevreviewTom Clark proposed openstack/ansible-collections-openstack master: Add missing network quota options  https://review.opendev.org/c/openstack/ansible-collections-openstack/+/91680515:58
opendevreviewTom Clark proposed openstack/ansible-collections-openstack master: Add missing network quota options  https://review.opendev.org/c/openstack/ansible-collections-openstack/+/91680515:58
opendevreviewTom Clark proposed openstack/ansible-collections-openstack master: Add missing network quota options  https://review.opendev.org/c/openstack/ansible-collections-openstack/+/91680516:10
opendevreviewTom Clark proposed openstack/ansible-collections-openstack master: Add missing network quota options  https://review.opendev.org/c/openstack/ansible-collections-openstack/+/91680516:13
opendevreviewTom Clark proposed openstack/ansible-collections-openstack master: Add missing network quota options  https://review.opendev.org/c/openstack/ansible-collections-openstack/+/91680516:13

Generated by irclog2html.py 2.17.3 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!