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
670894e2
Commit
670894e2
authored
Jun 02, 2015
by
Matt Martz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move building the play_ds into a method, that can be overridden
parent
0d606b57
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
lib/ansible/cli/adhoc.py
+8
-7
No files found.
lib/ansible/cli/adhoc.py
View file @
670894e2
...
@@ -65,6 +65,13 @@ class AdHocCLI(CLI):
...
@@ -65,6 +65,13 @@ class AdHocCLI(CLI):
return
True
return
True
def
_play_ds
(
self
,
pattern
):
return
dict
(
name
=
"Ansible Ad-Hoc"
,
hosts
=
pattern
,
gather_facts
=
'no'
,
tasks
=
[
dict
(
action
=
dict
(
module
=
self
.
options
.
module_name
,
args
=
parse_kv
(
self
.
options
.
module_args
))),
]
)
def
run
(
self
):
def
run
(
self
):
''' use Runner lib to do SSH things '''
''' use Runner lib to do SSH things '''
...
@@ -117,13 +124,7 @@ class AdHocCLI(CLI):
...
@@ -117,13 +124,7 @@ class AdHocCLI(CLI):
# results = runner.run()
# results = runner.run()
# create a pseudo-play to execute the specified module via a single task
# create a pseudo-play to execute the specified module via a single task
play_ds
=
dict
(
play_ds
=
self
.
_play_ds
(
pattern
)
name
=
"Ansible Ad-Hoc"
,
hosts
=
pattern
,
gather_facts
=
'no'
,
tasks
=
[
dict
(
action
=
dict
(
module
=
self
.
options
.
module_name
,
args
=
parse_kv
(
self
.
options
.
module_args
))),
]
)
play
=
Play
()
.
load
(
play_ds
,
variable_manager
=
variable_manager
,
loader
=
loader
)
play
=
Play
()
.
load
(
play_ds
,
variable_manager
=
variable_manager
,
loader
=
loader
)
# now create a task queue manager to execute the play
# now create a task queue manager to execute the play
...
...
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