Add macOS development station playbook and role
- Created a new Ansible playbook for configuring macOS development stations. - Added role `macos_dev_station` with default variables, handlers, and tasks. - Implemented tasks for installing Homebrew packages, managing user configurations, and setting up launch agents for code-server and opencode. - Included templates for launchd plist files and startup scripts for code-server and opencode. - Added validation for required environment variables and configurations. - Updated inventory to include macOS hosts and added a setup script for initial prerequisites. - Modified Terraform configuration to include DNS records for new services.
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>Label</key>
|
||||
<string>com.a13labs.code-server</string>
|
||||
|
||||
<key>UserName</key>
|
||||
<string>{{ macos_dev_station_service_user }}</string>
|
||||
|
||||
<key>WorkingDirectory</key>
|
||||
<string>{{ macos_dev_station_workspace_dir }}</string>
|
||||
|
||||
<key>ProgramArguments</key>
|
||||
<array>
|
||||
<string>/bin/bash</string>
|
||||
<string>{{ macos_dev_station_scripts_dir }}/start-ide.sh</string>
|
||||
</array>
|
||||
|
||||
<key>RunAtLoad</key>
|
||||
<true/>
|
||||
|
||||
<key>KeepAlive</key>
|
||||
<true/>
|
||||
|
||||
<key>StandardOutPath</key>
|
||||
<string>{{ macos_dev_station_logs_dir }}/code-server.log</string>
|
||||
|
||||
<key>StandardErrorPath</key>
|
||||
<string>{{ macos_dev_station_logs_dir }}/code-server.err.log</string>
|
||||
|
||||
<key>EnvironmentVariables</key>
|
||||
<dict>
|
||||
<key>PATH</key>
|
||||
<string>{{ macos_dev_station_path }}</string>
|
||||
<key>PASSWORD</key>
|
||||
<string>{{ macos_dev_station_code_server_password }}</string>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1 @@
|
||||
{{ macos_dev_station_opencode_config | to_nice_json }}
|
||||
@@ -0,0 +1,46 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>Label</key>
|
||||
<string>com.a13labs.opencode</string>
|
||||
|
||||
<key>UserName</key>
|
||||
<string>{{ macos_dev_station_service_user }}</string>
|
||||
|
||||
<key>WorkingDirectory</key>
|
||||
<string>{{ macos_dev_station_workspace_dir }}</string>
|
||||
|
||||
<key>ProgramArguments</key>
|
||||
<array>
|
||||
<string>/bin/bash</string>
|
||||
<string>{{ macos_dev_station_scripts_dir }}/start-opencode.sh</string>
|
||||
</array>
|
||||
|
||||
<key>RunAtLoad</key>
|
||||
<true/>
|
||||
|
||||
<key>KeepAlive</key>
|
||||
<true/>
|
||||
|
||||
<key>StandardOutPath</key>
|
||||
<string>{{ macos_dev_station_logs_dir }}/opencode.log</string>
|
||||
|
||||
<key>StandardErrorPath</key>
|
||||
<string>{{ macos_dev_station_logs_dir }}/opencode.err.log</string>
|
||||
|
||||
<key>EnvironmentVariables</key>
|
||||
<dict>
|
||||
<key>PATH</key>
|
||||
<string>{{ macos_dev_station_path }}</string>
|
||||
<key>OPENCODE_SERVER_USERNAME</key>
|
||||
<string>{{ macos_dev_station_opencode_server_username }}</string>
|
||||
<key>OPENCODE_SERVER_PASSWORD</key>
|
||||
<string>{{ macos_dev_station_opencode_server_password }}</string>
|
||||
{% for env_key, env_value in macos_dev_station_opencode_extra_environment.items() %}
|
||||
<key>{{ env_key }}</key>
|
||||
<string>{{ env_value }}</string>
|
||||
{% endfor %}
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
cd {{ macos_dev_station_workspace_dir }}
|
||||
|
||||
exec code-server \
|
||||
--bind-addr {{ macos_dev_station_code_server_host }}:{{ macos_dev_station_code_server_port }} \
|
||||
--auth {{ macos_dev_station_code_server_auth }} \
|
||||
--disable-telemetry \
|
||||
{{ macos_dev_station_code_server_workspace }}
|
||||
@@ -0,0 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
cd {{ macos_dev_station_workspace_dir }}
|
||||
|
||||
exec {{ macos_dev_station_opencode_command }}
|
||||
Reference in New Issue
Block a user