Open ArgTang opened 5 years ago
@ArgTang thanks for reporting the issue.
If running in could shell and using variables in files, cloud shell cannot fint myvariables.yml because it is not copied. How do you solve this? you can put your variable files into your workspace, vscode extension will copy whole workspace to cloud shell.
Calling powershell scripts in ansible playbook fails when using docker, because images does not contain powershell
default docker image is a ubuntu1604 with ansible 2.7, you can set your custom docker image to be used by configuration item ansible.dockerImage
. Then in your own docker image, do customization, such as installing powershell.
Calling az from shell command when running in docker, command is not run because az is not available in docker image same as above. The reason we're not installing az in default docker image is that we're trying to build a general vscode extension for ansible, not azure specific. so the docker image contains necessary dependencies to run ansible with different cloud providers, such as azure, gcp, aws etc
Thanks for the tips.
The vars file is in the same directory, but is not uploaded for me. I have checked in the storage for the cloud shell and only the specific files that i want to run is uploaded, not the other files/folders in the workspace. It also seems that the "Upload to Clould Shell" also does not work for me.
It seems like i have to try to customize the image. It would be nice if the current dockerfile was more visible, i cannnot seem to find it, so i can use that as a start. ex a link to the dockerfile in comment of the settingsfile, or in the readme on docker hub.
I understand you point, but integration with cloudshell for azure but not az cli, i find somewhat puzzling. Also as you said as well the docker hub readme for the image say:
image contains necessary dependencies to run ansible with different cloud providers
This wording suggests to me that clis for cloud providers is included. It would be nice if this is clearly noted in the docs that cloud vendors clis are not included by default.
az cli
seems reasonable to complete azure scenario, I'll update the docker image to include it.@yuwzho no errors other than vars file not found.
Thanks :+1:
@yungezz please advise how to make VSCode copy all files from workspace to Cloud Shell? I think this will solve this and other open issues for VSCode ansible plugin.
My ansible configuration is many files, but the 'Upload to Cloud Shell' option only appears on files in the workspace Explorer. If I used Ctrl-Shift-P -> 'Azure: Upload to Cloud Shell' a file selector appears but it will not let me select directories, only individual files. I am using VSCode version 1.32.1 (user setup) Ansible exension version 0.5.2 Azure account extention 0.8.0
Environment
Summary
Trouble running ansible playbooks. I am new to ansible and have found this vscodeplugin very helpfull. I have to issues that i have tried doing a workaround for. The first one is about using variables in another file when running with the cloud shell integration. The two others is with running scripts when using the docker integration.
If running in could shell and using variables in files, cloud shell cannot fint myvariables.yml because it is not copied. How do you solve this?
Calling powershell scripts in ansible playbook fails when using docker, because images does not contain powershell
Calling
az
from shell command when running in docker, command is not run because az is not available in docker imageReproduce steps
1:
Expected Results
Actual Results
"message": "Could not find or access 'test-vars.yml"
"module_stderr": "/bin/sh: 1: powershell: not found"
"stderr_lines": ["/bin/sh: 1: az: not found"]