fix addpkg paths

This commit is contained in:
Matthew Stobbs
2025-01-23 00:34:01 -07:00
parent 0f2d22f3c5
commit 29d9cafdd2
2 changed files with 17 additions and 15 deletions

View File

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