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
e564de39
Commit
e564de39
authored
Feb 09, 2013
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some formatting preferences for --list-hosts and --list-tasks
parent
e2317082
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
bin/ansible-playbook
+5
-2
No files found.
bin/ansible-playbook
View file @
e564de39
...
...
@@ -136,7 +136,9 @@ def main(args):
)
if
options
.
listhosts
or
options
.
listtasks
:
print
''
print
'playbook:
%
s'
%
playbook
print
''
playnum
=
0
for
(
play_ds
,
play_basedir
)
in
zip
(
pb
.
playbook
,
pb
.
play_basedirs
):
playnum
+=
1
...
...
@@ -144,7 +146,7 @@ def main(args):
label
=
play
.
name
if
options
.
listhosts
:
hosts
=
pb
.
inventory
.
list_hosts
(
play
.
hosts
)
print
'
hosts in play
%
s (
%
s): #
%
d'
%
(
playnum
,
label
,
len
(
hosts
))
print
'
play #
%
d (
%
s): host count=
%
d'
%
(
playnum
,
label
,
len
(
hosts
))
for
host
in
hosts
:
print
'
%
s'
%
host
if
options
.
listtasks
:
...
...
@@ -156,10 +158,11 @@ def main(args):
unknown
=
','
.
join
(
sorted
(
unknown_tags
))
unmatched
=
','
.
join
(
sorted
(
unmatched_tags
))
raise
errors
.
AnsibleError
(
msg
%
(
unknown
,
unmatched
))
print
'
tasks in play
%
s (
%
s): #
%
d'
%
(
playnum
,
label
,
len
(
play
.
tasks
()))
print
'
play #
%
d (
%
s): task count=
%
d'
%
(
playnum
,
label
,
len
(
play
.
tasks
()))
for
task
in
play
.
tasks
():
if
set
(
task
.
tags
)
.
intersection
(
pb
.
only_tags
):
print
'
%
s'
%
task
.
name
print
''
continue
if
options
.
syntax
:
...
...
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