On Tue, 2 Mar 2021 23:08:50 -0800 (PST)
"[email protected]" <[email protected]> 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:
        dest: /etc/ansible/hosts
        section: MyServers
        option: "{{ item }}"
        allow_no_value: true
      loop: "{{ servers }}"

-- 
Vladimir Botka

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/20210303100140.5a87427c%40gmail.com.

Attachment: pgploZi1eg5RX.pgp
Description: OpenPGP digital signature

Reply via email to