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
4280e00d
Commit
4280e00d
authored
Sep 06, 2012
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1000 from mavimo/patch-1
Add support to removes control param
parents
7ef3e7dc
2dd430d9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
library/command
+15
-0
No files found.
library/command
View file @
4280e00d
...
@@ -114,6 +114,21 @@ class CommandModule(AnsibleModule):
...
@@ -114,6 +114,21 @@ class CommandModule(AnsibleModule):
rc
=
0
rc
=
0
)
)
args
=
args
.
replace
(
x
,
''
)
args
=
args
.
replace
(
x
,
''
)
elif
x
.
startswith
(
"removes="
):
# do not run the command if the line contains removes=filename
# and the filename do not exists. This allows idempotence
# of command executions.
(
k
,
v
)
=
x
.
split
(
"="
,
1
)
if
not
os
.
path
.
exists
(
v
):
self
.
exit_json
(
cmd
=
args
,
stdout
=
"skipped, since
%
s do not exists"
%
v
,
skipped
=
True
,
changed
=
False
,
stderr
=
False
,
rc
=
0
)
args
=
args
.
replace
(
x
,
''
)
elif
x
.
startswith
(
"chdir="
):
elif
x
.
startswith
(
"chdir="
):
(
k
,
v
)
=
x
.
split
(
"="
,
1
)
(
k
,
v
)
=
x
.
split
(
"="
,
1
)
v
=
os
.
path
.
expanduser
(
v
)
v
=
os
.
path
.
expanduser
(
v
)
...
...
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