Get MD5 checksum of a windows file using Ansible

0 votes
I'm trying to get MD5 checksum of a file using Ansible. How do I write the task for it? What module do I use? Can you help me out with this? Thanks
Jun 10 in Ansible by Travis
17 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

Hi @Travis, you can use the win_stat module for this purpose. This module basically abstracts all your file/folder information. It only works for windows though. Have a look at this example:

- name: Get MD5 checksum of a file
  win_stat:
    path: Path_to_file
    get_checksum: yes
    checksum_algorithm: md5
  register: md5_checksum
answered Jun 10 by Greg

Related Questions In Ansible

+1 vote
1 answer

Is it possible to append a large amount of text to a file using Ansible?

Here is concept which you can follow. blockinfile is ...READ MORE

answered Jul 30, 2018 in Ansible by Atul
• 10,220 points
1,634 views
0 votes
1 answer
0 votes
1 answer

How do I get a list of all Ansible variables?

Ansible by default gathers facts about machines ...READ MORE

answered Jan 30 in Ansible by Mahir
117 views
+13 votes
2 answers
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.