pallxk.code_server

Ansible Role: Code Server

Ansible Role
Build Status
Keep a Changelog

This role helps install and set up the latest or a chosen version of code-server, compatible with versions 4, 3, 2, and 1.

# Install the latest stable version of the role
ansible-galaxy install -f pallxk.code_server

# Install the latest development version of the role
ansible-galaxy install -f pallxk.code_server,master

To install code-server, check the section Example Playbook.

Note: The role version does not determine the version of code-server you can install. It installs the latest version by default, and you can use an older role to install a newer version of code-server. When the role is updated, it will match the latest code-server version. If you face any installation issues, please report them.

Requirements

None.

Role Variables

Variable Default Description
code_server_ver (undefined) Release name of code-server on GitHub. Defaults to the latest version (including pre-releases).
code_server_install_prefix /usr/local Directory where code-server will be installed.
code_server_data_dir {{ ansible_user_dir }}/.local/share/code-server Location for code-server data in the user's home directory.
code_server_work_dir (undefined) Working directory. Defaults to a welcome screen if not set for v3 and v2, and the home directory for v1.
code_server_auth password Authentication method: password or none. Available for code-server v3 and v2.
code_server_password (undefined) Leave blank for an auto-generated password. Check it with journalctl -u code-server.
code_server_user {{ ansible_user_id }} User running code-server, defaults to the user in the Ansible SSH connection.
code_server_host 0.0.0.0 Host address for code-server.
code_server_port 8080 Port for code-server.
code_server_env {} Additional environment variables for code-server.
code_server_tls_cert (undefined) Leave blank to use a self-signed certificate.
code_server_tls_cert_remote no Change to yes if using an existing certificate on your server (e.g., Let's Encrypt).
code_server_tls_key (undefined) Leave blank to use a self-signed certificate.
code_server_tls_key_remote no Change to yes if using an existing key on your server (e.g., Let's Encrypt).

Dependencies

None.

Example Playbook

#!/usr/bin/env ansible-playbook
---
- hosts: localhost
  gather_facts: yes
  roles:
    - name: pallxk.code_server
      code_server_password: SuperSecret
      code_server_user: "{{ ansible_user_id }}"
      code_server_host: 0.0.0.0
      code_server_port: 8443
      code_server_env:
        # For code-server v4
        # Use open-vsx.org by default,
        # to switch to the legacy Coder extensions marketplace, add this:
        EXTENSIONS_GALLERY: >
          {
            "serviceUrl": "https://extensions.coder.com/api"
          }
        # For code-server v3
        # Uses Coder extensions marketplace by default,
        # to switch to open-vsx.org, add this:
        SERVICE_URL: https://open-vsx.org/vscode/gallery
        ITEM_URL: https://open-vsx.org/vscode/item
      code_server_tls_cert: /etc/letsencrypt/live/example.com/fullchain.pem
      code_server_tls_key: /etc/letsencrypt/live/example.com/privkey.pem

License

The MIT License (MIT)

Author Information

Informazioni sul progetto

Install and configure the latest or specified version of code-server (v4, v3, v2 & v1).

Installa
ansible-galaxy install pallxk.code_server
Licenza
mit
Download
1.3k
Proprietario