user2286858
user2286858

Reputation: 81

How to compare two remote files using Ansible?

Suppose there is file called compare.txt on remote host1 and host2.

I want to compare the two files if they are the same or not.

Is there a solution for this?

Upvotes: 1

Views: 2340

Answers (1)

techraf
techraf

Reputation: 68449

Use stat module with get_checksum parameter set on (which anyway is a default setting).

Then compare the checksums.

Upvotes: 1

Related Questions