ansible- base command

Command Format

  • absible <host or group list> [Options] // ansible all is the whole host
  • -M path designation module
  • -m using modules, the default is the command module
  • -a module parameters or --args
  • -i is the inventory or executable script file path
  • -k using an interactive login password
  • -e-defined variables
  • -v For more information, -vvvv turn on debug mode
ansible all -m command -a "uptime"   //如果没有做免密或者配置文件中有用户名和密码会报错
ansible all -m command -a "uptime"  -k  //不会报错,没有密码会让输入密码

Guess you like

Origin www.cnblogs.com/xhwy-1234/p/12160708.html