fix darwin packages

This commit is contained in:
Matthew Stobbs
2025-01-21 21:01:05 -07:00
parent e7dda0a092
commit 15d39f39ee
24 changed files with 54 additions and 51 deletions

View File

@@ -1,23 +1,22 @@
---
- name: check if task for "{{pkg}}" exists
- name: "check if task for {{ansible_os_family}}/{{pkg}} exists"
ansible.builtin.command: "test -f {{role_path}}/tasks/pkgs/{{ ansible_os_family }}/{{ pkg }}.yml"
register: cpkg_exists
ignore_errors: true
failed_when: cpkg_exists.rc == 127
failed_when: not (cpkg_exists.rc != 0 or cpkg_exists.rc != 1)
- debug:
var: cpkg_exists
- name: add include task for "{{pkg}}"
- name: "add include task for {{ansible_os_family}}/{{pkg}}"
ansible.builtin.include_tasks:
file: "pkgs/{{ ansible_os_family }}/{{ pkg }}.yml"
when: cpkg_exists.rc == 0
tags:
- packages
- name: add "{{pkg}}" to syspkgs
- name: "add {{pkg}} to syspkgs if task doesn't exist: {{assume_missing_is_syspkg}}"
ansible.builtin.set_fact:
syspkgs: "{{ syspkgs + [pkg] }}"
when: cpkg_exists.rc == 1
when:
- cpkg_exists.rc == 1
- assume_missing_is_syspkg
tags:
- packages