question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Variable validation fails for `dedicated_devices` if it's a combination of lists

See original GitHub issue

Bug Report

What happened:

I tested following scenarios: 1)

devices:
  - /dev/loop0
  - /dev/loop1
  - /dev/loop2
  - /dev/loop3
dedicated_devices:
  - /dev/loop4
  - /dev/loop5
  - /dev/loop6
  - /dev/loop7
some_disks:
  - /dev/loop0
  - /dev/loop1
  - /dev/loop2
  - /dev/loop3
some_other_disks:
  - /dev/loop4
  - /dev/loop5
  - /dev/loop6
  - /dev/loop7
devices: "{{ some_disks }}"
dedicated_devices: "{{ some_other_disks }}"
some_disks:
  - /dev/loop0
  - /dev/loop1
  - /dev/loop2
  - /dev/loop3
  - /dev/loop4
  - /dev/loop5
some_other_disks:
  - /dev/loop6
  - /dev/loop7
devices: "{{ some_disks[0:4] }}"
dedicated_devices: "{{ some_disks[4:6] + some_other_disks }}"
  1. and 2) work without issues, 3) fails for every OSD with the following message:
TASK [ceph-validate : validate provided configuration] **************************************************
task path: /home/mnarusze/ceph/ceph-ansible/roles/ceph-validate/tasks/main.yml:2
Friday 19 October 2018  08:11:29 +0000 (0:00:00.667)       0:00:39.164 ********
 [ERROR]: [ceph-osd-1] Validation failed for variable: dedicated_devices

The full traceback is:
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/ansible/executor/task_executor.py", line 139, in run
    res = self._execute()
  File "/usr/lib/python2.7/site-packages/ansible/executor/task_executor.py", line 584, in _execute
    result = self._handler.run(task_vars=variables)
  File "/home/mnarusze/ceph/ceph-ansible/plugins/actions/validate.py", line 99, in run
    given = "[{}] Given value for {}: {}".format(host, error.path[0], error.path[1])
IndexError: list index out of range

fatal: [ceph-osd-1]: FAILED! => {
    "msg": "Unexpected failure during module execution.", 
    "stdout": ""
}

What you expected to happen:

I expect all scenarios to work

Environment:

  • OS (e.g. from /etc/os-release): CentOS 7.5.1804
  • Kernel (e.g. uname -a): 3.10.0-693
  • Ansible version (e.g. ansible-playbook --version): 2.6.5
  • ceph-ansible version (e.g. git head or tag or stable branch): stable-3.2
  • Ceph version (e.g. ceph -v): luminous

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
rishabh-d-davecommented, Nov 2, 2018

Since I think the issue of expanding all or a lot of Ansible variables can be common for all Ansible plugins I have reported the issue to Ansible’s bug tracker[1]. If that doesn’t happen there, I would go forward and add the fix to ceph-ansible’s codebase.

1reaction
guitscommented, Oct 19, 2018

should be fixed by #3210

Read more comments on GitHub >

github_iconTop Results From Across the Web

Validation block should allow validation of list of values #24223
This validation block works for a single input variable. variable "mytestname" { validation { condition = length(regexall("^test", var.
Read more >
Validate list(object) variables - Terraform - HashiCorp Discuss
Hi i am trying to add validations for list of an object type: variable ... 'am trying to see if there is any...
Read more >
1648168 – ceph-validate : devices are not validated in non ...
This caused errors when `ceph-disk`, `parted`, or other device preparation tools failed to operate on devices that did not exist.
Read more >
Terraform - How to restrict an input variable to a list of possible ...
Stumbled across this question. Since v0.13.0 input validation has been possible directly via the input variables.
Read more >
Corporate-owned Android Enterprise device restriction ...
On Android Enterprise or Android for Work devices owned by your organization, you can restrict settings on the device using Microsoft Intune ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found