Tag Archive for: Visual Studio Code

This entry is part 2 of 5 in the series Learning Ansible

This article provides a guide for setting up the Windows Subsystem for Linux (WSL) on a Windows machine. It explains how to install WSL, download a Linux distribution, and set up the preferred distribution (Ubuntu 20.04 in this case). The article also discusses the differences between WSL1 and WSL2 and provides some recommendations for further configuration, such as setting up Visual Studio Code (VSCode) and the Windows Terminal.

Introduction

Windows Subsystem for Linux (WSL) allows users to run a Linux environment on their Windows machines. This can be useful for developers who prefer to work in a Linux environment, as it allows them to use tools like Ansible on their Windows machine without the need for a separate Linux installation.

There are two versions of WSL available: WSL1 and WSL2. WSL1 is the default version and offers the functionality needed for working with ansible. WSL2 offers improved performance and is an option for those who need it.

In this guide, we will go through the steps needed to set up WSL on a Windows machine and install a Linux distribution, specifically Ubuntu 20.04, on top of it.

Installation

  1. Open a Windows command prompt as an Administrator.
  2. Type the following command to install WSL:
wsl --install
  1. Type the following command to list the available distributions and check their status:
wsl --list --online
  1. Set WSL1 as the default version by typing the following command:
wsl --set-default-version 1
  1. Download Ubuntu 20.04 by typing the following command:
wsl --install -d Ubuntu-20.04
  1. Wait for the download to complete.
  2. Restart your PC.

Configuration

  1. Once your machine has restarted, ensure that the WSL kernel is up-to-date by typing the following command:
wsl --update
  1. Shut down WSL by typing the following command:
wsl --shutdown
  1. Open Ubuntu from the Start Menu. This will install the downloaded Ubuntu distribution into WSL and register it with the operating system. You will be prompted to set a password for your Linux environment.

Further Configuration

After setting up WSL and installing a Linux distribution, there are a few additional steps you may want to take to optimize your development environment.

  1. Set up Visual Studio Code (VSCode) and configure it to work with WSL.
  2. Check out the Windows Terminal, a new tool that allows you to work with multiple concurrent terminal windows and link to your Azure account for a seamless cloud shell experience.

For more information on setting up a WSL development environment, see Best practices for setting up a WSL development environment.

Conclusion

By following the steps outlined in this guide, you should now have WSL set up on your Windows machine and have a Linux distribution installed on top of it. This will allow you to work with Linux tools and environments on your Windows machine, making it easier to develop and deploy applications.

This entry is part 1 of 5 in the series Learning Ansible

This article explains how to install and configure Visual Studio Code (VSCode) on a machine. It discusses some of the features that make VSCode a useful tool for ansible practitioners, such as excellent git integration and support for various programming languages. The article also provides a list of recommended extensions to install in order to optimize the development environment for working with ansible and other tools. The article also mentions the special relationship between VSCode and GitHub, which allows users to open their GitHub projects in a web-based version of the editor.

Prerequisites

Before setting up VSCode, make sure that you have already set up WSL and installed the Ubuntu 20.04 distribution.

Introduction

Visual Studio Code (VSCode) is a popular text editor that offers many useful features for developers. Some of the features that are particularly useful for Ansible practitioners include:

  • Excellent git integration
  • GitHub integration
  • YAML support
  • Python support
  • Integration with WSL/WSL2
  • Built-in terminal

Additionally, GitHub has a special relationship with VSCode that allows you to open any of your GitHub projects in a web-based version of the editor simply by replacing the “www” in the GitHub URL with “dev”. This is a convenient feature that allows you to develop on devices such as iPads and Android tablets that may not have native VSCode support.

Installation

If you do not already have VSCode installed on your machine, you can download the latest version from the following website:

code.visualstudio.com

Run the installer and follow the prompts, accepting the default options.

Configuration

Once VSCode is installed, you can install the following extensions to enhance your development environment:

  • Remote WSL
  • YAML
  • Prettier
  • Ansible
  • Jinja2

For more information on setting up VSCode to work with WSL, see Get started using Visual Studio Code with WSL.

Conclusion

By following the steps outlined in this guide, you should now have VSCode installed and configured on your machine. You should also have the necessary extensions installed to optimize your development environment for working with ansible and other tools. VSCode’s integration with WSL and its various features for working with git and GitHub make it a valuable tool for any ansible practitioner.