iocage connector that wraps around jail connector. (#17986)

Added iocage connector that extends the jail connector. Uses iocage to translate iocage tags or UUIDs/partial UUIDs to the actual jail name and then uses the jail connector for actual functionality.
This commit is contained in:
slohse 2016-12-23 00:34:47 +01:00 committed by Matt Clay
parent f2458140f6
commit 27cce305e6
2 changed files with 72 additions and 0 deletions

View file

@ -41,6 +41,8 @@ except ImportError:
class Connection(ConnectionBase):
''' Local BSD Jail based connections '''
modified_jailname_key = 'conn_jail_name'
transport = 'jail'
# Pipelining may work. Someone needs to test by setting this to True and
# having pipelining=True in their ansible.cfg
@ -54,6 +56,8 @@ class Connection(ConnectionBase):
super(Connection, self).__init__(play_context, new_stdin, *args, **kwargs)
self.jail = self._play_context.remote_addr
if self.modified_jailname_key in kwargs :
self.jail = kwargs[self.modified_jailname_key]
if os.geteuid() != 0:
raise AnsibleError("jail connection requires running as root")