mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-26 14:41:23 -07:00
Force command action to not be executed by the shell unless specifically enabled
This commit is contained in:
parent
9730157525
commit
ba0fec4f42
19 changed files with 427 additions and 245 deletions
|
@ -16,8 +16,6 @@
|
|||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import subprocess
|
||||
|
||||
DOCUMENTATION = '''
|
||||
---
|
||||
module: synchronize
|
||||
|
@ -272,6 +270,13 @@ def main():
|
|||
cmd = cmd + " --rsync-path '%s'" %(rsync_path)
|
||||
changed_marker = '<<CHANGED>>'
|
||||
cmd = cmd + " --out-format='" + changed_marker + "%i %n%L'"
|
||||
|
||||
# expand the paths
|
||||
if '@' not in source:
|
||||
source = os.path.expanduser(source)
|
||||
if '@' not in dest:
|
||||
dest = os.path.expanduser(dest)
|
||||
|
||||
cmd = ' '.join([cmd, source, dest])
|
||||
cmdstr = cmd
|
||||
(rc, out, err) = module.run_command(cmd)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue