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
60d64251
Commit
60d64251
authored
Jul 14, 2012
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow gather_facts: False in a playbook as a way of disabling the fact step if you know
you aren't going to need it.
parent
3466ad5e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
20 deletions
+26
-20
CHANGELOG.md
+1
-0
lib/ansible/playbook/__init__.py
+6
-3
lib/ansible/playbook/play.py
+19
-17
No files found.
CHANGELOG.md
View file @
60d64251
...
...
@@ -25,6 +25,7 @@ Ansible Changes By Release
*
error reporting if with_items value is unbound
*
with_items no longer creates lots of tasks, creates one task that makes multiple calls
*
can use host_specific facts inside with_items (see above)
*
at the top level of a playbook, set 'gather_facts: False' to skip fact gathering
0.
5 "Amsterdam" ------- July 04, 2012
...
...
lib/ansible/playbook/__init__.py
View file @
60d64251
...
...
@@ -273,14 +273,17 @@ class PlayBook(object):
def
_do_setup_step
(
self
,
play
):
''' get facts from the remote system '''
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
play
.
gather_facts
:
return
{}
setup_args
=
{}
self
.
callbacks
.
on_setup
()
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
)
]
self
.
inventory
.
restrict_to
(
host_list
)
# push any variables down to the system
...
...
lib/ansible/playbook/play.py
View file @
60d64251
...
...
@@ -29,7 +29,7 @@ class Play(object):
'hosts'
,
'name'
,
'vars'
,
'vars_prompt'
,
'vars_files'
,
'handlers'
,
'remote_user'
,
'remote_port'
,
'sudo'
,
'sudo_user'
,
'transport'
,
'playbook'
,
'tags'
,
'_ds'
,
'_handlers'
,
'_tasks'
'tags'
,
'
gather_facts'
,
'
_ds'
,
'_handlers'
,
'_tasks'
]
# *************************************************
...
...
@@ -47,22 +47,24 @@ class Play(object):
hosts
=
';'
.
join
(
hosts
)
hosts
=
utils
.
template
(
hosts
,
playbook
.
extra_vars
,
{})
self
.
_ds
=
ds
self
.
playbook
=
playbook
self
.
hosts
=
hosts
self
.
name
=
ds
.
get
(
'name'
,
self
.
hosts
)
self
.
vars
=
ds
.
get
(
'vars'
,
{})
self
.
vars_files
=
ds
.
get
(
'vars_files'
,
[])
self
.
vars_prompt
=
ds
.
get
(
'vars_prompt'
,
{})
self
.
vars
=
self
.
_get_vars
(
self
.
playbook
.
basedir
)
self
.
_tasks
=
ds
.
get
(
'tasks'
,
[])
self
.
_handlers
=
ds
.
get
(
'handlers'
,
[])
self
.
remote_user
=
ds
.
get
(
'user'
,
self
.
playbook
.
remote_user
)
self
.
remote_port
=
ds
.
get
(
'port'
,
self
.
playbook
.
remote_port
)
self
.
sudo
=
ds
.
get
(
'sudo'
,
self
.
playbook
.
sudo
)
self
.
sudo_user
=
ds
.
get
(
'sudo_user'
,
self
.
playbook
.
sudo_user
)
self
.
transport
=
ds
.
get
(
'connection'
,
self
.
playbook
.
transport
)
self
.
tags
=
ds
.
get
(
'tags'
,
None
)
self
.
_ds
=
ds
self
.
playbook
=
playbook
self
.
hosts
=
hosts
self
.
name
=
ds
.
get
(
'name'
,
self
.
hosts
)
self
.
vars
=
ds
.
get
(
'vars'
,
{})
self
.
vars_files
=
ds
.
get
(
'vars_files'
,
[])
self
.
vars_prompt
=
ds
.
get
(
'vars_prompt'
,
{})
self
.
vars
=
self
.
_get_vars
(
self
.
playbook
.
basedir
)
self
.
_tasks
=
ds
.
get
(
'tasks'
,
[])
self
.
_handlers
=
ds
.
get
(
'handlers'
,
[])
self
.
remote_user
=
ds
.
get
(
'user'
,
self
.
playbook
.
remote_user
)
self
.
remote_port
=
ds
.
get
(
'port'
,
self
.
playbook
.
remote_port
)
self
.
sudo
=
ds
.
get
(
'sudo'
,
self
.
playbook
.
sudo
)
self
.
sudo_user
=
ds
.
get
(
'sudo_user'
,
self
.
playbook
.
sudo_user
)
self
.
transport
=
ds
.
get
(
'connection'
,
self
.
playbook
.
transport
)
self
.
tags
=
ds
.
get
(
'tags'
,
None
)
self
.
gather_facts
=
ds
.
get
(
'gather_facts'
,
True
)
print
"self.gather_facts:
%
s"
%
self
.
gather_facts
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