VSChina / vscode-ansible

VSCode extension for ansible
Other
77 stars 48 forks source link

vscode-ansible: "Run Playbook Remotely via ssh" / "Files copy to remote on saving" copies symbolic links instead of re-creating symbolic links on remote #193

Open jhawkesworth opened 6 years ago

jhawkesworth commented 6 years ago

Environment

Summary

If you have symbolic links in your ansible configuration, the copy to remote function just copies the contents of the

Reproduce steps

1/ On linux or OS that supports symbolic links create ansible configuration with following structure, using following commands:

mkdir group_vars echo "inv test" > inventory.functional-test echo "inv perf" > inventory.performance-test mkdir inventory.test-all cd inventory.test-all ln -s ../group_vars/ group_vars ln -s ../inventory.functional-test inventory.functional-test ln -s ../inventory.performance-test inventory.performance-test

files should have following structure (symbolic links can be used to combine 2 inventory files)

$ tree . ├── group_vars ├── inventory.functional-test ├── inventory.performance-test ├── inventory.test-all │ ├── group_vars -> ../group_vars/ │ ├── inventory.functional-test -> ../inventory.functional-test │ └── inventory.performance-test -> ../inventory.performance-test └── test-playbook.yml

2/ check in files to source code repository (git, mercurial or other should not matter) 3/ clone files from source code repository to windows PC 4/ open folder of files cloned in step 3/ in VSCode with vscode-ansbile extension enabled. 5/ F1 and choose 'Ansible: Run Ansible Playbook remotely via ssh'. Use wizard to set up connection to remote SSH host. Choose 'always' when asked to copy files.

Expected Results

File structure and symbolic links recreated on remote, playbook execution starts

Actual Results

instead of creating symbolic links, files are copied on remote host. Copy takes long time. ansible playbook does not start.

yungezz commented 6 years ago

thanks for reporting the issue, will fix it in next release.

jhawkesworth commented 5 years ago

Perhaps a better way to fix this would be to implement the abilty to copy the whole workspace up to Cloud Shell. Copying single files does not work very well as folder structure on cloud shell does not reflect folder structure of vscode workspace at the moment.