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,60 @@
|
||||
---
|
||||
- name: Unload code-server launch agent if already loaded
|
||||
become: true
|
||||
ansible.builtin.command: >-
|
||||
launchctl bootout system {{ macos_dev_station_launchd_plist_dir }}/com.a13labs.code-server.plist
|
||||
failed_when: false
|
||||
changed_when: false
|
||||
when:
|
||||
- macos_dev_station_manage_launchd | bool
|
||||
- macos_dev_station_code_server_launchd_enabled | bool
|
||||
listen: Restart code-server launch agent
|
||||
|
||||
- name: Load code-server launch agent
|
||||
become: true
|
||||
ansible.builtin.command: >-
|
||||
launchctl bootstrap system {{ macos_dev_station_launchd_plist_dir }}/com.a13labs.code-server.plist
|
||||
changed_when: true
|
||||
when:
|
||||
- macos_dev_station_manage_launchd | bool
|
||||
- macos_dev_station_code_server_launchd_enabled | bool
|
||||
listen: Restart code-server launch agent
|
||||
|
||||
- name: Enable code-server launch agent
|
||||
become: true
|
||||
ansible.builtin.command: launchctl enable system/com.a13labs.code-server
|
||||
changed_when: false
|
||||
when:
|
||||
- macos_dev_station_manage_launchd | bool
|
||||
- macos_dev_station_code_server_launchd_enabled | bool
|
||||
listen: Restart code-server launch agent
|
||||
|
||||
- name: Unload opencode launch agent if already loaded
|
||||
become: true
|
||||
ansible.builtin.command: >-
|
||||
launchctl bootout system {{ macos_dev_station_launchd_plist_dir }}/com.a13labs.opencode.plist
|
||||
failed_when: false
|
||||
changed_when: false
|
||||
when:
|
||||
- macos_dev_station_manage_launchd | bool
|
||||
- macos_dev_station_opencode_launchd_enabled | bool
|
||||
listen: Restart opencode launch agent
|
||||
|
||||
- name: Load opencode launch agent
|
||||
become: true
|
||||
ansible.builtin.command: >-
|
||||
launchctl bootstrap system {{ macos_dev_station_launchd_plist_dir }}/com.a13labs.opencode.plist
|
||||
changed_when: true
|
||||
when:
|
||||
- macos_dev_station_manage_launchd | bool
|
||||
- macos_dev_station_opencode_launchd_enabled | bool
|
||||
listen: Restart opencode launch agent
|
||||
|
||||
- name: Enable opencode launch agent
|
||||
become: true
|
||||
ansible.builtin.command: launchctl enable system/com.a13labs.opencode
|
||||
changed_when: false
|
||||
when:
|
||||
- macos_dev_station_manage_launchd | bool
|
||||
- macos_dev_station_opencode_launchd_enabled | bool
|
||||
listen: Restart opencode launch agent
|
||||
Reference in New Issue
Block a user