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
05de2152
Commit
05de2152
authored
Nov 03, 2012
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'sudo_ask_pass_config' of
git://github.com/bcoca/ansible
into devel
parents
154a00e6
8d1ed566
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
1 deletions
+10
-1
bin/ansible
+1
-0
bin/ansible-playbook
+1
-0
examples/ansible.cfg
+6
-0
lib/ansible/constants.py
+2
-1
No files found.
bin/ansible
View file @
05de2152
...
@@ -77,6 +77,7 @@ class Cli(object):
...
@@ -77,6 +77,7 @@ class Cli(object):
sudopass
=
None
sudopass
=
None
if
options
.
ask_pass
:
if
options
.
ask_pass
:
sshpass
=
getpass
.
getpass
(
prompt
=
"SSH password: "
)
sshpass
=
getpass
.
getpass
(
prompt
=
"SSH password: "
)
options
.
ask_sudo_pass
=
options
.
ask_sudo_pass
or
C
.
DEFAULT_ASK_SUDO_PASS
if
options
.
ask_sudo_pass
:
if
options
.
ask_sudo_pass
:
sudopass
=
getpass
.
getpass
(
prompt
=
"sudo password: "
)
sudopass
=
getpass
.
getpass
(
prompt
=
"sudo password: "
)
options
.
sudo
=
True
options
.
sudo
=
True
...
...
bin/ansible-playbook
View file @
05de2152
...
@@ -72,6 +72,7 @@ def main(args):
...
@@ -72,6 +72,7 @@ def main(args):
if
not
options
.
listhosts
:
if
not
options
.
listhosts
:
if
options
.
ask_pass
:
if
options
.
ask_pass
:
sshpass
=
getpass
.
getpass
(
prompt
=
"SSH password: "
)
sshpass
=
getpass
.
getpass
(
prompt
=
"SSH password: "
)
options
.
ask_sudo_pass
=
options
.
ask_sudo_pass
or
C
.
DEFAULT_ASK_SUDO_PASS
if
options
.
ask_sudo_pass
:
if
options
.
ask_sudo_pass
:
sudopass
=
getpass
.
getpass
(
prompt
=
"sudo password: "
)
sudopass
=
getpass
.
getpass
(
prompt
=
"sudo password: "
)
options
.
sudo
=
True
options
.
sudo
=
True
...
...
examples/ansible.cfg
View file @
05de2152
...
@@ -46,6 +46,12 @@ poll_interval=15
...
@@ -46,6 +46,12 @@ poll_interval=15
sudo_user=root
sudo_user=root
# to force ansible to always ask for the sudo password (instead of having
# to add -K to the commandline). Or you can use the environment
# variable (ANSIBLE_ASK_SUDO_PASS)
#ask_sudo_pass=True
# connection to use when -c <connection_type> is not specified
# connection to use when -c <connection_type> is not specified
transport=paramiko
transport=paramiko
...
...
lib/ansible/constants.py
View file @
05de2152
...
@@ -78,6 +78,7 @@ DEFAULT_POLL_INTERVAL = get_config(p, DEFAULTS, 'poll_interval', 'ANSIBLE
...
@@ -78,6 +78,7 @@ DEFAULT_POLL_INTERVAL = get_config(p, DEFAULTS, 'poll_interval', 'ANSIBLE
DEFAULT_REMOTE_USER
=
get_config
(
p
,
DEFAULTS
,
'remote_user'
,
'ANSIBLE_REMOTE_USER'
,
active_user
)
DEFAULT_REMOTE_USER
=
get_config
(
p
,
DEFAULTS
,
'remote_user'
,
'ANSIBLE_REMOTE_USER'
,
active_user
)
DEFAULT_PRIVATE_KEY_FILE
=
shell_expand_path
(
get_config
(
p
,
DEFAULTS
,
'private_key_file'
,
'ANSIBLE_PRIVATE_KEY_FILE'
,
None
))
DEFAULT_PRIVATE_KEY_FILE
=
shell_expand_path
(
get_config
(
p
,
DEFAULTS
,
'private_key_file'
,
'ANSIBLE_PRIVATE_KEY_FILE'
,
None
))
DEFAULT_SUDO_USER
=
get_config
(
p
,
DEFAULTS
,
'sudo_user'
,
'ANSIBLE_SUDO_USER'
,
'root'
)
DEFAULT_SUDO_USER
=
get_config
(
p
,
DEFAULTS
,
'sudo_user'
,
'ANSIBLE_SUDO_USER'
,
'root'
)
DEFAULT_ASK_SUDO_PASS
=
get_config
(
p
,
DEFAULTS
,
'ask_sudo_pass'
,
'ANSIBLE_ASK_SUDO_PASS'
,
False
)
DEFAULT_REMOTE_PORT
=
int
(
get_config
(
p
,
DEFAULTS
,
'remote_port'
,
'ANSIBLE_REMOTE_PORT'
,
22
))
DEFAULT_REMOTE_PORT
=
int
(
get_config
(
p
,
DEFAULTS
,
'remote_port'
,
'ANSIBLE_REMOTE_PORT'
,
22
))
DEFAULT_TRANSPORT
=
get_config
(
p
,
DEFAULTS
,
'transport'
,
'ANSIBLE_TRANSPORT'
,
'paramiko'
)
DEFAULT_TRANSPORT
=
get_config
(
p
,
DEFAULTS
,
'transport'
,
'ANSIBLE_TRANSPORT'
,
'paramiko'
)
DEFAULT_MANAGED_STR
=
get_config
(
p
,
DEFAULTS
,
'ansible_managed'
,
None
,
'Ansible managed: {file} modified on
%
Y-
%
m-
%
d
%
H:
%
M:
%
S by {uid} on {host}'
)
DEFAULT_MANAGED_STR
=
get_config
(
p
,
DEFAULTS
,
'ansible_managed'
,
None
,
'Ansible managed: {file} modified on
%
Y-
%
m-
%
d
%
H:
%
M:
%
S by {uid} on {host}'
)
...
@@ -89,8 +90,8 @@ DEFAULT_LOOKUP_PLUGIN_PATH = shell_expand_path(get_config(p, DEFAULTS, 'look
...
@@ -89,8 +90,8 @@ DEFAULT_LOOKUP_PLUGIN_PATH = shell_expand_path(get_config(p, DEFAULTS, 'look
DEFAULT_VARS_PLUGIN_PATH
=
shell_expand_path
(
get_config
(
p
,
DEFAULTS
,
'vars_plugins'
,
None
,
'/usr/share/ansible_plugins/vars_plugins'
))
DEFAULT_VARS_PLUGIN_PATH
=
shell_expand_path
(
get_config
(
p
,
DEFAULTS
,
'vars_plugins'
,
None
,
'/usr/share/ansible_plugins/vars_plugins'
))
# non-configurable things
# non-configurable things
DEFAULT_REMOTE_PASS
=
None
DEFAULT_SUDO_PASS
=
None
DEFAULT_SUDO_PASS
=
None
DEFAULT_REMOTE_PASS
=
None
DEFAULT_SUBSET
=
None
DEFAULT_SUBSET
=
None
ANSIBLE_SSH_ARGS
=
get_config
(
p
,
'ssh_connection'
,
'ssh_args'
,
'ANSIBLE_SSH_ARGS'
,
None
)
ANSIBLE_SSH_ARGS
=
get_config
(
p
,
'ssh_connection'
,
'ssh_args'
,
'ANSIBLE_SSH_ARGS'
,
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