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",
> "ansible_distribution_major_version": "18",
> "ansible_distribution_release": "bionic",
> "ansible_distribution_version": "18.04",
>
>
>
> I would like to use OS name as
>
> Ubuntu20.04 & not Ubuntu 20.04.2 LTS
>
> So tried below .. as /*value */.. all 3 failed .. any suggestions Please, on how to concatenate ?
>
> #######################################
>
> The offending line appears to be:
>
> - name: OS
> value: "{{ r.ansible_facts.ansible_distribution }}" "{{ r.ansible_facts.ansible_distribution_version }}"
> ^ here
This should do the trick:
value: "{{ r.ansible_facts.ansible_distribution }} {{ r.ansible_facts.ansible_distribution_version }}"
Regards
racke
> On Wed, Feb 24, 2021 at 12:24 AM Kiran Kumar <
esxi...@gmail.com <mailto:
esxi...@gmail.com>> wrote:
>
> Wow r.ansible_facts.ansible_lsb.description did worked !!! Thanks again Abhijit
>
> On Wed, Feb 24, 2021 at 12:17 AM Kiran Kumar <
esxi...@gmail.com <mailto:
esxi...@gmail.com>> wrote:
>
> 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..
>
>
> "ansible_lsb": {
> "codename": "bionic",
> _* "description": "Ubuntu 18.04.5 LTS",*_
> Capture.JPG
>
>
> Today these are populated with community.vmware.vmware_guest_custom_attributes
>
>
> But that is manually from the file.. it has human error possible
>
> eg Ubuntu 20.04 folks may type Ubuntu20.4
>
>
> There is facts which ansible gather has the OS info.. eg -m setup -a
> "filter=ansible_distribution_version"
>
>
> Is it somehow possible to get the OS info populated "automatically" with a playbook .. ie update
> the custom attributes dynamically with real time data ?
>
> Any suggestions Please ?
>
> Thanks
>
> --
> You received this message because you are subscribed to the Google Groups "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
>
ansible-proje...@googlegroups.com.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/ansible-project/6a28a2f4-92d4-4963-8a8d-0c79c64b87cbn%40googlegroups.com
> <
https://groups.google.com/d/msgid/ansible-project/6a28a2f4-92d4-4963-8a8d-0c79c64b87cbn%40googlegroups.com?utm_medium=email&utm_source=footer>.
>
>
>
> --
> Thanks,
> Abhijeet Kasurde
>
> --
> You received this message because you are subscribed to the Google Groups "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
>
ansible-proje...@googlegroups.com <mailto:
ansible-proje...@googlegroups.com>.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/ansible-project/653118a7-176e-48c8-921b-f23830da9534n%40googlegroups.com
> <
https://groups.google.com/d/msgid/ansible-project/653118a7-176e-48c8-921b-f23830da9534n%40googlegroups.com?utm_medium=email&utm_source=footer>.
>
> --
> You received this message because you are subscribed to the Google Groups "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
>
ansible-proje...@googlegroups.com <mailto:
ansible-proje...@googlegroups.com>.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/ansible-project/CAGhW9Js43VnoQRBUP2XH7%3DTU4JTZ%3DsQdrcXj_OYjv0_k14%3DQ-w%40mail.gmail.com
> <
https://groups.google.com/d/msgid/ansible-project/CAGhW9Js43VnoQRBUP2XH7%3DTU4JTZ%3DsQdrcXj_OYjv0_k14%3DQ-w%40mail.gmail.com?utm_medium=email&utm_source=footer>.
--
Ecommerce and Linux consulting + Perl and web application programming.
Debian and Sympa administration. Provisioning with Ansible.