commit 10eb174fdae3930955932271a765a6bf0d825ad9
parent 919cb5b067a7351401cbaacd80063c1d13416269
Author: Chris Roberts <chris.roberts@learningunix.net>
Date: Thu, 21 May 2026 06:24:34 -0500
did some cleanup work, rearranged some roles. updated the instrcutions in the readme. split the mas install and the xcode install into 2 different roles
Diffstat:
14 files changed, 68 insertions(+), 47 deletions(-)
diff --git a/README.md b/README.md
@@ -4,7 +4,6 @@
Ansible playbook that sets up a MacBook Pro for QA work. Installs and configures:
-- **Xcode Command Line Tools**
- **Xcode** (full IDE, installed via Mac App Store)
- **Homebrew** (package manager)
- **Google Chrome**
@@ -23,9 +22,17 @@ Xcode is installed from the Mac App Store. The playbook will fail with a clear m
**System Settings → App Store → Sign In**
-### 2. Install Ansible
+### 2. Install Xcode Command Line Tools
-Ansible does not ship with macOS. Install it via pip:
+This provides Python 3 and the developer tools required to run the playbook:
+
+```bash
+xcode-select --install
+```
+
+A GUI dialog will appear — click **Install** and wait for it to complete before continuing.
+
+### 3. Install Ansible
```bash
pip3 install ansible
@@ -37,13 +44,7 @@ Verify it worked:
ansible --version
```
-> If `pip3` is not found, install it first:
-> ```bash
-> sudo easy_install pip
-> ```
-> Or install Python from [python.org](https://www.python.org/downloads/macos/) and use its bundled pip.
-
-### 3. Install the required Ansible collection
+### 4. Install the required Ansible collection
```bash
ansible-galaxy collection install -r requirements.yml
@@ -67,7 +68,6 @@ ansible-playbook -i inventory/local.ini site.yml --check --diff
ansible-playbook -i inventory/local.ini site.yml
```
-> **Note on Xcode Command Line Tools:** On a fresh Mac, macOS will pop up a GUI dialog asking you to click "Install". The playbook will wait up to 5 minutes for that step to complete before continuing.
> **Note on Powerlevel10k:** After the playbook finishes, run `p10k configure` in a new terminal to set up your prompt style.
diff --git a/group_vars/all.yml b/group_vars/all.yml
@@ -1,9 +0,0 @@
----
-# QA workstation packages — extend as needed
-homebrew_packages:
- - git
- - wget
- - curl
- - jq
-
-homebrew_casks: []
diff --git a/roles/chrome/tasks/main.yml b/roles/chrome/tasks/main.yml
@@ -2,6 +2,6 @@
- name: Install Google Chrome
community.general.homebrew_cask:
name: google-chrome
- state: present
+ state: latest
environment:
HOMEBREW_NO_AUTO_UPDATE: "1"
diff --git a/roles/homebrew/defaults/main.yml b/roles/homebrew/defaults/main.yml
@@ -1,5 +1,3 @@
---
homebrew_prefix_arm: /opt/homebrew
homebrew_prefix_intel: /usr/local
-homebrew_packages: []
-homebrew_casks: []
diff --git a/roles/homebrew/tasks/main.yml b/roles/homebrew/tasks/main.yml
@@ -22,19 +22,3 @@
state: present
environment:
HOMEBREW_NO_AUTO_UPDATE: "1"
-
-- name: Install Homebrew packages
- community.general.homebrew:
- name: "{{ homebrew_packages }}"
- state: present
- environment:
- HOMEBREW_NO_AUTO_UPDATE: "1"
- when: homebrew_packages | length > 0
-
-- name: Install Homebrew casks
- community.general.homebrew_cask:
- name: "{{ homebrew_casks }}"
- state: present
- environment:
- HOMEBREW_NO_AUTO_UPDATE: "1"
- when: homebrew_casks | length > 0
diff --git a/roles/iterm2/tasks/main.yml b/roles/iterm2/tasks/main.yml
@@ -2,7 +2,7 @@
- name: Install iTerm2
community.general.homebrew_cask:
name: iterm2
- state: present
+ state: latest
environment:
HOMEBREW_NO_AUTO_UPDATE: "1"
diff --git a/roles/mas/meta/main.yml b/roles/mas/meta/main.yml
@@ -0,0 +1,3 @@
+---
+dependencies:
+ - role: homebrew
diff --git a/roles/mas/tasks/main.yml b/roles/mas/tasks/main.yml
@@ -0,0 +1,7 @@
+---
+- name: Install mas
+ community.general.homebrew:
+ name: mas
+ state: latest
+ environment:
+ HOMEBREW_NO_AUTO_UPDATE: "1"
diff --git a/roles/obs/meta/main.yml b/roles/obs/meta/main.yml
@@ -0,0 +1,3 @@
+---
+dependencies:
+ - role: homebrew
diff --git a/roles/obs/tasks/main.yml b/roles/obs/tasks/main.yml
@@ -0,0 +1,7 @@
+---
+- name: Install OBS
+ community.general.homebrew_cask:
+ name: obs
+ state: latest
+ environment:
+ HOMEBREW_NO_AUTO_UPDATE: "1"
diff --git a/roles/powerlevel10k/tasks/main.yml b/roles/powerlevel10k/tasks/main.yml
@@ -9,7 +9,7 @@
- name: Install powerlevel10k
community.general.homebrew:
name: powerlevel10k
- state: present
+ state: latest
environment:
HOMEBREW_NO_AUTO_UPDATE: "1"
diff --git a/roles/xcode_app/meta/main.yml b/roles/xcode_app/meta/main.yml
@@ -0,0 +1,3 @@
+---
+dependencies:
+ - role: mas
diff --git a/roles/xcode_app/tasks/main.yml b/roles/xcode_app/tasks/main.yml
@@ -0,0 +1,17 @@
+---
+- name: Check App Store sign-in
+ ansible.builtin.command:
+ cmd: mas account
+ register: mas_account
+ failed_when: false
+ changed_when: false
+
+- name: Fail if not signed into App Store
+ ansible.builtin.fail:
+ msg: "Sign into the Mac App Store before running this playbook (System Settings → App Store)."
+ when: mas_account.rc != 0
+
+- name: Install Xcode
+ community.general.mas:
+ id: 497799835
+ state: present
diff --git a/site.yml b/site.yml
@@ -3,9 +3,17 @@
hosts: mac
gather_facts: true
roles:
- - xcode_cli
- - homebrew
- - xcode_app
- - chrome
- - iterm2
- - powerlevel10k
+ - role: homebrew
+ tags: homebrew
+ - role: mas
+ tags: mas
+ - role: xcode_app
+ tags: xcode_app
+ - role: chrome
+ tags: chrome
+ - role: iterm2
+ tags: iterm2
+ - role: powerlevel10k
+ tags: powerlevel10k
+ - role: obs
+ tags: obs