Re: [ansible-project] Re: Automate Custome Attribute Population - Vmware

2021-02-24 Thread Kiran Kumar
Ok this one was easy .. just did below value: "{{ r.ansible_facts.ansible_distribution }}{{ r.ansible_facts.ansible_distribution_version }}" Thanks again Abhi & Stefan Hornburg (Racke) On Wed, Feb 24, 2021 at 10:11 AM Kiran Kumar wrote: > "{{ r.ansible_facts.ansible_distribution ~ ' ' ~ >

Re: [ansible-project] Re: Automate Custome Attribute Population - Vmware

2021-02-24 Thread Kiran Kumar
"{{ r.ansible_facts.ansible_distribution ~ ' ' ~ r.ansible_facts.ansible_distribution_version }}" , works it gives Ubuntu 18.04 How to get Ubuntu18.04 Ie remove the space ? Will try few things .. Any docs Please on this ? where you go these .. ~ ' ' ~ :) BTW yes, "{{

Re: [ansible-project] Re: Automate Custome Attribute Population - Vmware

2021-02-24 Thread Abhijeet Kasurde
how about - "{{ r.ansible_facts.ansible_distribution ~ ' ' ~ r.ansible_facts.ansible_distribution_version }}" On Wed, Feb 24, 2021 at 3:36 PM Kiran Kumar wrote: > > Setup gives : > > "ansible_distribution": "Ubuntu", > "ansible_distribution_file_parsed": true, >

Re: [ansible-project] Re: Automate Custome Attribute Population - Vmware

2021-02-24 Thread Stefan Hornburg (Racke)
On 2/24/21 11:04 AM, Kiran Kumar wrote: > > Setup gives : > >         "ansible_distribution": "Ubuntu", >         "ansible_distribution_file_parsed": true, >         "ansible_distribution_file_path": "/etc/os-release", >         "ansible_distribution_file_variety": "Debian", >        

Re: [ansible-project] Re: Automate Custome Attribute Population - Vmware

2021-02-24 Thread Kiran Kumar
Setup gives : "ansible_distribution": "Ubuntu", "ansible_distribution_file_parsed": true, "ansible_distribution_file_path": "/etc/os-release", "ansible_distribution_file_variety": "Debian", "ansible_distribution_major_version": "18",

Re: [ansible-project] Re: Automate Custome Attribute Population - Vmware

2021-02-24 Thread Kiran Kumar
Wow r.ansible_facts.ansible_lsb.description did worked !!! Thanks again Abhijit On Wed, Feb 24, 2021 at 12:17 AM Kiran Kumar wrote: > Thanks Abhijit, Awesome , it worked > > Only issue is > > value: "{{ r.ansible_facts.ansible_distribution }}" > when: vm_info.instance.customvalues.OS != >

Re: [ansible-project] Re: Automate Custome Attribute Population - Vmware

2021-02-24 Thread Kiran Kumar
Thanks Abhijit, Awesome , it worked Only issue is value: "{{ r.ansible_facts.ansible_distribution }}" when: vm_info.instance.customvalues.OS != r.ansible_facts.ansible_distribution that Just give Ubuntu ... is it possible to extract the info from setup module ie below part..

Re: [ansible-project] Re: Automate Custome Attribute Population - Vmware

2021-02-22 Thread esxi...@gmail.com
Thanks a lot Abhijit .. i will give it a try & report issue if any. On Monday, February 22, 2021 at 9:30:23 PM UTC-8 Abhijeet Kasurde wrote: > You can do this using dynamic inventory and delegate_to > > Here is how - > > 1. Gather facts about virtual machines > 2. Gather facts about custom

Re: [ansible-project] Re: Automate Custome Attribute Population - Vmware

2021-02-22 Thread Abhijeet Kasurde
You can do this using dynamic inventory and delegate_to Here is how - 1. Gather facts about virtual machines 2. Gather facts about custom attributes using vmware_guest_info 3. Compare and change if needed you can see this playbook --- - hosts: running tasks: - setup: register: r - debug: msg:

[ansible-project] Re: Automate Custome Attribute Population - Vmware

2021-02-22 Thread esxi...@gmail.com
I will give 1 more reason .. eg someone upgrade OS from 16.04 to 20.04 .. may forget to update the custom attributes... On Monday, February 22, 2021 at 2:41:08 PM UTC-8 esxi...@gmail.com wrote: > Hi > > Here are my custom attributes > > > [image: Capture.JPG] > > > Today these are populated