Personnally, I would prefer to have the list of capsules where the LifeCycle environment is replicated in the LifeCycle environment definition.
I find it cleaner in the ansible code, specially if you want to define lifecycle environments in different playbooks/inventories.
we think the correct approach would be to have all proxy→LCE associations in one place (so not splitting them across different playbooks/variables/whatever), as this makes assignment straight forward and idempotent
the "reverse" workflow as requested by @dabelenda is certainly possible and we would accept a patch for that, but are not planning on implementing it ourself right now.
when implementing, keep in mind that also the "unassignment" of the LCE from the proxy needs to be taken into account.
Personnally, I would prefer to have the list of capsules where the LifeCycle environment is replicated in the LifeCycle environment definition. I find it cleaner in the ansible code, specially if you want to define lifecycle environments in different playbooks/inventories.
Originally posted by @dabelenda in https://github.com/theforeman/foreman-ansible-modules/issues/869#issuecomment-699775849