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, 2019 in Ansible by Travis
327 views

1 answer to this question.

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, 2019 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,250 points
3,617 views
0 votes
1 answer

How do I wget a file from web server using shell in the ansible playbook

Hey Ayaan, you could probably use this ...READ MORE

answered Jan 24, 2019 in Ansible by Anushri
737 views
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, 2019 in Ansible by Mahir
533 views
+13 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 26, 2018 in DevOps & Agile by DragonLord999
• 8,400 points
303 views
0 votes
1 answer
0 votes
1 answer

obtain information about a file in windows using ansible playbook

Hey @Travis, you can use the win_stat ...READ MORE

answered Jun 10, 2019 in Ansible by Drake
168 views
0 votes
1 answer

How to create a new encrpted file using Ansible Vault?

If you are creating a new file ...READ MORE

answered Jan 29, 2019 in Ansible by Kyraa
101 views