SUMMARY

Tried to write a line using lineinfule module sequentially were observed 
that the random lines are missed to write on the file.

STEPS TO REPRODUCE

  serial: 100

  become: True
  gather_facts: False

  tasks:
    - name: Executing script
      script: scripts/getDisksData.py
      register: disk_data
      tags:
        - run_script
        - get_disk_data

    - set_fact: disk_data="{{inventory_hostname }} {{ disk_data.stdout_lines[0] 
}}"
      tags:
        - run_script
        - get_disk_data

    - name: Write Disks Data to file
      lineinfile: line={{ disk_data }} dest=working_dir/{{ app_id 
}}_instance_disk_data.txt insertafter=EOF state=present
      delegate_to: localhost
      tags:
        - run_script
        - get_disk_data

EXPECTED RESULTS

Passed 4 ips to the inventory so 4 entries should be made on the file.


ACTUAL RESULTS

Got 2 entries on the first attempt.
Got 4 entries on second attempt.

-- 
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/720835c1-e74f-4915-8d4d-a1931f08a4d9%40googlegroups.com.

Reply via email to