Add Linux development station role with systemd services for code-server and OpenCode
- Implemented handlers for restarting code-server and OpenCode services. - Created main tasks for setting up a Linux development station, including user management, package installation, and configuration. - Added validation for OpenCode server credentials and code-server password. - Introduced tool package management for npm, uv, and go installers. - Developed templates for systemd service units for code-server and OpenCode. - Included scripts for starting code-server and OpenCode with SSH agent support. - Updated inventory and Terraform configuration to include new development host.
This commit is contained in:
@@ -0,0 +1,103 @@
|
||||
---
|
||||
linux_dev_station_service_user_enabled: true
|
||||
linux_dev_station_service_user: "devstation"
|
||||
linux_dev_station_service_shell: "/usr/sbin/nologin"
|
||||
linux_dev_station_service_user_ssh_enabled: false
|
||||
linux_dev_station_service_user_ssh_shell: "/bin/zsh"
|
||||
linux_dev_station_service_user_ssh_authorized_keys: []
|
||||
linux_dev_station_service_home: "/home/{{ linux_dev_station_service_user }}"
|
||||
|
||||
linux_dev_station_workspace_dir: "{{ linux_dev_station_service_home }}/projects"
|
||||
linux_dev_station_scripts_dir: "{{ linux_dev_station_service_home }}/scripts"
|
||||
linux_dev_station_logs_dir: "{{ linux_dev_station_service_home }}/.local/state/logs"
|
||||
linux_dev_station_systemd_unit_dir: "/etc/systemd/system"
|
||||
linux_dev_station_path: >-
|
||||
{{ linux_dev_station_service_home }}/.local/bin:{{ linux_dev_station_service_home }}/go/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/usr/local/bin
|
||||
|
||||
linux_dev_station_dnf_packages:
|
||||
- git
|
||||
- tmux
|
||||
- wget
|
||||
- curl
|
||||
- jq
|
||||
- openssl
|
||||
- zsh
|
||||
- golang
|
||||
- ripgrep
|
||||
- fzf
|
||||
|
||||
linux_dev_station_tool_packages:
|
||||
- name: uv
|
||||
install_script_url: "https://astral.sh/uv/install.sh"
|
||||
- name: node
|
||||
manager: fnm
|
||||
- name: rust
|
||||
manager: rustup
|
||||
- name: code-server
|
||||
version: "4.127.0"
|
||||
sha256: ""
|
||||
- name: opencode
|
||||
version: "1.17.18"
|
||||
sha256: ""
|
||||
|
||||
linux_dev_station_code_server_host: "0.0.0.0"
|
||||
linux_dev_station_code_server_port: 3000
|
||||
linux_dev_station_code_server_auth: "password"
|
||||
linux_dev_station_code_server_password: "{{ lookup('env', 'CODE_SERVER_PASSWORD', default='') }}"
|
||||
linux_dev_station_code_server_workspace: "{{ linux_dev_station_workspace_dir }}"
|
||||
linux_dev_station_code_server_extensions_enabled: true
|
||||
linux_dev_station_code_server_extensions_fail_on_error: false
|
||||
linux_dev_station_code_server_extensions:
|
||||
- ms-python.python
|
||||
- ms-python.vscode-pylance
|
||||
- ms-azuretools.vscode-docker
|
||||
- hashicorp.terraform
|
||||
- redhat.ansible
|
||||
- eamodio.gitlens
|
||||
|
||||
linux_dev_station_copilot_enabled: false
|
||||
linux_dev_station_copilot_extensions:
|
||||
- GitHub.copilot
|
||||
- GitHub.copilot-chat
|
||||
linux_dev_station_copilot_fail_on_error: false
|
||||
|
||||
linux_dev_station_oh_my_zsh_enabled: true
|
||||
linux_dev_station_oh_my_zsh_install_url: "https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh"
|
||||
|
||||
linux_dev_station_npm_packages: []
|
||||
|
||||
linux_dev_station_git_init_default_branch: "main"
|
||||
linux_dev_station_git_pull_rebase: false
|
||||
|
||||
linux_dev_station_ssh_key_path: "{{ ansible_facts['env']['HOME'] }}/.ssh/id_ed25519"
|
||||
linux_dev_station_ssh_key_comment: "dev-02"
|
||||
|
||||
linux_dev_station_code_server_systemd_enabled: true
|
||||
linux_dev_station_opencode_systemd_enabled: true
|
||||
linux_dev_station_opencode_server_host: "0.0.0.0"
|
||||
linux_dev_station_opencode_server_port: 4096
|
||||
linux_dev_station_opencode_server_username: "{{ lookup('env', 'OPENCODE_SERVER_USERNAME', default='') }}"
|
||||
linux_dev_station_opencode_server_password: "{{ lookup('env', 'OPENCODE_SERVER_PASSWORD', default='') }}"
|
||||
linux_dev_station_opencode_extra_environment: {}
|
||||
linux_dev_station_opencode_command: "opencode serve --hostname {{ linux_dev_station_opencode_server_host }} --port {{ linux_dev_station_opencode_server_port }}"
|
||||
linux_dev_station_opencode_config: {}
|
||||
linux_dev_station_opencode_config_path: "{{ linux_dev_station_service_home }}/.config/opencode/opencode.json"
|
||||
|
||||
# MCP installer definitions
|
||||
# Supported kinds:
|
||||
# - npm: package + optional version
|
||||
# - uv: package + optional version + binary
|
||||
# - go: module + optional version + binary
|
||||
linux_dev_station_mcp_installers_enabled: true
|
||||
linux_dev_station_mcp_installers: []
|
||||
|
||||
# Legacy ad-hoc hook kept for backward compatibility.
|
||||
linux_dev_station_mcp_bootstrap_commands: []
|
||||
linux_dev_station_manage_systemd: true
|
||||
|
||||
# SSH agent
|
||||
linux_dev_station_ssh_agent_enabled: false
|
||||
linux_dev_station_ssh_agent_keys:
|
||||
- "{{ linux_dev_station_service_home }}/.ssh/id_ed25519"
|
||||
linux_dev_station_ssh_agent_passphrase: "{{ lookup('env', 'SSH_KEY_PASSPHRASE', default='') }}"
|
||||
linux_dev_station_ssh_agent_socket: "{{ linux_dev_station_service_home }}/.ssh/ssh-agent.sock"
|
||||
Reference in New Issue
Block a user