Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mitogen
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
mitogen
Commits
3ddbf1a5
Commit
3ddbf1a5
authored
Mar 02, 2018
by
David Wilson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ansible: basic support for ssh_args
parent
1b28252a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
1 deletion
+17
-1
ansible_mitogen/connection.py
ansible_mitogen/connection.py
+9
-0
docs/ansible.rst
docs/ansible.rst
+1
-0
examples/playbook/ansible.cfg
examples/playbook/ansible.cfg
+2
-0
mitogen/ssh.py
mitogen/ssh.py
+5
-1
No files found.
ansible_mitogen/connection.py
View file @
3ddbf1a5
...
@@ -135,6 +135,15 @@ class Connection(ansible.plugins.connection.ConnectionBase):
...
@@ -135,6 +135,15 @@ class Connection(ansible.plugins.connection.ConnectionBase):
'identity_file'
:
self
.
_play_context
.
private_key_file
,
'identity_file'
:
self
.
_play_context
.
private_key_file
,
'ssh_path'
:
self
.
_play_context
.
ssh_executable
,
'ssh_path'
:
self
.
_play_context
.
ssh_executable
,
'connect_timeout'
:
self
.
connect_timeout
,
'connect_timeout'
:
self
.
connect_timeout
,
'ssh_args'
:
[
term
for
s
in
(
getattr
(
self
.
_play_context
,
'ssh_args'
,
''
),
getattr
(
self
.
_play_context
,
'ssh_common_args'
,
''
),
getattr
(
self
.
_play_context
,
'ssh_extra_args'
,
''
)
)
for
term
in
shlex
.
split
(
s
or
''
)
]
})
})
)
)
...
...
docs/ansible.rst
View file @
3ddbf1a5
...
@@ -202,6 +202,7 @@ This list will grow as more missing pieces are discovered.
...
@@ -202,6 +202,7 @@ This list will grow as more missing pieces are discovered.
* ansible_ssh_executable, ssh_executable
* ansible_ssh_executable, ssh_executable
* ansible_ssh_private_key_file
* ansible_ssh_private_key_file
* ansible_ssh_pass, ansible_password (default: assume passwordless)
* ansible_ssh_pass, ansible_password (default: assume passwordless)
* ssh_args, ssh_common_args, ssh_extra_args
Sudo Variables
Sudo Variables
...
...
examples/playbook/ansible.cfg
View file @
3ddbf1a5
[defaults]
[defaults]
sudo_flags = -HE
inventory = hosts
inventory = hosts
strategy_plugins = ../../ansible_mitogen/plugins/strategy
strategy_plugins = ../../ansible_mitogen/plugins/strategy
library = modules
library = modules
retry_files_enabled = False
retry_files_enabled = False
[ssh_connection]
[ssh_connection]
ssh_args = -o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s
pipelining = True
pipelining = True
mitogen/ssh.py
View file @
3ddbf1a5
...
@@ -60,7 +60,7 @@ class Stream(mitogen.parent.Stream):
...
@@ -60,7 +60,7 @@ class Stream(mitogen.parent.Stream):
def
construct
(
self
,
hostname
,
username
=
None
,
ssh_path
=
None
,
port
=
None
,
def
construct
(
self
,
hostname
,
username
=
None
,
ssh_path
=
None
,
port
=
None
,
check_host_keys
=
True
,
password
=
None
,
identity_file
=
None
,
check_host_keys
=
True
,
password
=
None
,
identity_file
=
None
,
compression_level
=
6
,
**
kwargs
):
compression_level
=
6
,
ssh_args
=
None
,
**
kwargs
):
super
(
Stream
,
self
).
construct
(
**
kwargs
)
super
(
Stream
,
self
).
construct
(
**
kwargs
)
self
.
hostname
=
hostname
self
.
hostname
=
hostname
self
.
username
=
username
self
.
username
=
username
...
@@ -71,6 +71,8 @@ class Stream(mitogen.parent.Stream):
...
@@ -71,6 +71,8 @@ class Stream(mitogen.parent.Stream):
self
.
compression_level
=
compression_level
self
.
compression_level
=
compression_level
if
ssh_path
:
if
ssh_path
:
self
.
ssh_path
=
ssh_path
self
.
ssh_path
=
ssh_path
if
ssh_args
:
self
.
ssh_args
=
ssh_args
def
get_boot_command
(
self
):
def
get_boot_command
(
self
):
bits
=
[
self
.
ssh_path
]
bits
=
[
self
.
ssh_path
]
...
@@ -94,6 +96,8 @@ class Stream(mitogen.parent.Stream):
...
@@ -94,6 +96,8 @@ class Stream(mitogen.parent.Stream):
'-o'
,
'StrictHostKeyChecking no'
,
'-o'
,
'StrictHostKeyChecking no'
,
'-o'
,
'UserKnownHostsFile /dev/null'
,
'-o'
,
'UserKnownHostsFile /dev/null'
,
]
]
if
self
.
ssh_args
:
bits
+=
self
.
ssh_args
bits
.
append
(
self
.
hostname
)
bits
.
append
(
self
.
hostname
)
base
=
super
(
Stream
,
self
).
get_boot_command
()
base
=
super
(
Stream
,
self
).
get_boot_command
()
return
bits
+
[
commands
.
mkarg
(
s
).
strip
()
for
s
in
base
]
return
bits
+
[
commands
.
mkarg
(
s
).
strip
()
for
s
in
base
]
...
...
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