Skip to content

Commit

Permalink
clarifies args vs argv per bcoca feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
acozine committed Dec 17, 2018
1 parent 4deb7be commit d4bac89
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/ansible/modules/commands/command.py
Expand Up @@ -90,6 +90,7 @@
- name: Run command if /path/to/database does not exist (without 'args').
command: /usr/bin/make_database.sh db_user db_name creates=/path/to/database
# 'args' is a task keyword, passed at the same level as the module
- name: Run command if /path/to/database does not exist (with 'args').
command: /usr/bin/make_database.sh db_user db_name
args:
Expand All @@ -103,12 +104,12 @@
chdir: somedir/
creates: /path/to/database
- name: Use 'argv' with 'args' to send a command as a list - be sure to leave 'command' empty
# 'argv' is a parameter, indented one level from the module
- name: Use 'argv' to send a command as a list - leave 'command' empty
command:
args:
argv:
- echo
- testing
- /usr/bin/backup_database.sh
- /usr/bin/optimize_database.sh
- name: safely use templated variable to run command. Always use the quote filter to avoid injection issues.
command: cat {{ myfile|quote }}
Expand Down

0 comments on commit d4bac89

Please sign in to comment.