远程批量执行命令:
ansible all -m shell -a " ls -al /tmp/"
远程批量创建文件、目录:(目录)state=directory (文件)state=touch、(删除)state=absent
ansible all -m file -a "path=/tmp/test state=directory owner=root group=root mode=600 "
远程批量文件复制:
ansible all -m copy-a "src=/tmp/text.txt dest=/tmp/text.txt"
远程批量安装服务:
ansible all -m yum-a "name=httpd state=present/install/remove"
远程批量启动服务:
ansible all -m service -a "name=httpd state=started/stopped/restarted"
ansible命令行操作
最新推荐文章于 2024-04-08 15:18:57 发布