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
564a212b
Commit
564a212b
authored
Sep 28, 2012
by
Daniel Hokka Zakrisson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only gather facts once per node per playbook run
Unless gather_facts: True is on the play
parent
56d45074
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
lib/ansible/playbook/__init__.py
+5
-1
lib/ansible/playbook/play.py
+1
-1
No files found.
lib/ansible/playbook/__init__.py
View file @
564a212b
...
@@ -314,8 +314,12 @@ class PlayBook(object):
...
@@ -314,8 +314,12 @@ class PlayBook(object):
host_list
=
[
h
for
h
in
self
.
inventory
.
list_hosts
(
play
.
hosts
)
host_list
=
[
h
for
h
in
self
.
inventory
.
list_hosts
(
play
.
hosts
)
if
not
(
h
in
self
.
stats
.
failures
or
h
in
self
.
stats
.
dark
)
]
if
not
(
h
in
self
.
stats
.
failures
or
h
in
self
.
stats
.
dark
)
]
if
not
play
.
gather_facts
:
if
play
.
gather_facts
is
False
:
return
{}
return
{}
elif
play
.
gather_facts
is
None
:
host_list
=
[
h
for
h
in
host_list
if
h
not
in
self
.
SETUP_CACHE
]
if
len
(
host_list
)
==
0
:
return
{}
self
.
callbacks
.
on_setup
()
self
.
callbacks
.
on_setup
()
self
.
inventory
.
restrict_to
(
host_list
)
self
.
inventory
.
restrict_to
(
host_list
)
...
...
lib/ansible/playbook/play.py
View file @
564a212b
...
@@ -75,7 +75,7 @@ class Play(object):
...
@@ -75,7 +75,7 @@ class Play(object):
self
.
sudo_user
=
utils
.
template
(
basedir
,
ds
.
get
(
'sudo_user'
,
self
.
playbook
.
sudo_user
),
playbook
.
extra_vars
)
self
.
sudo_user
=
utils
.
template
(
basedir
,
ds
.
get
(
'sudo_user'
,
self
.
playbook
.
sudo_user
),
playbook
.
extra_vars
)
self
.
transport
=
ds
.
get
(
'connection'
,
self
.
playbook
.
transport
)
self
.
transport
=
ds
.
get
(
'connection'
,
self
.
playbook
.
transport
)
self
.
tags
=
ds
.
get
(
'tags'
,
None
)
self
.
tags
=
ds
.
get
(
'tags'
,
None
)
self
.
gather_facts
=
ds
.
get
(
'gather_facts'
,
Tru
e
)
self
.
gather_facts
=
ds
.
get
(
'gather_facts'
,
Non
e
)
self
.
serial
=
ds
.
get
(
'serial'
,
0
)
self
.
serial
=
ds
.
get
(
'serial'
,
0
)
self
.
_update_vars_files_for_host
(
None
)
self
.
_update_vars_files_for_host
(
None
)
...
...
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