vscode_server
:role: vscode-server :author1: Mitesh The Mouse mitsharm@redhat.com :author2: Prakhar Srivastava psrivast@redhat.com :author3: Tony Kay tok@redhat.com :team: GPTE DevOps & Automation
Role: {role}
The role {role} installs nginx and vscode, serves vscode UI via https/http using nginx.
Requirements
- To run the role one should have root privilege.
- Port 80/tcp and 443/tcp should be open.
Role tree structure
[source=textinfo]
vscode-server/ ├── README.adoc ├── defaults │ └── main.yml ├── files │ └── nginx.conf ├── tasks │ ├── main.yml │ ├── nginx-server.yml │ └── vscode-server.yml └── templates ├── settings.json └── vscode-server.service.j2
4 directories, 8 files
Role Variables
. List of variables used in {role} role- + [cols="5",options="header"] |=== | Variable | Type | Required | Default | Description | vscode_server_hostname | String | Yes | - | Public FQDN of the host | email | String | Yes | - | Email id used to generate letsencrypt certificate | vscode_user_name | String | Yes | - | Existing user to setup vscode server | vscode_user_password | String | Yes | - | To access vscode webUI | vscode_server_install_nginx | Bool | Yes | True | To install custom nginx server to provide vscode server over http/https | vscode_server_install_vscode | Bool | Yes | True | To install / setup vscode-server | vscode_server_default_extensions | List | Yes | Yes | List of extension available on https://gpte-public.s3.amazonaws.com/vscode-plugins/ | vscode_server_nginx_conf | String | Yes | Yes | nginx configuration file | vscode_server_extension_urls | List | no| - | List of additional vscode extension extenal urls |===
Example of Variables and Values
. Example - + [source=text]
vscode_user_name: devops vscode_user_password: changme vscode_server_hostname: bastion.xxxx.example.com email: devops@opentlc.com vscode_server_default_extensions:
- bierner.markdown-preview-github-styles-0.1.6.vsix vscode_server_nginx_conf: ./files/nginx.conf vscode_server_extension_urls:
- http://www.example.com/vscode-extension1.vsix
- http://www.example.com/vscode-extension2.vsix
Example of Sample Variables and Playbook
. Example- + [source=text]
[user@desktop ~]$ cat playbook.yml
- hosts: bastion
become: true
tasks:
- include_role: name: vscode-server vars: vscode_user_name: devops vscode_user_password: changme vscode_server_hostname: bastion.xxxx.example.com email: devops@opentlc.com vscode_server_nginx_conf: ./files/nginx.conf vscode_server_extension_urls: - http://www.example.com/vscode-extension1.vsix - http://www.example.com/vscode-extension2.vsix
[user@desktop ~]$ ansible-playbook playbook.yml
. Example- + [source=text]
[user@desktop ~]$ cat sample_vars.yml
vscode_user_name: devops vscode_user_password: changme vscode_server_hostname: bastion.xxxx.example.com email: devops@opentlc.com vscode_server_nginx_conf: ./files/nginx.conf vscode_server_extension_urls:
[user@desktop ~]$ cat playbook.yml
- hosts: bastion
become: true
roles:
- vscode-server
[user@desktop ~]$ ansible-playbook playbook.yml -e sample_vars.yml
Author Information
Author/owner: ** {author1}
Alternative Contacts: ** {author2} ** {author3}
Team: ** {team}
Installs and configures vscode and nginx server
ansible-galaxy install miteshget/vscode-server