From 9bd8fd54340134db5ffb244400ec741e5e522186 Mon Sep 17 00:00:00 2001 From: Sergey PR0STO Date: Thu, 9 May 2024 17:38:52 +0300 Subject: [PATCH 1/2] provide reuse the path of brew directory in parent play #99 --- roles/homebrew/tasks/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/roles/homebrew/tasks/main.yml b/roles/homebrew/tasks/main.yml index defe736..84c15a6 100644 --- a/roles/homebrew/tasks/main.yml +++ b/roles/homebrew/tasks/main.yml @@ -3,6 +3,7 @@ set_fact: homebrew_user: '{{ homebrew_user | default(ansible_user_id) }}' homebrew_group: '{{ homebrew_group | default(ansible_user_gid) }}' + homebrew_prefix: '{{ homebrew_prefix }}' # Homebrew setup prerequisites. - name: Ensure Homebrew parent directory has correct permissions (M1). From 279a8a57bcd946f641cee2a0588c3777f6897c91 Mon Sep 17 00:00:00 2001 From: Sergey PR0STO Date: Thu, 9 May 2024 21:06:34 +0300 Subject: [PATCH 2/2] Describe providing reuse the path of "brew" directory in parent play #99 --- roles/homebrew/README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/roles/homebrew/README.md b/roles/homebrew/README.md index 6c023ea..27ae580 100644 --- a/roles/homebrew/README.md +++ b/roles/homebrew/README.md @@ -105,6 +105,22 @@ Any additional folders inside `homebrew_prefix` for which to ensure homebrew use roles: - geerlingguy.mac.homebrew +## Example of including role + + - hosts: localhost + tasks: + - name: Install Homebrew + OpenJDK + ansible.builtin.include_role: + name: geerlingguy.mac.homebrew + vars: + homebrew_installed_packages: + - openjdk@17 + - name: Symlink OpenJDK to system-wide Java VMs + ansible.builtin.file: + state: link + src: "{{ homebrew_prefix }}/opt/openjdk@17/libexec/openjdk.jdk" + dest: /Library/Java/JavaVirtualMachines/openjdk-17.jdk + See the `tests/local-testing` directory for an example of running this role over Ansible's `local` connection. See also: [Mac Development Ansible Playbook][mac-dev-playbook].