diff options
Diffstat (limited to 'ansible/connection_plugins/lxc_ssh.py')
-rw-r--r-- | ansible/connection_plugins/lxc_ssh.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ansible/connection_plugins/lxc_ssh.py b/ansible/connection_plugins/lxc_ssh.py index 9f93305..2bb5352 100644 --- a/ansible/connection_plugins/lxc_ssh.py +++ b/ansible/connection_plugins/lxc_ssh.py @@ -1167,11 +1167,11 @@ class Connection(ConnectionBase): cmd = ('cat > %s; echo -n done' % pipes.quote(out_path)) h = self.container_name if (self.lxc_version == 2): - lxc_cmd = 'lxc exec %s --mode=non-interactive -- /bin/sh -c %s' \ + lxc_cmd = 'sudo lxc exec %s --mode=non-interactive -- /bin/sh -c %s' \ % (pipes.quote(h), pipes.quote(cmd)) elif (self.lxc_version == 1): - lxc_cmd = 'lxc-attach --name %s -- /bin/sh -c %s' \ + lxc_cmd = 'sudo lxc-attach --name %s -- /bin/sh -c %s' \ % (pipes.quote(h), pipes.quote(cmd)) if in_data: @@ -1204,11 +1204,11 @@ class Connection(ConnectionBase): cmd = ('cat < %s' % pipes.quote(in_path)) h = self.container_name if (self.lxc_version == 2): - lxc_cmd = 'lxc exec %s --mode=non-interactive -- /bin/sh -c %s' \ + lxc_cmd = 'sudo lxc exec %s --mode=non-interactive -- /bin/sh -c %s' \ % (pipes.quote(h), pipes.quote(cmd)) elif (self.lxc_version == 1): - lxc_cmd = 'lxc-attach --name %s -- /bin/sh -c %s' \ + lxc_cmd = 'sudo lxc-attach --name %s -- /bin/sh -c %s' \ % (pipes.quote(h), pipes.quote(cmd)) |