Ansible Module command: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
Line 13: | Line 13: | ||
A command will NOT be interpreted by a shell, so variables like $HOME and operations like "<", ">", "|", ";" and "&" will not work. Use the [[Ansible Module shell|shelll]] module for that. | A command will NOT be interpreted by a shell, so variables like $HOME and operations like "<", ">", "|", ";" and "&" will not work. Use the [[Ansible Module shell|shelll]] module for that. | ||
< | <syntaxhighlight lang='yaml'> | ||
- name: A command example | - name: A command example | ||
command: some-command arg1 arg2 | command: some-command arg1 arg2 | ||
args: | args: | ||
chdir: /somedir/ | chdir: /somedir/ | ||
</ | </syntaxhighlight> |
Revision as of 23:53, 29 December 2020
External
Internal
Overview
The command module takes the command name followed by a list of space-delimited arguments.
A command will NOT be interpreted by a shell, so variables like $HOME and operations like "<", ">", "|", ";" and "&" will not work. Use the shelll module for that.
- name: A command example
command: some-command arg1 arg2
args:
chdir: /somedir/