Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
5951f14d
Commit
5951f14d
authored
Jun 24, 2014
by
James Cammarata
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7915 from gitaarik/devel
Add examples for `shell` and `command` modules.
parents
e4a4152f
59d98993
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
3 deletions
+22
-3
library/commands/command
+10
-2
library/commands/shell
+12
-1
No files found.
library/commands/command
View file @
5951f14d
...
...
@@ -77,11 +77,19 @@ author: Michael DeHaan
'''
EXAMPLES
=
'''
# Example from Ansible Playbooks
# Example from Ansible Playbooks
.
- command: /sbin/shutdown -t now
# Run the command if the specified file does not exist
# Run the command if the specified file does not exist
.
- command: /usr/bin/make_database.sh arg1 arg2 creates=/path/to/database
# You can also use the 'args' form to provide the options. This command
# will change the working directory to somedir/ and will only run when
# /path/to/database doesn't exist.
- command: /usr/bin/make_database.sh arg1 arg2
args:
chdir: somedir/
creates: /path/to/database
'''
def
main
():
...
...
library/commands/shell
View file @
5951f14d
...
...
@@ -53,6 +53,17 @@ author: Michael DeHaan
EXAMPLES = '''
# Execute the command in remote shell; stdout goes to the specified
# file on the remote
# file on the remote
.
- shell: somescript.sh >> somelog.txt
# Change the working directory to somedir/ before executing the command.
- shell: somescript.sh >> somelog.txt chdir=somedir/
# You can also use the 'args' form to provide the options. This command
# will change the working directory to somedir/ and will only run when
# somedir/somelog.txt doesn't exist.
- shell: somescript.sh >> somelog.txt
args:
chdir: somedir/
creates: somelog.txt
'''
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment