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
6f938c9f
Commit
6f938c9f
authored
Nov 03, 2012
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'playbook_ssh_ask_pass' of
git://github.com/clatour/ansible
into devel
Conflicts: examples/ansible.cfg + doc tweak
parents
908c43ad
f436a8c8
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
5 deletions
+12
-5
bin/ansible
+1
-0
bin/ansible-playbook
+1
-0
examples/ansible.cfg
+7
-3
lib/ansible/constants.py
+1
-0
library/ini_file
+2
-2
No files found.
bin/ansible
View file @
6f938c9f
...
@@ -75,6 +75,7 @@ class Cli(object):
...
@@ -75,6 +75,7 @@ class Cli(object):
sshpass
=
None
sshpass
=
None
sudopass
=
None
sudopass
=
None
options
.
ask_pass
=
options
.
ask_pass
or
C
.
DEFAULT_ASK_PASS
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
options
.
ask_sudo_pass
=
options
.
ask_sudo_pass
or
C
.
DEFAULT_ASK_SUDO_PASS
...
...
bin/ansible-playbook
View file @
6f938c9f
...
@@ -70,6 +70,7 @@ def main(args):
...
@@ -70,6 +70,7 @@ def main(args):
sshpass
=
None
sshpass
=
None
sudopass
=
None
sudopass
=
None
if
not
options
.
listhosts
:
if
not
options
.
listhosts
:
options
.
ask_pass
=
options
.
ask_pass
or
C
.
DEFAULT_ASK_PASS
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
options
.
ask_sudo_pass
=
options
.
ask_sudo_pass
or
C
.
DEFAULT_ASK_SUDO_PASS
...
...
examples/ansible.cfg
View file @
6f938c9f
...
@@ -46,12 +46,16 @@ poll_interval=15
...
@@ -46,12 +46,16 @@ poll_interval=15
sudo_user=root
sudo_user=root
# to force ansible to always ask for the sudo password (instead of having
# the following forces ansible to always ask for the sudo password (instead of having
# to add -K to the commandline). Or you can use the environment
# to add -K to the commandline). Or you can use the environment variable (ANSIBLE_ASK_SUDO_PASS)
# variable (ANSIBLE_ASK_SUDO_PASS)
#ask_sudo_pass=True
#ask_sudo_pass=True
# the following forces ansible to always ask for the ssh-password (-k)
# can also be set by the environment variable ANSIBLE_ASK_PASS
#ask_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 @
6f938c9f
...
@@ -80,6 +80,7 @@ DEFAULT_MODULE_ARGS = get_config(p, DEFAULTS, 'module_args', 'ANSIBLE
...
@@ -80,6 +80,7 @@ DEFAULT_MODULE_ARGS = get_config(p, DEFAULTS, 'module_args', 'ANSIBLE
DEFAULT_TIMEOUT
=
get_config
(
p
,
DEFAULTS
,
'timeout'
,
'ANSIBLE_TIMEOUT'
,
10
)
DEFAULT_TIMEOUT
=
get_config
(
p
,
DEFAULTS
,
'timeout'
,
'ANSIBLE_TIMEOUT'
,
10
)
DEFAULT_POLL_INTERVAL
=
get_config
(
p
,
DEFAULTS
,
'poll_interval'
,
'ANSIBLE_POLL_INTERVAL'
,
15
)
DEFAULT_POLL_INTERVAL
=
get_config
(
p
,
DEFAULTS
,
'poll_interval'
,
'ANSIBLE_POLL_INTERVAL'
,
15
)
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_ASK_PASS
=
get_config
(
p
,
DEFAULTS
,
'ask_pass'
,
'ANSIBLE_ASK_PASS'
,
False
)
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_ASK_SUDO_PASS
=
get_config
(
p
,
DEFAULTS
,
'ask_sudo_pass'
,
'ANSIBLE_ASK_SUDO_PASS'
,
False
)
...
...
library/ini_file
View file @
6f938c9f
...
@@ -63,14 +63,14 @@ options:
...
@@ -63,14 +63,14 @@ options:
- all arguments accepted by the M(file) module also work here
- all arguments accepted by the M(file) module also work here
required: false
required: false
examples:
examples:
- code: "ini_file: dest=/etc/conf section=drinks option=fav value=lemonade mode=0600 backup=
true
"
- code: "ini_file: dest=/etc/conf section=drinks option=fav value=lemonade mode=0600 backup=
yes
"
description: Ensure C(fav=lemonade) is in section C([drinks]) in said file
description: Ensure C(fav=lemonade) is in section C([drinks]) in said file
- code: |
- code: |
ini_file: dest=/etc/anotherconf
ini_file: dest=/etc/anotherconf
section=drinks
section=drinks
option=temperature
option=temperature
value=cold
value=cold
backup=
true
backup=
yes
notes:
notes:
- While it is possible to add an I(option) without specifying a I(value), this makes
- While it is possible to add an I(option) without specifying a I(value), this makes
no sense.
no sense.
...
...
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