ansible shell模块简单使用

发布时间 2023-07-12 18:02:54作者: 南风丶轻语

ansible shell模块简单使用

参数

参数 说明
chdir 运行命令前先CD到该目录
cmd 运行的命令
creates 存在某个文件就不运行命令
executable 更改执行命令的shell路径,需要是绝对路径
free_form The shell module takes a free form command to run, as a string.There is no actual parameter named ‘free form’.See the examples on how to use this module.
removes 不存在某个文件就不运行命令
stdin 直接设置输入
stdin_add_newline 是否将换行符附加到stdin数据
选项:false和true,默认true

链接

ansible.builtin.shell module – Execute shell commands on targets — Ansible Documentation