mirror of
https://github.com/nicolabs/ansible-role-grub.git
synced 2025-09-21 00:31:42 +02:00
Assert variables.
This commit is contained in:
parent
7a4d42175b
commit
a4274a999f
25
tasks/assert.yml
Normal file
25
tasks/assert.yml
Normal file
|
@ -0,0 +1,25 @@
|
|||
---
|
||||
- name: test if grub_timeout is set correctly
|
||||
assert:
|
||||
that:
|
||||
- grub_timeout is defined
|
||||
- grub_timeout | int >= 0
|
||||
|
||||
- name: test if grub_options is set correctly
|
||||
assert:
|
||||
that:
|
||||
- grub_options | length > 0
|
||||
- grub_options is iterable
|
||||
when:
|
||||
- grub_options is defined
|
||||
|
||||
- name: test if item in grub_options is set correctly
|
||||
assert:
|
||||
that:
|
||||
- item.option is defined
|
||||
- item.option | length > 0
|
||||
- item.value is defined
|
||||
- item.value | length > 0
|
||||
loop: "{{ grub_options }}"
|
||||
when:
|
||||
- grub_options is defined
|
|
@ -1,5 +1,8 @@
|
|||
---
|
||||
# tasks file for grub
|
||||
- name: include assert.yml
|
||||
include_tasks: assert.yml
|
||||
|
||||
- name: install required packages
|
||||
package:
|
||||
name: "{{ grub_packages }}"
|
||||
|
|
Loading…
Reference in a new issue