Hi
I have a playbook which create the vm in vCenter
---
- hosts: localhost
gather_facts: false
connection: local
vars_files:
- ./vars/xxx.yml
tasks:
- name: Create VM using template
vmware_guest:
hostname: "{{ vcenter_server }}"
username: "{{ vcenter_user
Can you provide output of lineinfile ? Mine look like
changed: [localhost] => (item=a) => {"ansible_loop_var": "item", "backup":
"", "changed": true, "item": "a", "msg": "line added"}
changed: [localhost] => (item=b) => {"ansible_loop_var": "item", "backup":
"", "changed": true, "item": "b", "msg"
Thanks for the reply Abhi
What i noticed is it does update the file if there is no entry like blow is
the o/p
TASK [Update the Inventory]
*
for eg
[group1]
server1
server2
[group2]
server1
server2
if you remove from group one & run does not update So lineinfile
should have someway to say the position exactly below [group1] add is
missing ...
On Tuesday, March 2, 2021 at 11:08:50 PM UTC-8 esxi...@gmail.com wrote:
> Than
On Tue, 2 Mar 2021 23:08:50 -0800 (PST)
"esxi...@gmail.com" wrote:
> but if the entry already present in more than 1 group say .. then it does
> not update the file
Try "ini_file", e.g.
https://docs.ansible.com/ansible/latest/collections/community/general/ini_file_module.html
- ini_file:
Thanks Vladimir Botka
On Wednesday, March 3, 2021 at 1:01:59 AM UTC-8 vbo...@gmail.com wrote:
> On Tue, 2 Mar 2021 23:08:50 -0800 (PST)
> "esxi...@gmail.com" wrote:
>
> > but if the entry already present in more than 1 group say .. then it
> does
> > not update the file
>
> Try "ini_file", e