ansible 命令相关

ansible all -m ping # 检测是否ping通
ansible qcloud --list-hosts # 列出qcloud组内机器
ansible qcloud -a "touch /root/1.txt" -f 3
ansible qcloud -a "rm /root/1.txt" -f 3
ansible qcloud -m yum -a "name=acme state=present"
ansible qcloud -m apt -a "name=systemd state=present"
ansible qcloud -m systemd -a "name=crond state=restarted"
ansible qcloud -a "/usr/bin/apt update"
ansible qcloud -a "/usr/bin/apt list --upgradable update"
ansible qcloud -a "/usr/bin/apt list --upgradable"
ansible qcloud -a "/usr/bin/apt upgrade -y"
ansible-doc yum
ansible-doc -l
ansible_distribution # 确定操作系统
ansible localhost -m setup |less # 默认收集的信息
ansible-playbook --syntax-check web-tls.yml # 语法检查

发表评论

电子邮件地址不会被公开。 必填项已用*标注