ansible-复制文件案例
1)aoa.tgz
ansible -i /data/ld_fabu/ansible_cfg/hosts all -m copy -a 'src=/data/ld_fabu/env_online/sourcefile/aoa.tgz dest=/data/game/update/aoa.tgz owner=ledou00 group=ledou00 mode=0644'
2)删除
ansible -i /data/ld_fabu/ansible_cfg/hosts all -m shell -a 'cd /data/game/update;/bin/rm -rf *'
3)复制
ansible -i /data/ld_fabu/ansible_cfg/hosts all -m shell -a 'cd /data/game/update;/bin/cp -rf * /data/game/aoa'
4)指定模块分组
ansible -i /data/ld_fabu/ansible_cfg/hosts rootmonitor -m shell -a 'cd /data/game/aoa;/bin/cp -rf lib/* root_monitor;/bin/cp -rf res root_monitor;'
5)cp 复制
ansible -i /data/ld_fabu/ansible_cfg/hosts logicplayer1 -m shell -a 'cd /data/game/aoa;/bin/cp -rf lib/* logic_player_1;/bin/cp -rf res logic_player_1;'
6)修改权限
ansible -i /data/ld_fabu/ansible_cfg/hosts logicplayer2 -m shell -a 'cd /data/game/aoa;/bin/cp -rf lib/* logic_player_2;/bin/cp -rf res logic_player_2;cd /data/game/aoa/logic_player_2/bin;chmod +x xxjh'
7)多目录
ansible -i /data/ld_fabu/ansible_cfg/hosts logicworldmap1 -m shell -a 'cd /data/game/aoa;/bin/cp -rf lib/* logic_world_map_1;/bin/cp -rf res logic_world_map_1;cd /data/game/aoa/logic_world_map_1/bin;chmod +x xxjh'
标签:bin,aoa,案例,rf,ansible,复制,cp,data From: https://blog.csdn.net/lisanmengmeng/article/details/143406814