Ansible: Add homebrew, system log, and main tasks for macOS to the eryn role

This commit is contained in:
Eryn Wells 2025-02-12 07:51:29 -08:00
parent 41dc68869a
commit 73ca945487
3 changed files with 48 additions and 0 deletions

View file

@ -0,0 +1,37 @@
---
- name: "macOS : homebrew : Does the brew command exist?"
ansible.builtin.stat:
path: /opt/homebrew/bin/brew
register: _eryn_homebrew_brew
- name: "macOS : homebrew : Install Homebrew"
when: not _eryn_homebrew_brew.stat.exists
block:
- name: "macOS : homebrew : Create temporary file for install script"
ansible.builtin.tempfile:
state: file
prefix: homebrew-install
register: _eryn_homebrew_install_script
- name: "macOS : homebrew : Set up homebrew"
block:
- name: "macOS : homebrew : Fetch install script"
ansible.builtin.get_url:
url: https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh
dest: "{{ _eryn_homebrew_install_script.path }}"
mode: "0644"
- name: "macOS : homebrew : Run install script"
ansible.builtin.command:
cmd: bash {{ _eryn_homebrew_install_script.path }}
environment:
NONINTERACTIVE: 1
- name: "macOS : homebrew : Gather package manager facts"
ansible.builtin.setup:
gather_subset: pkg_mgr
always:
- name: "macOS : homebrew : Remove temporary install script"
ansible.builtin.file:
path: "{{ _eryn_homebrew_install_script.path }}"
state: absent

View file

@ -0,0 +1,6 @@
---
- name: "macOS : Configure log utility"
ansible.builtin.import_tasks: macos/system-log.yml
- name: "macOS : Configure homebrew"
ansible.builtin.import_tasks: macos/homebrew.yml

View file

@ -0,0 +1,5 @@
---
- name: "macOS : log : Symlink config"
ansible.builtin.include_tasks: symlink_dotfile.yml
vars:
dotfile_src: logrc