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
4dfa40f1
Commit
4dfa40f1
authored
Mar 15, 2014
by
Brian Coca
Committed by
Michael DeHaan
Mar 19, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added gathering control to ansible, defaults to 'smart'
parent
a8514dac
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
4 deletions
+14
-4
examples/ansible.cfg
+5
-0
lib/ansible/constants.py
+1
-0
lib/ansible/playbook/__init__.py
+7
-3
lib/ansible/playbook/play.py
+1
-1
No files found.
examples/ansible.cfg
View file @
4dfa40f1
...
...
@@ -24,6 +24,11 @@ transport = smart
remote_port = 22
module_lang = C
# controls implicit fact gathering (always, never or smart).
# smart gathers only if not currently in memory.
# does NOT affect explicit 'gather_facts' entries.
gathering = smart
# additional paths to search for roles in, colon separated
#roles_path = /etc/ansible/roles
...
...
lib/ansible/constants.py
View file @
4dfa40f1
...
...
@@ -134,6 +134,7 @@ DEFAULT_SU = get_config(p, DEFAULTS, 'su', 'ANSIBLE_SU', False, boolean=True)
DEFAULT_SU_FLAGS
=
get_config
(
p
,
DEFAULTS
,
'su_flags'
,
'ANSIBLE_SU_FLAGS'
,
''
)
DEFAULT_SU_USER
=
get_config
(
p
,
DEFAULTS
,
'su_user'
,
'ANSIBLE_SU_USER'
,
'root'
)
DEFAULT_ASK_SU_PASS
=
get_config
(
p
,
DEFAULTS
,
'ask_su_pass'
,
'ANSIBLE_ASK_SU_PASS'
,
False
,
boolean
=
True
)
DEFAULT_GATHERING
=
get_config
(
p
,
DEFAULTS
,
'gathering'
,
'ANSIBLE_GATHERING'
,
'smart'
)
.
lower
()
DEFAULT_ACTION_PLUGIN_PATH
=
get_config
(
p
,
DEFAULTS
,
'action_plugins'
,
'ANSIBLE_ACTION_PLUGINS'
,
'/usr/share/ansible_plugins/action_plugins'
)
DEFAULT_CALLBACK_PLUGIN_PATH
=
get_config
(
p
,
DEFAULTS
,
'callback_plugins'
,
'ANSIBLE_CALLBACK_PLUGINS'
,
'/usr/share/ansible_plugins/callback_plugins'
)
...
...
lib/ansible/playbook/__init__.py
View file @
4dfa40f1
...
...
@@ -479,11 +479,15 @@ class PlayBook(object):
def
_do_setup_step
(
self
,
play
):
''' get facts from the remote system '''
if
play
.
gather_facts
is
False
:
return
{}
host_list
=
self
.
_trim_unavailable_hosts
(
play
.
_play_hosts
)
if
play
.
gather_facts
is
None
and
C
.
DEFAULT_GATHERING
==
'smart'
:
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
{}
elif
play
.
gather_facts
is
False
or
(
play
.
gather_facts
is
None
and
C
.
DEFAULT_GATHERING
==
'never'
):
return
{}
self
.
callbacks
.
on_setup
()
self
.
inventory
.
restrict_to
(
host_list
)
...
...
lib/ansible/playbook/play.py
View file @
4dfa40f1
...
...
@@ -117,7 +117,7 @@ class Play(object):
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
.
gather_facts
=
ds
.
get
(
'gather_facts'
,
Tru
e
)
self
.
gather_facts
=
ds
.
get
(
'gather_facts'
,
Non
e
)
self
.
remote_port
=
self
.
remote_port
self
.
any_errors_fatal
=
utils
.
boolean
(
ds
.
get
(
'any_errors_fatal'
,
'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