Thanks !!!
Got you point. On 14-Dec-2017 4:51 pm, "Kai Stian Olstad" <[email protected]> wrote: > On 14.12.2017 11:27, Ravikumar Wagh wrote: > >> I was trying to get details of mout points but found that df and ansible >> setup module not returns same size or block count. >> >> This is case even I specify bloc size for df command >> >> checkout below : >> >> ravikumar:~ # df -Th --block-size=4096 >> Filesystem Type 4K-blocks Used Available Use% >> Mounted on >> /dev/sda3 ext3 23445742 3929894 18323208 18% >> / >> >> Ansible result : >> >> "block_available": 18323119, >> "block_size": 4096, >> "block_total": 23445742, >> >> >> Can some one comment on this why they are different. >> > > The block_total is equal and block_available just have a difference of 89 > blocks. > > I doubt that the ansible fact command checking the disk have been run at > the same millisecond/nanosecond as the df command. > In a live file system a lot of IO is ongoing, like temp files been created > av deleted, so it normal that available space change all the time. > > Ansible is just running Python os.statvfs so with this command you might > be lucky to see that they are the same. > > df -Th --block-size=4096 /; python -c "import os;print os.statvfs('/')" > > But this oneliner with two commands is run one after the other, so it too > might be different. > > -- > Kai Stian Olstad > > -- > You received this message because you are subscribed to a topic in the > Google Groups "Ansible Project" group. > To unsubscribe from this topic, visit https://groups.google.com/d/to > pic/ansible-project/EMSh9MjrUxY/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [email protected]. > To post to this group, send email to [email protected]. > To view this discussion on the web visit https://groups.google.com/d/ms > gid/ansible-project/81a2a5eaeb7fe67bd3a8b6e6b20099f4%40olstad.com. > For more options, visit https://groups.google.com/d/optout. > -- 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 post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAGWco2AO4MgJBrzE7%3Du%3DNWayOvu3_y_5vdoZbG-6N--9w2GxFg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
