Yeah there's no great way to do this really, for comparing directories with the stat module and arrays.
The stat info will contain extra info that may make this hard to compare. You could possibly register the result of an "ls -l" type command, just showing the fields you wanted to compare, or could use the "script:" module to push a quickie script that did it. On Wed, Sep 3, 2014 at 2:16 PM, Dylan Martin <[email protected]> wrote: > I've looked for this and haven't found it, so if this is documented > elsewhere, I do apologize. > > I want to compare the md5 sums of two copies of a list of files. IE there > are two locations which should have the same exact files, and I want to > compare them. Not all files in the two locations need to match and I have > a list of the files that should match > > - stat: foo/{{ item }} > with-items: list_of_files > register: foo_stat > - stat: bar/{{ item }} > with-items: list_of_files > register: bar_stat > - fail: msg="bar/{{ item }} doesn't match foo/{{ item }}" > with-items: list_of_files > when: ?????? > > Thanks! > -Dylan > > -- > 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/300f8ffc-bd14-4d41-b0fe-211b7b19f05b%40googlegroups.com > <https://groups.google.com/d/msgid/ansible-project/300f8ffc-bd14-4d41-b0fe-211b7b19f05b%40googlegroups.com?utm_medium=email&utm_source=footer> > . > 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/CA%2BnsWgz6yxq6tceSG1_48bQpajmrNun3XH0LCjt9475Gd6brTA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
