mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-31 17:11:23 -07:00
Renaming fireball2 as 'accelerate' and removing old references
This commit is contained in:
parent
7d3ae9fc75
commit
d69d5c294f
3 changed files with 20 additions and 21 deletions
|
@ -139,8 +139,8 @@ class Runner(object):
|
||||||
environment=None, # environment variables (as dict) to use inside the command
|
environment=None, # environment variables (as dict) to use inside the command
|
||||||
complex_args=None, # structured data in addition to module_args, must be a dict
|
complex_args=None, # structured data in addition to module_args, must be a dict
|
||||||
error_on_undefined_vars=C.DEFAULT_UNDEFINED_VAR_BEHAVIOR, # ex. False
|
error_on_undefined_vars=C.DEFAULT_UNDEFINED_VAR_BEHAVIOR, # ex. False
|
||||||
accelerate=False, # use fireball acceleration
|
accelerate=False, # use accelerated connection
|
||||||
accelerate_port=None, # port to use with fireball acceleration
|
accelerate_port=None, # port to use with accelerated connection
|
||||||
):
|
):
|
||||||
|
|
||||||
# used to lock multiprocess inputs and outputs at various levels
|
# used to lock multiprocess inputs and outputs at various levels
|
||||||
|
@ -187,8 +187,8 @@ class Runner(object):
|
||||||
|
|
||||||
if self.accelerate:
|
if self.accelerate:
|
||||||
# if we're using accelerated mode, force the local
|
# if we're using accelerated mode, force the local
|
||||||
# transport to fireball2
|
# transport to accelerate
|
||||||
self.transport = "fireball2"
|
self.transport = "accelerate"
|
||||||
if not self.accelerate_port:
|
if not self.accelerate_port:
|
||||||
self.accelerate_port = C.ACCELERATE_PORT
|
self.accelerate_port = C.ACCELERATE_PORT
|
||||||
elif self.transport == 'smart':
|
elif self.transport == 'smart':
|
||||||
|
@ -406,7 +406,7 @@ class Runner(object):
|
||||||
|
|
||||||
host_variables = self.inventory.get_variables(host)
|
host_variables = self.inventory.get_variables(host)
|
||||||
host_connection = host_variables.get('ansible_connection', self.transport)
|
host_connection = host_variables.get('ansible_connection', self.transport)
|
||||||
if host_connection in [ 'paramiko', 'ssh', 'fireball2' ]:
|
if host_connection in [ 'paramiko', 'ssh', 'accelerate' ]:
|
||||||
port = host_variables.get('ansible_ssh_port', self.remote_port)
|
port = host_variables.get('ansible_ssh_port', self.remote_port)
|
||||||
if port is None:
|
if port is None:
|
||||||
port = C.DEFAULT_REMOTE_PORT
|
port = C.DEFAULT_REMOTE_PORT
|
||||||
|
@ -569,7 +569,7 @@ class Runner(object):
|
||||||
actual_pass = inject.get('ansible_ssh_pass', self.remote_pass)
|
actual_pass = inject.get('ansible_ssh_pass', self.remote_pass)
|
||||||
actual_transport = inject.get('ansible_connection', self.transport)
|
actual_transport = inject.get('ansible_connection', self.transport)
|
||||||
actual_private_key_file = inject.get('ansible_ssh_private_key_file', self.private_key_file)
|
actual_private_key_file = inject.get('ansible_ssh_private_key_file', self.private_key_file)
|
||||||
if actual_transport in [ 'paramiko', 'ssh', 'fireball2' ]:
|
if actual_transport in [ 'paramiko', 'ssh', 'accelerate' ]:
|
||||||
actual_port = inject.get('ansible_ssh_port', port)
|
actual_port = inject.get('ansible_ssh_port', port)
|
||||||
|
|
||||||
# the delegated host may have different SSH port configured, etc
|
# the delegated host may have different SSH port configured, etc
|
||||||
|
@ -610,8 +610,8 @@ class Runner(object):
|
||||||
inject['ansible_ssh_user'] = actual_user
|
inject['ansible_ssh_user'] = actual_user
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if self.transport == 'fireball2':
|
if self.transport == 'accelerate':
|
||||||
# for fireball2, we stuff both ports into a single
|
# for accelerate, we stuff both ports into a single
|
||||||
# variable so that we don't have to mangle other function
|
# variable so that we don't have to mangle other function
|
||||||
# calls just to accomodate this one case
|
# calls just to accomodate this one case
|
||||||
actual_port = [actual_port, self.accelerate_port]
|
actual_port = [actual_port, self.accelerate_port]
|
||||||
|
|
|
@ -66,7 +66,7 @@ class Connection(object):
|
||||||
args = "password=%s port=%s" % (base64.b64encode(self.key.__str__()), str(self.fbport))
|
args = "password=%s port=%s" % (base64.b64encode(self.key.__str__()), str(self.fbport))
|
||||||
self.ssh.connect()
|
self.ssh.connect()
|
||||||
tmp_path = self.runner._make_tmp_path(self.ssh)
|
tmp_path = self.runner._make_tmp_path(self.ssh)
|
||||||
return self.runner._execute_module(self.ssh, tmp_path, 'fireball2', args, inject={"password":self.key})
|
return self.runner._execute_module(self.ssh, tmp_path, 'accelerate', args, inject={"password":self.key})
|
||||||
|
|
||||||
def connect(self, allow_ssh=True):
|
def connect(self, allow_ssh=True):
|
||||||
''' activates the connection object '''
|
''' activates the connection object '''
|
||||||
|
@ -85,7 +85,7 @@ class Connection(object):
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
tries -= 1
|
tries -= 1
|
||||||
if tries == 0:
|
if tries == 0:
|
||||||
vvv("Could not connect via the fireball2 connection, exceeded # of tries")
|
vvv("Could not connect via the accelerated connection, exceeded # of tries")
|
||||||
raise errors.AnsibleError("Failed to connect")
|
raise errors.AnsibleError("Failed to connect")
|
||||||
except:
|
except:
|
||||||
if allow_ssh:
|
if allow_ssh:
|
|
@ -20,13 +20,12 @@
|
||||||
|
|
||||||
DOCUMENTATION = '''
|
DOCUMENTATION = '''
|
||||||
---
|
---
|
||||||
module: fireball2
|
module: accelerate
|
||||||
short_description: Enable fireball2 mode on remote node
|
short_description: Enable accelerated mode on remote node
|
||||||
description:
|
description:
|
||||||
- This modules launches an ephemeral I(fireball2) daemon on the remote node which
|
- This modules launches an ephemeral I(accelerate) daemon on the remote node which
|
||||||
Ansible can use to communicate with nodes at high speed.
|
Ansible can use to communicate with nodes at high speed.
|
||||||
- The daemon listens on a configurable port for a configurable amount of time.
|
- The daemon listens on a configurable port for a configurable amount of time.
|
||||||
- Starting a new fireball2 as a given user terminates any existing user fireballs2.
|
|
||||||
- Fireball mode is AES encrypted
|
- Fireball mode is AES encrypted
|
||||||
version_added: "1.3"
|
version_added: "1.3"
|
||||||
options:
|
options:
|
||||||
|
@ -38,18 +37,18 @@ options:
|
||||||
aliases: []
|
aliases: []
|
||||||
minutes:
|
minutes:
|
||||||
description:
|
description:
|
||||||
- The I(fireball2) listener daemon is started on nodes and will stay around for
|
- The I(accelerate) listener daemon is started on nodes and will stay around for
|
||||||
this number of minutes before turning itself off.
|
this number of minutes before turning itself off.
|
||||||
required: false
|
required: false
|
||||||
default: 30
|
default: 30
|
||||||
notes:
|
notes:
|
||||||
- See the advanced playbooks chapter for more about using fireball2 mode.
|
- See the advanced playbooks chapter for more about using accelerated mode.
|
||||||
requirements: [ "pycrypto" ]
|
requirements: [ "python-keyczar" ]
|
||||||
author: James Cammarata
|
author: James Cammarata
|
||||||
'''
|
'''
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
# To use fireball2 mode, simple add "accelerated: true" to your play. The initial
|
# To use accelerate mode, simply add "accelerated: true" to your play. The initial
|
||||||
# key exchange and starting up of the daemon will occur over SSH, but all commands and
|
# key exchange and starting up of the daemon will occur over SSH, but all commands and
|
||||||
# subsequent actions will be conducted over the raw socket connection using AES encryption
|
# subsequent actions will be conducted over the raw socket connection using AES encryption
|
||||||
|
|
||||||
|
@ -78,7 +77,7 @@ import traceback
|
||||||
import SocketServer
|
import SocketServer
|
||||||
|
|
||||||
syslog.openlog('ansible-%s' % os.path.basename(__file__))
|
syslog.openlog('ansible-%s' % os.path.basename(__file__))
|
||||||
PIDFILE = os.path.expanduser("~/.fireball2.pid")
|
PIDFILE = os.path.expanduser("~/.accelerate.pid")
|
||||||
|
|
||||||
# the chunk size to read and send, assuming mtu 1500 and
|
# the chunk size to read and send, assuming mtu 1500 and
|
||||||
# leaving room for base64 (+33%) encoding and header (100 bytes)
|
# leaving room for base64 (+33%) encoding and header (100 bytes)
|
||||||
|
@ -117,7 +116,7 @@ def daemonize_self(module, password, port, minutes):
|
||||||
if pid > 0:
|
if pid > 0:
|
||||||
log("exiting pid %s" % pid)
|
log("exiting pid %s" % pid)
|
||||||
# exit first parent
|
# exit first parent
|
||||||
module.exit_json(msg="daemonized fireball2 on port %s for %s minutes" % (port, minutes))
|
module.exit_json(msg="daemonized accelerate on port %s for %s minutes" % (port, minutes))
|
||||||
except OSError, e:
|
except OSError, e:
|
||||||
log("fork #1 failed: %d (%s)" % (e.errno, e.strerror))
|
log("fork #1 failed: %d (%s)" % (e.errno, e.strerror))
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
@ -333,7 +332,7 @@ def daemonize(module, password, port, minutes):
|
||||||
server.serve_forever(poll_interval=1.0)
|
server.serve_forever(poll_interval=1.0)
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
tb = traceback.format_exc()
|
tb = traceback.format_exc()
|
||||||
log("exception caught, exiting fireball mode: %s\n%s" % (e, tb))
|
log("exception caught, exiting accelerated mode: %s\n%s" % (e, tb))
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
def main():
|
def main():
|
Loading…
Add table
Add a link
Reference in a new issue