Visual Studio Code has a feature that allows you to create, modify and run Ansible Playbooks directly on the Ansible Node Linux VM. No need to copy YAML files to run from a VM.
In this article, I will show you step by step how to configure Visual Studio Code to run it on a remote host.
Configuration
1. Open Visual Studio Code and install following extension.
2. Navigate to Remote Explorer and click + next to SSH.
3. Enter SSH connection command.
ssh username@IP_or_hostname
4. Select config file to update.
5. Now click on green connection icon and select Connect to host.
6. Choose your host and type the password.
7. Once connected go to Explorer and click Open folder. Then choose a folder where your Playbooks are located. In my case that is /home/ansible/Desktop/Playbooks/. Click OK. You may be asked for password again.
Now you can create and run Ansible Playbooks directly in an Ansible VM using a remote SSH connection from Visual Studio Code.
Thank you for reading! Here are some links you may be interested in:
- More articles on main page: https://vmcloud.pl/
- LinkedIn: https://www.linkedin.com/in/krzysztofsalwa/
- Twitter: https://twitter.com/vmcloudpl
- GitHub: https://github.com/vmcloudpl
- VMware vExpert: https://vexpert.vmware.com/
- VMware Communities: https://communities.vmware.com/
- VMUG: https://www.vmug.com/
- VMware Explore: https://www.vmware.com/explore.html
- VMware Store EU: https://store-eu.vmware.com/
- VMware Store US: https://store-us.vmware.com/
Leave a comment