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
65178290
Commit
65178290
authored
Oct 07, 2013
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'devel' of
git://github.com/nextus/ansible
into devel
Conflicts: lib/ansible/constants.py
parents
ef4ec735
ca96d745
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
9 deletions
+16
-9
examples/ansible.cfg
+4
-1
lib/ansible/constants.py
+6
-3
lib/ansible/runner/connection_plugins/paramiko_ssh.py
+6
-5
No files found.
examples/ansible.cfg
View file @
65178290
...
...
@@ -104,9 +104,12 @@ filter_plugins = /usr/share/ansible_plugins/filter_plugins
# uncomment this line to cause the paramiko connection plugin to not record new host
# keys encountered. Increases performance on new host additions. Setting works independently of the
# host key checking setting above.
#record_host_keys=False
# by default, Ansible requests a pseudo-terminal for commands executed under sudo. Uncomment this
# line to disable this behaviour.
#pty=False
[ssh_connection]
# ssh arguments to use
...
...
lib/ansible/constants.py
View file @
65178290
...
...
@@ -30,13 +30,15 @@ def mk_boolean(value):
else
:
return
False
def
get_config
(
p
,
section
,
key
,
env_var
,
default
,
boolean
=
False
,
integer
=
False
):
def
get_config
(
p
,
section
,
key
,
env_var
,
default
,
boolean
=
False
,
integer
=
False
,
floating
=
False
):
''' return a configuration variable with casting '''
value
=
_get_config
(
p
,
section
,
key
,
env_var
,
default
)
if
boolean
:
return
mk_boolean
(
value
)
if
integer
:
return
int
(
value
)
if
floating
:
return
float
(
value
)
return
value
def
_get_config
(
p
,
section
,
key
,
env_var
,
default
,
boolean
=
True
):
...
...
@@ -136,8 +138,9 @@ ANSIBLE_SSH_CONTROL_PATH = get_config(p, 'ssh_connection', 'control_path',
PARAMIKO_RECORD_HOST_KEYS
=
get_config
(
p
,
'paramiko_connection'
,
'record_host_keys'
,
'ANSIBLE_PARAMIKO_RECORD_HOST_KEYS'
,
True
,
boolean
=
True
)
ZEROMQ_PORT
=
get_config
(
p
,
'fireball_connection'
,
'zeromq_port'
,
'ANSIBLE_ZEROMQ_PORT'
,
5099
,
integer
=
True
)
ACCELERATE_PORT
=
get_config
(
p
,
'accelerate'
,
'accelerate_port'
,
'ACCELERATE_PORT'
,
5099
,
integer
=
True
)
ACCELERATE_TIMEOUT
=
int
(
get_config
(
p
,
'accelerate'
,
'accelerate_timeout'
,
'ACCELERATE_TIMEOUT'
,
30
))
ACCELERATE_CONNECT_TIMEOUT
=
float
(
get_config
(
p
,
'accelerate'
,
'accelerate_connect_timeout'
,
'ACCELERATE_CONNECT_TIMEOUT'
,
1.0
))
ACCELERATE_TIMEOUT
=
get_config
(
p
,
'accelerate'
,
'accelerate_timeout'
,
'ACCELERATE_TIMEOUT'
,
30
,
integer
=
True
)
ACCELERATE_CONNECT_TIMEOUT
=
get_config
(
p
,
'accelerate'
,
'accelerate_connect_timeout'
,
'ACCELERATE_CONNECT_TIMEOUT'
,
1.0
,
floating
=
True
)
PARAMIKO_PTY
=
get_config
(
p
,
'paramiko_connection'
,
'pty'
,
'ANSIBLE_PARAMIKO_PTY'
,
True
,
boolean
=
True
)
DEFAULT_UNDEFINED_VAR_BEHAVIOR
=
get_config
(
p
,
DEFAULTS
,
'error_on_undefined_vars'
,
'ANSIBLE_ERROR_ON_UNDEFINED_VARS'
,
True
,
boolean
=
True
)
HOST_KEY_CHECKING
=
get_config
(
p
,
DEFAULTS
,
'host_key_checking'
,
'ANSIBLE_HOST_KEY_CHECKING'
,
True
,
boolean
=
True
)
...
...
lib/ansible/runner/connection_plugins/paramiko_ssh.py
View file @
65178290
...
...
@@ -196,11 +196,12 @@ class Connection(object):
chan
.
exec_command
(
quoted_command
)
else
:
# sudo usually requires a PTY (cf. requiretty option), therefore
# we give it one, and we try to initialise from the calling
# environment
chan
.
get_pty
(
term
=
os
.
getenv
(
'TERM'
,
'vt100'
),
width
=
int
(
os
.
getenv
(
'COLUMNS'
,
0
)),
height
=
int
(
os
.
getenv
(
'LINES'
,
0
)))
# we give it one by default (pty=True in ansble.cfg), and we try
# to initialise from the calling environment
if
C
.
PARAMIKO_PTY
:
chan
.
get_pty
(
term
=
os
.
getenv
(
'TERM'
,
'vt100'
),
width
=
int
(
os
.
getenv
(
'COLUMNS'
,
0
)),
height
=
int
(
os
.
getenv
(
'LINES'
,
0
)))
shcmd
,
prompt
=
utils
.
make_sudo_cmd
(
sudo_user
,
executable
,
cmd
)
vvv
(
"EXEC
%
s"
%
shcmd
,
host
=
self
.
host
)
sudo_output
=
''
...
...
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