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
20b44927
Commit
20b44927
authored
Apr 03, 2015
by
Brian Coca
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
started implementing 'list options'
parent
2ade17e2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletions
+14
-1
v2/bin/ansible-playbook
+14
-1
No files found.
v2/bin/ansible-playbook
View file @
20b44927
...
@@ -58,11 +58,14 @@ def main(args):
...
@@ -58,11 +58,14 @@ def main(args):
validate_conflicts
(
parser
,
options
)
validate_conflicts
(
parser
,
options
)
# Note: slightly wrong, this is written so that implicit localhost
# Manage passwords
# Manage passwords
sshpass
=
None
sshpass
=
None
becomepass
=
None
becomepass
=
None
vault_pass
=
None
vault_pass
=
None
# don't deal with privilege escalation when we don't need to
if
not
options
.
listhosts
and
not
options
.
listtasks
and
not
options
.
listtags
:
normalize_become_options
(
options
)
normalize_become_options
(
options
)
(
sshpass
,
becomepass
,
vault_pass
)
=
ask_passwords
(
options
)
(
sshpass
,
becomepass
,
vault_pass
)
=
ask_passwords
(
options
)
...
@@ -109,7 +112,6 @@ def main(args):
...
@@ -109,7 +112,6 @@ def main(args):
inventory
=
Inventory
(
loader
=
loader
,
variable_manager
=
variable_manager
,
host_list
=
options
.
inventory
)
inventory
=
Inventory
(
loader
=
loader
,
variable_manager
=
variable_manager
,
host_list
=
options
.
inventory
)
variable_manager
.
set_inventory
(
inventory
)
variable_manager
.
set_inventory
(
inventory
)
# Note: slightly wrong, this is written so that implicit localhost
# (which is not returned in list_hosts()) is taken into account for
# (which is not returned in list_hosts()) is taken into account for
# warning if inventory is empty. But it can't be taken into account for
# warning if inventory is empty. But it can't be taken into account for
# checking if limit doesn't match any hosts. Instead we don't worry about
# checking if limit doesn't match any hosts. Instead we don't worry about
...
@@ -129,6 +131,17 @@ def main(args):
...
@@ -129,6 +131,17 @@ def main(args):
# create the playbook executor, which manages running the plays
# create the playbook executor, which manages running the plays
# via a task queue manager
# via a task queue manager
pbex
=
PlaybookExecutor
(
playbooks
=
args
,
inventory
=
inventory
,
variable_manager
=
variable_manager
,
loader
=
loader
,
options
=
options
)
pbex
=
PlaybookExecutor
(
playbooks
=
args
,
inventory
=
inventory
,
variable_manager
=
variable_manager
,
loader
=
loader
,
options
=
options
)
if
options
.
listhosts
:
print
(
'TODO: implement'
)
sys
.
exit
(
0
)
elif
options
.
listtasks
:
print
(
'TODO: implement'
)
sys
.
exit
(
0
)
elif
options
.
listtags
:
print
(
'TODO: implement'
)
sys
.
exit
(
0
)
else
:
return
pbex
.
run
()
return
pbex
.
run
()
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
...
...
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