Re: [ansible-devel] Share data between lookup plugin instances

2022-08-03 Thread piete...@gmail.com
OK, thanks Brian ! Op woensdag 3 augustus 2022 om 15:11:13 UTC+2 schreef bc...@redhat.com: > There is no facility to do this, you would have to save/read a file > like the password lookup does. > Another option is to have a task that does the login and registers the > token into a variable (via r

Re: [ansible-devel] how to read the ansible.cfg file variables in ansible custom modules

2022-08-03 Thread Brian Coca
It is possible, just not via the variable, do `import sys; sys.version_info < (3, 0)`, since that will reflect the python the script is running under. -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible Development" group. To unsubscribe f

Re: [ansible-devel] Share data between lookup plugin instances

2022-08-03 Thread Brian Coca
There is no facility to do this, you would have to save/read a file like the password lookup does. Another option is to have a task that does the login and registers the token into a variable (via register: or returning ansible_facts). FYI, each lookup does not have it's own python instance, but e

Re: [ansible-devel] how to read the ansible.cfg file variables in ansible custom modules

2022-08-03 Thread Naveen Kandakur
Thanks for the info Felix, I wanted to do some decision making in my module based on values configured in the ansible.cfg for example, if the python_interpreter variable value set to python2 in ansible.cfg then i want to throw an appropriate error message by checking the python_interpreter value

[ansible-devel] Share data between lookup plugin instances

2022-08-03 Thread piete...@gmail.com
Hi all, I've written a lookup plugin that authenticates to some REST endpoint. Once authenticated a token is returned that can be reused for further REST calls. Is there a way I can store the token someplace, so that the next invocation of the lookup plugin can access it and use it instead of au

Re: [ansible-devel] how to read the ansible.cfg file variables in ansible custom modules

2022-08-03 Thread 'Felix Fontein' via Ansible Development
Hi, > I am new to Ansible Custom module development, can any one help me > how i can access the variables defined in ansible.cfg file into my > ansible modules python file. by default you cannot. IMO you also should not, because that's contrary to expectations that users have of modules. Modules

[ansible-devel] how to read the ansible.cfg file variables in ansible custom modules

2022-08-03 Thread Naveen Kandakur
I am new to Ansible Custom module development, can any one help me how i can access the variables defined in ansible.cfg file into my ansible modules python file. -- You received this message because you are subscribed to the Google Groups