Skip to content

Commit

Permalink
fix(vars): move OS-specific vars to separate files
Browse files Browse the repository at this point in the history
  • Loading branch information
adf-patrickha committed Jul 18, 2024
1 parent 344fab9 commit ce9b53e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
8 changes: 7 additions & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
---
# tasks file for bareos_sd

- name: Include OS-specific vars
ansible.builtin.include_vars: "{{ item }}"
with_first_found:
- "{{ ansible_facts.distribution }}_{{ ansible_facts.distribution_major_version }}.yml"
- "{{ ansible_facts.os_family }}.yml"

- name: Import assert.yml
ansible.builtin.import_tasks:
file: assert.yml
run_once: yes
run_once: true
delegate_to: localhost

- name: Install packages
Expand Down
5 changes: 5 additions & 0 deletions vars/Debian.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---

bareos_sd_debug_packages:
- bareos-dbg
- gdb
15 changes: 3 additions & 12 deletions vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,6 @@ bareos_sd_packages:
- bareos-storage
- bareos-storage-tape

# A map to define the packages to install for debugging.
_bareos_sd_debug_packages:
default:
- bareos-storage-debuginfo
- gdb
Debian:
- bareos-dbg
- gdb
RedHat-7:
- bareos-debuginfo
- gdb
bareos_sd_debug_packages: "{{ _bareos_sd_debug_packages[ansible_os_family ~ '-' ~ ansible_distribution_major_version] | default(_bareos_sd_debug_packages[ansible_os_family] | default(_bareos_sd_debug_packages['default'])) }}"
bareos_sd_debug_packages:
- bareos-storage-debuginfo
- gdb

0 comments on commit ce9b53e

Please sign in to comment.