[ansible-project] lookup.ini plugin doesn't work

2023-03-10 Thread Neha Singh
Hi Team, I have created one file where I have specify a variable: path: /opt/si/ansible/conf/virtual_host transient_partition_size = 200G And then trying to print the variable by using lookup through another playbook: - debug: msg: "{{ lookup('ini', 'transient_partition_size section={{contro

Re: [ansible-project] lookup.ini plugin doesn't work

2023-03-10 Thread Abhijeet Kasurde
Error is - File contains no section headers. You need a section in ini file that you have created. On Fri, Mar 10, 2023 at 6:25 PM Neha Singh wrote: > Hi Team, > > I have created one file where I have specify a variable: > > path: /opt/si/ansible/conf/virtual_host > > transient_partition_size =

Re: [ansible-project] lookup.ini plugin doesn't work

2023-03-10 Thread Neha Singh
Ok, one more question though. I have not mentioned any file extension like .ini, .conf, .cfg. Will that work without the same as well. Thanks Neha On Friday, March 10, 2023 at 6:30:40 PM UTC+5:30 Abhijeet Kasurde wrote: > Error is - File contains no section headers. > > You need a section in i

Re: [ansible-project] lookup.ini plugin doesn't work

2023-03-10 Thread Abhijeet Janwalkar
Hey, Is there a typo in file name - and _. Or it's only in mail. Warm regards Abhijeet On Fri, 10 Mar, 2023, 14:17 Neha Singh, wrote: > Ok, one more question though. I have not mentioned any file extension like > .ini, .conf, .cfg. Will that work without the same as well. > > Thanks > Neha > >

Re: [ansible-project] lookup.ini plugin doesn't work

2023-03-10 Thread Neha Singh
Hi Abhijeet, I have updated my config file as below: file path: /opt/si/ansible/conf/virtual_host.conf [control_environment] transient_partition_size = 150G and my playbook task is as below: - debug: msg: "{{ lookup('ini', 'transient_partition_size section={{control_environment}} file=/opt/s

Re: [ansible-project] lookup.ini plugin doesn't work

2023-03-10 Thread Neha Singh
Adding the full error message: Error was a , original message: An unhandled exception occurred while running the lookup plugin 'ini'. Error was a , original message: No section: u'edgy'"}ESC[0m On Friday, March 10, 2023 at 7:22:10 PM UTC+5:30 Neha Singh wrote: > Hi Abhijeet, > > I have update

Re: [ansible-project] lookup.ini plugin doesn't work

2023-03-10 Thread Abhijeet Kasurde
# cat virtual_host.conf [control_environment] transient_partition_size = 150G --- - hosts: localhost gather_facts: no tasks: - debug: msg: "{{ lookup('ini', 'transient_partition_size section=control_environment file=virtual_host.conf') }}" output - ``` TASK [debug] **

Re: [ansible-project] lookup.ini plugin doesn't work

2023-03-10 Thread Neha Singh
As mentioned in the error: Error was a , original message: An unhandled exception occurred while running the lookup plugin 'ini'. Error was a , original message: No section: u'edgy'"} When I have updated the section name with 'edgy' as below: [edgy] transient_partition_size = 150G and used th

Re: [ansible-project] lookup.ini plugin doesn't work

2023-03-10 Thread Abhijeet Kasurde
You are using '{{' for Jinja templating for section name in the lookup plugin. If you are setting the section value to 'control_environment' then don't include the '{{' in the lookup plugin. On Fri, Mar 10, 2023 at 7:45 PM Neha Singh wrote: > As mentioned in the error: > Error was a , original

Re: [ansible-project] Track list of failed/success tasks into a file.

2023-03-10 Thread Todd Lewis
If you mistakenly believe using `ansible-runner` is too much work, then you can instead do even more work to put your tasks in blocks with `rescue` and `always` sections to record the data which you can later collate. See https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_blocks.ht

Re: [ansible-project] lookup.ini plugin doesn't work

2023-03-10 Thread Todd Lewis
Your quoting is all wrong. You are passing in one long string. Use this: msg: "{{ lookup('ini', 'transient_partition_size', section='control_environment', file='/opt/si/ansible/conf/virtual_host.conf') }}" On Friday, March 10, 2023 at 9:37:39 AM UTC-5 Abhijeet Kasurde wrote: > You are using

Re: [ansible-project] lookup.ini plugin doesn't work

2023-03-10 Thread Todd Lewis
Also, if your file doesn't have sections, only `key=value` pairs, then specify `type='properties'`, like this: msg: "{{ lookup('ini', 'transient_partition_size', type='properties', file='/opt/si/ansible/conf/virtual_host.conf') }}" On Friday, March 10, 2023 at 10:02:12 AM UTC-5 Todd Lewis wrot

Re: [ansible-project] read password from a variable

2023-03-10 Thread Veera
Its a problem with "pexpect" module requirement and it worked after "pip3 install pexpect". However , now "source ./myenv" is not working msg": "The command was not found or was not executable: source" Since source is a shell inbuilt command . Is there a way to overcome it ? I tried multip

Re: [ansible-project] read password from a variable

2023-03-10 Thread Antony Stone
On Friday 10 March 2023 at 16:39:17, Veera wrote: > Its a problem with "pexpect" module requirement and it worked after "pip3 > install pexpect". > However , now "source ./myenv" is not working > > msg": "The command was not found or was not executable: source" > > Since source is a shell in

Re: [ansible-project] read password from a variable

2023-03-10 Thread Todd Lewis
Even if it worked, its effects will go away as soon as the shell running it closes. It won't persist to another task. On Friday, March 10, 2023 at 10:45:06 AM UTC-5 Antony Stone wrote: > On Friday 10 March 2023 at 16:39:17, Veera wrote: > > > Its a problem with "pexpect" module requirement and i

Re: [ansible-project] read password from a variable

2023-03-10 Thread Veera
Yes.. I uses Ubuntu 22 . but when executed manually source exists. Failing when called through the playbook with the mentioned error. @ToddWill it exists until the next play executes in the same playbook ? I required the processed source variables for the next play(on

Re: [ansible-project] Track list of failed/success tasks into a file.

2023-03-10 Thread Aharonu
Thank you Todd. Many options you have provided. I will go through it and see what works for my requirement. On Fri, 10 Mar 2023, 20:14 Todd Lewis, wrote: > If you mistakenly believe using `ansible-runner` is too much work, then > you can instead do even more work to put your tasks in blocks wi

[ansible-project] install vmware tools via ansible playbook (winrm)

2023-03-10 Thread Shay Cohen
Hi, .I am trying to install a vmare tools on windows machine but noting happen I manage to copy the file but when I am trying to install I dont see any or installation running in the background. --- - hosts: all tasks: - name: Copy a single file vmare-tools ansible.windows.win_copy:

[ansible-project] install vmware tools via ansible playbook (winrm)

2023-03-10 Thread Shay Cohen
.I am trying to install a vmare tools on windows machine but noting happen I manage to copy the file but when I am trying to install I don't see any error or installation running in the background. --- - hosts: all tasks: - name: Copy a single file vmare-tools ansible.windows.win_cop

Re: [ansible-project] install vmware tools via ansible playbook (winrm)

2023-03-10 Thread Will McDonald
It's hard to tell from the mail formatted commands but thoughts off the top of my head: 1. /S /v"/qn looks like it might need an additional space: /v "/qn 2. Have you tried to register the output of the task and then subsequently inspect that? If so... what's the output? 3. Have you tried using th

Re: [ansible-project] install vmware tools via ansible playbook (winrm)

2023-03-10 Thread Thanh Nguyen Duc
Does command work locally? If can then you may try to create a bat file then trigger it instead?Thanks and Best Regards,Thanh.On 11 Mar 2023, at 07:29, Will McDonald wrote:It's hard to tell from the mail formatted commands but thoughts off the top of my head:1. /S /v"/qn looks like it might need