mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-25 20:01:25 -07:00
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:
parent
f2458140f6
commit
27cce305e6
2 changed files with 72 additions and 0 deletions
|
@ -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")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue