1. ansible 10.0.0.1 -m raw -a "date" -u www

2.在ansible的主机配置文件中指定ssh_user
vi/etc/ansible/hosts
10.0.0.1 ansible_ssh_user=www

3.特殊符号- 用shell模块

ansible   test -m shell  -a 'echo do2admin|passwd --stdin dev'

4.sudo   vim  /etc/sudoers

dev ALL=(ALL:ALL) NOPASSWD:ALL
%sudo ALL=(ALL:ALL) NOPASSWD:ALL

 

相关文章:

  • 2022-12-23
  • 2021-09-24
  • 2022-02-01
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-03
  • 2021-07-03
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案