Ansible 远程主机文件 MD5 校验 - 与本地文件对比
- hosts: remote_hosts//n tasks://n - name: Get remote file MD5//n command: md5sum /path/to/file//n register: remote_md5//n //n - name: Get local file MD5//n command: md5sum /path/to/file//n register: local_md5//n delegate_to: localhost//n //n - name: Compare MD5//n assert://n that://n - remote_md5.stdout.split()[0] == local_md5.stdout.split()[0]//n fail_msg: /'MD5 mismatch/
原文地址: https://www.cveoy.top/t/topic/pSr0 著作权归作者所有。请勿转载和采集!