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
deec50fc
Commit
deec50fc
authored
Aug 11, 2012
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Default -u (user) and "user:" in playbooks to the current user.
parent
3587ffde
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletions
+8
-1
lib/ansible/constants.py
+6
-1
lib/ansible/runner/connection/ssh.py
+2
-0
No files found.
lib/ansible/constants.py
View file @
deec50fc
...
...
@@ -16,6 +16,7 @@
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
import
os
import
pwd
DEFAULT_HOST_LIST
=
os
.
environ
.
get
(
'ANSIBLE_HOSTS'
,
'/etc/ansible/hosts'
)
DEFAULT_MODULE_PATH
=
os
.
environ
.
get
(
'ANSIBLE_LIBRARY'
,
'/usr/share/ansible'
)
...
...
@@ -27,7 +28,11 @@ DEFAULT_FORKS = os.environ.get('ANSIBLE_FORKS',5)
DEFAULT_MODULE_ARGS
=
os
.
environ
.
get
(
'ANSIBLE_MODULE_ARGS'
,
''
)
DEFAULT_TIMEOUT
=
os
.
environ
.
get
(
'ANSIBLE_TIMEOUT'
,
10
)
DEFAULT_POLL_INTERVAL
=
os
.
environ
.
get
(
'ANSIBLE_POLL_INTERVAL'
,
15
)
DEFAULT_REMOTE_USER
=
os
.
environ
.
get
(
'ANSIBLE_REMOTE_USER'
,
'root'
)
DEFAULT_REMOTE_USER
=
os
.
environ
.
get
(
'ANSIBLE_REMOTE_USER'
,
None
)
if
DEFAULT_REMOTE_USER
is
None
:
DEFAULT_REMOTE_USER
=
pwd
.
getpwuid
(
os
.
geteuid
())[
0
]
DEFAULT_REMOTE_PASS
=
None
DEFAULT_PRIVATE_KEY_FILE
=
os
.
environ
.
get
(
'ANSIBLE_PRIVATE_KEY_FILE'
,
None
)
DEFAULT_SUDO_PASS
=
None
...
...
lib/ansible/runner/connection/ssh.py
View file @
deec50fc
...
...
@@ -37,6 +37,8 @@ class SSHConnection(object):
def
connect
(
self
):
''' connect to the remote host '''
vvv
(
"ESTABLISH CONNECTION FOR USER:
%
s"
%
self
.
runner
.
remote_user
,
host
=
self
.
host
)
self
.
common_args
=
[]
extra_args
=
os
.
getenv
(
"ANSIBLE_SSH_ARGS"
,
None
)
if
extra_args
is
not
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