[root@m01 ~]# ansible all -m yum -a "name=rsync,nfs-utils state=installed"
2. 准备rsync客户端的密码文件
[root@m01 ~]# ansible all -m copy -a "content='1' dest=/etc/rsync.pass owner=root group=root mode=600"
3. 创建一个uid和gid为666的www用户
[root@m01 ~]# ansible all -m group -a "name=www gid=666"
[root@m01 ~]# ansible all -m user -a "name=www uid=666 group=666 create_home=no shell=/sbin/nologin"
4. 推送全网备份的脚本,并配置好定时任务
[root@m01 ~]# ansible all -m copy -a "src=./scripts/rsync_backup_md5.sh dest=/server/scripts/ mode=755"
[root@m01 ~]# ansible all -m cron -a "name='Rsync Bakcup Scripts' hour=01 minute=00 job='/bin/bash /server/scripts/rsync_backup_md5.sh &>/dev/null'"
文章目录安装rsync和nfs-utils[root@m01 ~]# ansible all -m yum -a "name=rsync,nfs-utils state=installed"所有的主机都需要准备对应的rsync客户端的密码文件/etc/rsync.pass[root@m01 ~]# ansible all -m copy -a "content='1' dest=...