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
b769b418
Commit
b769b418
authored
Mar 03, 2014
by
jctanner
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6250 from dagwieers/gather_facts-once
Fix regression causing setup to run for every play
parents
1e01fb85
0da06eff
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
lib/ansible/playbook/__init__.py
+5
-2
lib/ansible/playbook/play.py
+1
-1
No files found.
lib/ansible/playbook/__init__.py
View file @
b769b418
...
@@ -475,10 +475,13 @@ class PlayBook(object):
...
@@ -475,10 +475,13 @@ class PlayBook(object):
def
_do_setup_step
(
self
,
play
):
def
_do_setup_step
(
self
,
play
):
''' get facts from the remote system '''
''' get facts from the remote system '''
host_list
=
self
.
_trim_unavailable_hosts
(
play
.
_play_hosts
)
if
play
.
gather_facts
is
False
:
if
play
.
gather_facts
is
False
:
return
{}
return
{}
elif
play
.
gather_facts
is
None
:
host_list
=
self
.
_trim_unavailable_hosts
(
play
.
_play_hosts
)
host_list
=
[
h
for
h
in
host_list
if
h
not
in
self
.
SETUP_CACHE
or
'module_setup'
not
in
self
.
SETUP_CACHE
[
h
]]
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 @
b769b418
...
@@ -117,7 +117,7 @@ class Play(object):
...
@@ -117,7 +117,7 @@ class Play(object):
self
.
sudo
=
ds
.
get
(
'sudo'
,
self
.
playbook
.
sudo
)
self
.
sudo
=
ds
.
get
(
'sudo'
,
self
.
playbook
.
sudo
)
self
.
sudo_user
=
ds
.
get
(
'sudo_user'
,
self
.
playbook
.
sudo_user
)
self
.
sudo_user
=
ds
.
get
(
'sudo_user'
,
self
.
playbook
.
sudo_user
)
self
.
transport
=
ds
.
get
(
'connection'
,
self
.
playbook
.
transport
)
self
.
transport
=
ds
.
get
(
'connection'
,
self
.
playbook
.
transport
)
self
.
gather_facts
=
ds
.
get
(
'gather_facts'
,
Tru
e
)
self
.
gather_facts
=
ds
.
get
(
'gather_facts'
,
Non
e
)
self
.
remote_port
=
self
.
remote_port
self
.
remote_port
=
self
.
remote_port
self
.
any_errors_fatal
=
utils
.
boolean
(
ds
.
get
(
'any_errors_fatal'
,
'false'
))
self
.
any_errors_fatal
=
utils
.
boolean
(
ds
.
get
(
'any_errors_fatal'
,
'false'
))
self
.
accelerate
=
utils
.
boolean
(
ds
.
get
(
'accelerate'
,
'false'
))
self
.
accelerate
=
utils
.
boolean
(
ds
.
get
(
'accelerate'
,
'false'
))
...
...
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