From b8125ac1a61f2c7d1de821c78c884560071895f1 Mon Sep 17 00:00:00 2001 From: Thomas Szymanski Date: Wed, 11 Jan 2017 19:24:37 +0100 Subject: [PATCH] Remove the --nspawn-extra-args cli option Providing extra arguments to pass to systemd-nspawn is still possible through the `nspawn_connection` of the `ansible.cfg` file. --- lib/ansible/cli/__init__.py | 2 -- lib/ansible/plugins/connection/nspawn.py | 4 +--- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/ansible/cli/__init__.py b/lib/ansible/cli/__init__.py index e5f1fc3d039..932093e2c83 100644 --- a/lib/ansible/cli/__init__.py +++ b/lib/ansible/cli/__init__.py @@ -355,8 +355,6 @@ class CLI(with_metaclass(ABCMeta, object)): help="specify extra arguments to pass to scp only (e.g. -l)") connect_group.add_option('--ssh-extra-args', default='', dest='ssh_extra_args', help="specify extra arguments to pass to ssh only (e.g. -R)") - connect_group.add_option('--nspawn-extra-args', default='', dest='nspawn_extra_args', - help="specify extra arguments to pass to systemd-nspawn only (e.g. --bind)") parser.add_option_group(connect_group) diff --git a/lib/ansible/plugins/connection/nspawn.py b/lib/ansible/plugins/connection/nspawn.py index 2154c7e6f6e..add6599e243 100644 --- a/lib/ansible/plugins/connection/nspawn.py +++ b/lib/ansible/plugins/connection/nspawn.py @@ -34,7 +34,6 @@ class Connection(ConnectionBase): *args, **kwargs) display.vvv("NSPAWN ARGS %s" % self._play_context.nspawn_args) - display.vvv("NSPAWN EXTRA ARGS %s" % self._play_context.nspawn_extra_args) self.chroot = self._play_context.remote_addr @@ -69,8 +68,7 @@ class Connection(ConnectionBase): else '/bin/sh') nspawn_args = shlex.split(self._play_context.nspawn_args) - nspawn_extra_args = shlex.split(self._play_context.nspawn_extra_args) - local_cmd = [self.nspawn_cmd, '-D', self.chroot ] + nspawn_args + nspawn_extra_args + [ + local_cmd = [self.nspawn_cmd, '-D', self.chroot ] + nspawn_args + [ '--', executable, '-c', cmd] display.vvv("EXEC %s" % (local_cmd), host=self.chroot)