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
550bf476
Commit
550bf476
authored
Apr 05, 2013
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2565 from willthames/default_exec
Added DEFAULT_EXECUTABLE as a constant
parents
0440c48f
c4442ad8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
1 deletions
+9
-1
examples/ansible.cfg
+7
-0
lib/ansible/constants.py
+1
-0
lib/ansible/runner/__init__.py
+1
-1
No files found.
examples/ansible.cfg
View file @
550bf476
...
@@ -79,6 +79,13 @@ sudo_exe=sudo
...
@@ -79,6 +79,13 @@ sudo_exe=sudo
# the default flags passed to sudo
# the default flags passed to sudo
# sudo_flags=-H
# sudo_flags=-H
# all commands executed under sudo are passed as arguments to a shell command
# This shell command defaults to /bin/sh
# Changing this helps the situation where a user is only allowed to run
# e.g. /bin/bash with sudo privileges
# executable = /bin/sh
# how to handle hash defined in several places
# how to handle hash defined in several places
# hash can be merged, or replaced
# hash can be merged, or replaced
# if you use replace, and have multiple hashes named 'x', the last defined
# if you use replace, and have multiple hashes named 'x', the last defined
...
...
lib/ansible/constants.py
View file @
550bf476
...
@@ -95,6 +95,7 @@ DEFAULT_SUDO_EXE = get_config(p, DEFAULTS, 'sudo_exe', 'ANSIBLE_SUDO_EX
...
@@ -95,6 +95,7 @@ DEFAULT_SUDO_EXE = get_config(p, DEFAULTS, 'sudo_exe', 'ANSIBLE_SUDO_EX
DEFAULT_SUDO_FLAGS
=
get_config
(
p
,
DEFAULTS
,
'sudo_flags'
,
'ANSIBLE_SUDO_FLAGS'
,
'-H'
)
DEFAULT_SUDO_FLAGS
=
get_config
(
p
,
DEFAULTS
,
'sudo_flags'
,
'ANSIBLE_SUDO_FLAGS'
,
'-H'
)
DEFAULT_HASH_BEHAVIOUR
=
get_config
(
p
,
DEFAULTS
,
'hash_behaviour'
,
'ANSIBLE_HASH_BEHAVIOUR'
,
'replace'
)
DEFAULT_HASH_BEHAVIOUR
=
get_config
(
p
,
DEFAULTS
,
'hash_behaviour'
,
'ANSIBLE_HASH_BEHAVIOUR'
,
'replace'
)
DEFAULT_JINJA2_EXTENSIONS
=
get_config
(
p
,
DEFAULTS
,
'jinja2_extensions'
,
'ANSIBLE_JINJA2_EXTENSIONS'
,
None
)
DEFAULT_JINJA2_EXTENSIONS
=
get_config
(
p
,
DEFAULTS
,
'jinja2_extensions'
,
'ANSIBLE_JINJA2_EXTENSIONS'
,
None
)
DEFAULT_EXECUTABLE
=
get_config
(
p
,
DEFAULTS
,
'executable'
,
'ANSIBLE_EXECUTABLE'
,
'/bin/sh'
)
DEFAULT_ACTION_PLUGIN_PATH
=
shell_expand_path
(
get_config
(
p
,
DEFAULTS
,
'action_plugins'
,
'ANSIBLE_ACTION_PLUGINS'
,
'/usr/share/ansible_plugins/action_plugins'
))
DEFAULT_ACTION_PLUGIN_PATH
=
shell_expand_path
(
get_config
(
p
,
DEFAULTS
,
'action_plugins'
,
'ANSIBLE_ACTION_PLUGINS'
,
'/usr/share/ansible_plugins/action_plugins'
))
DEFAULT_CALLBACK_PLUGIN_PATH
=
shell_expand_path
(
get_config
(
p
,
DEFAULTS
,
'callback_plugins'
,
'ANSIBLE_CALLBACK_PLUGINS'
,
'/usr/share/ansible_plugins/callback_plugins'
))
DEFAULT_CALLBACK_PLUGIN_PATH
=
shell_expand_path
(
get_config
(
p
,
DEFAULTS
,
'callback_plugins'
,
'ANSIBLE_CALLBACK_PLUGINS'
,
'/usr/share/ansible_plugins/callback_plugins'
))
...
...
lib/ansible/runner/__init__.py
View file @
550bf476
...
@@ -527,7 +527,7 @@ class Runner(object):
...
@@ -527,7 +527,7 @@ class Runner(object):
''' execute a command string over SSH, return the output '''
''' execute a command string over SSH, return the output '''
if
executable
is
None
:
if
executable
is
None
:
executable
=
'/bin/sh'
executable
=
C
.
DEFAULT_EXECUTABLE
sudo_user
=
self
.
sudo_user
sudo_user
=
self
.
sudo_user
rc
,
stdin
,
stdout
,
stderr
=
conn
.
exec_command
(
cmd
,
tmp
,
sudo_user
,
sudoable
=
sudoable
,
executable
=
executable
)
rc
,
stdin
,
stdout
,
stderr
=
conn
.
exec_command
(
cmd
,
tmp
,
sudo_user
,
sudoable
=
sudoable
,
executable
=
executable
)
...
...
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