Closed RobinR1 closed 5 months ago
I managed to find some time to study Python iterators and understand the code. I submitted a pull request that fixes this problem.
Hi,
I totally missed this message and the associated PR. I think I will make a small refactor but thank you for the description and PR.
I will have a look in the coming days.
Best,
Hi, thanks. Since I read you consider refactoring the lookup, I added a few feature requests you could consider. :-)
Hi @RobinR1
I finally found time to have a look and merged your PR.
Your contributions and tests with AWX are very appreciated. Thanks again for your patience regarding time to merge your PR.
Best regards,
I've configured the Passbolt ansible lookup plugin using OS environment variables set by AWX. This works without problem unless there is a
environment:
block defined in the ansible play, even when no passbolt plugin related variables are set in that block.Example: Environment variables are set on OS level and available to the Ansible process:
And with that, this works correctly:
However, this fails:
with:
So it seems that the plugin fails to look up the OS environment variables whenever there is a
environment:
block defined in the play.Looking at the code in function https://github.com/passbolt/lab-passbolt-ansible-collection/blob/ec035d465d98daf89c5d84bf67057807358d4dd4/plugins/lookup/passbolt.py#L104-L117 I think the OS environment is completely ignored when
environment_variables
is set even when the required variable is not found insideenvironment_variables
. I'm not familiar enough with Python and Ansible libraries to quickly create a pull request for this, but I think the code should fall back to the OS environment when the required variable is not found inenvironment_variables
.