Skip to content

Commit

Permalink
chore(meta): add argument_specs, fallback tasks main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
adf-patrickha committed Feb 16, 2024
1 parent 5ac45b9 commit 523a07a
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 22 deletions.
8 changes: 6 additions & 2 deletions meta/argument_specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ argument_specs:
options:
bareos_dir_backup_configurations:
type: "bool"
default: no
default: false
description: "Backup the configuration files."
bareos_dir_hostname:
type: "str"
Expand Down Expand Up @@ -85,5 +85,9 @@ argument_specs:
description: "A list of storages to configure."
bareos_dir_install_debug_packages:
type: "bool"
default: no
default: false
description: "Install debug packages. This requires the debug repositories to be enabled."
bareos_dir_plugins:
type: "list"
default: []
description: "A list of Bareos Director plugins"
47 changes: 27 additions & 20 deletions tasks/assert.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,141 +5,148 @@
that:
- bareos_dir_backup_configurations is defined
- bareos_dir_backup_configurations is boolean
quiet: yes
quiet: true

- name: assert | Test bareos_dir_hostname
ansible.builtin.assert:
that:
- bareos_dir_hostname is defined
- bareos_dir_hostname is string
- bareos_dir_hostname != ""
quiet: yes
quiet: true

- name: assert | Test bareos_dir_password
ansible.builtin.assert:
that:
- bareos_dir_password is defined
- bareos_dir_password is string
- bareos_dir_password != ""
quiet: yes
quiet: true

- name: assert | Test bareos_dir_queryfile
ansible.builtin.assert:
that:
- bareos_dir_queryfile is defined
- bareos_dir_queryfile is string
- bareos_dir_queryfile != ""
quiet: yes
quiet: true

- name: assert | Test bareos_dir_max_concurrent_jobs
ansible.builtin.assert:
that:
- bareos_dir_max_concurrent_jobs is defined
- bareos_dir_max_concurrent_jobs is number
quiet: yes
quiet: true

- name: assert | Test bareos_dir_message
ansible.builtin.assert:
that:
- bareos_dir_message is defined
- bareos_dir_message is string
- bareos_dir_message != ""
quiet: yes
quiet: true

- name: assert | Test bareos_dir_tls_enable
ansible.builtin.assert:
that:
- bareos_dir_tls_enable is defined
- bareos_dir_tls_enable is boolean
quiet: yes
quiet: true

- name: assert | Test bareos_dir_tls_verify_peer
ansible.builtin.assert:
that:
- bareos_dir_tls_verify_peer is defined
- bareos_dir_tls_verify_peer is boolean
quiet: yes
quiet: true

- name: assert | Test bareos_dir_catalogs
ansible.builtin.assert:
that:
- bareos_dir_catalogs is defined
- bareos_dir_catalogs is iterable
quiet: yes
quiet: true

- name: assert | Test bareos_dir_consoles
ansible.builtin.assert:
that:
- bareos_dir_consoles is defined
- bareos_dir_consoles is iterable
quiet: yes
quiet: true

- name: assert | Test bareos_dir_clients
ansible.builtin.assert:
that:
- bareos_dir_clients is defined
- bareos_dir_clients is iterable
quiet: yes
quiet: true

- name: assert | Test bareos_dir_filesets
ansible.builtin.assert:
that:
- bareos_dir_filesets is defined
- bareos_dir_filesets is iterable
quiet: yes
quiet: true

- name: assert | Test bareos_dir_jobdefs
ansible.builtin.assert:
that:
- bareos_dir_jobdefs is defined
- bareos_dir_jobdefs is iterable
quiet: yes
quiet: true

- name: assert | Test bareos_dir_jobs
ansible.builtin.assert:
that:
- bareos_dir_jobs is defined
- bareos_dir_jobs is iterable
quiet: yes
quiet: true

- name: assert | Test bareos_dir_messages
ansible.builtin.assert:
that:
- bareos_dir_messages is defined
- bareos_dir_messages is iterable
quiet: yes
quiet: true

- name: assert | Test bareos_dir_pools
ansible.builtin.assert:
that:
- bareos_dir_pools is defined
- bareos_dir_pools is iterable
quiet: yes
quiet: true

- name: assert | Test bareos_dir_profiles
ansible.builtin.assert:
that:
- bareos_dir_profiles is defined
- bareos_dir_profiles is iterable
quiet: yes
quiet: true

- name: assert | Test bareos_dir_schedules
ansible.builtin.assert:
that:
- bareos_dir_schedules is defined
- bareos_dir_schedules is iterable
quiet: yes
quiet: true

- name: assert | Test bareos_dir_storages
ansible.builtin.assert:
that:
- bareos_dir_storages is defined
- bareos_dir_storages is iterable
quiet: yes
quiet: true

- name: assert | Test bareos_dir_install_debug_packages
ansible.builtin.assert:
that:
- bareos_dir_install_debug_packages is defined
- bareos_dir_install_debug_packages is boolean
quiet: yes
quiet: true

- name: assert | Test bareos_dir_plugins
ansible.builtin.assert:
that:
- bareos_dir_plugins is defined
- bareos_dir_plugins is iterable
quiet: true
1 change: 1 addition & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
with_first_found:
- "{{ ansible_facts.distribution }}_{{ ansible_facts.distribution_major_version }}.yml"
- "{{ ansible_facts.os_family }}.yml"
- main.yml # use main.yml if no match was found

- name: Import assert.yml
ansible.builtin.import_tasks:
Expand Down

0 comments on commit 523a07a

Please sign in to comment.