
ansible
PlatoWG
爱生活,爱雪儿。。。
展开
-
ansible命令行使用普通用户执行命令
背景ansible已配置root用户来管理客户机,但是管理某服务的时候需要使用普通用户user1解决办法ansible -S -R user1 jboss -m shell -a 'whoami' -S, --su run operations with su (deprecated, use become) -R SU_USER, --su-user=SU_USER run operations with su原创 2021-10-13 11:02:27 · 1021 阅读 · 0 评论 -
ansible 命令基础
ansible 主机分组 -m 模块 -a '命令和参数'给所有主机部署密钥ansible all -m authorized_key -a "user=root exclusive=true manage_dir=true key='$(< /root/.ssh/id_rsa.pub)'" -kansible-doc 查看帮助,必须掌握ansible-doc -l ...原创 2019-03-22 11:27:30 · 218 阅读 · 0 评论 -
自动化工具Ansible的hosts文件配置实例
[linux:children] #指定子组linux6linux7[linux6]192.168.0.10192.168.0.11192.168.0.[12:20] #192.168.0.12——192.168.0.30[linux7]192.168.0.87 ansible_ssh_user="root" ansible_ssh_pass="qwe1...原创 2019-03-22 11:22:26 · 1905 阅读 · 0 评论