fernandrone.ansible_role_visual_studio_code
Ansible Role: Visual Studio Code
This is an Ansible role to install the Visual Studio Code Integrated Development Environment (IDE) or text editor.
Requirements
- You need Ansible version 2.8 or higher.
- It works on certain Linux distributions:
- Debian Family (like Ubuntu):
- Ubuntu Bionic (18.04)
- Ubuntu Focal (20.04)
- RedHat Family:
- Rocky Linux (8)
- Fedora (34)
- SUSE Family:
- openSUSE (15.3)
- Note: Other versions might work, but they've not been tested.
- Debian Family (like Ubuntu):
Role Variables
You can change the following settings for this role (default values are provided):
# The version of Visual Studio Code to install, defaults to the latest version
visual_studio_code_version: ''
# Choose 'stable' or 'insiders' build (only for Ubuntu, as 'code-insiders' is not available in RPM repo)
visual_studio_code_build: stable
# Server URL for downloading Visual Studio Code package
visual_studio_code_mirror: 'https://packages.microsoft.com'
# Users for whom to install extensions and/or set up settings.json
users: []
User configuration looks like this:
users:
- username: # Your Unix username
visual_studio_code_extensions:
- # extension 1
- # extension 2
visual_studio_code_settings_overwrite: # If to overwrite settings.json. Use "yes" or "no" (defaults to "no").
visual_studio_code_settings: # JSON object
Example Playbooks
Minimal playbook:
- hosts: servers
roles:
- role: fernandrone.ansible_role_visual_studio_code
Playbook with installed extensions and overwriting settings:
- hosts: servers
roles:
- role: fernandrone.ansible_role_visual_studio_code
users:
- username: vagrant
visual_studio_code_extensions:
- streetsidesoftware.code-spell-checker
- wholroyd.jinja
- ms-python.python
visual_studio_code_overwrite: yes
visual_studio_code_settings_overwrite: yes
visual_studio_code_settings: {
"editor.rulers": [80, 100, 120],
"editor.renderWhitespace": true,
"files.associations": {
"Vagrantfile": "ruby"
}
}
More Roles From GantSign
Check out more roles from GantSign on Ansible Galaxy.
Development & Testing
This project uses Molecule for development and testing. The role is tested using Testinfra and pytest.
To work on or test this, you need to have:
To make it easier to install these, this project includes Molecule Wrapper. It’s a script that installs Molecule and its dependencies (except Linux) and runs Molecule with your command.
To test this role with Molecule Wrapper, run:
./moleculew test
Note: Some dependencies may require sudo
access to install.
License
MIT License
Author Information
John Freeman
GantSign Ltd.
Company No. 06109112 (registered in England)
Role for installing the Visual Studio Code IDE.
ansible-galaxy install fernandrone.ansible_role_visual_studio_code