ceph / ceph/cephmetrics

merge_vars.yml does not allow for extravars

Open
#232 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
66
Forks
29
PR merge metrics
No merged PRs in 30d

Description

Attempting to set values for `ceph-grafana` and `ceph-prometheus` (all?) roles seems to be thwarted by the `merge_vars.yml` task.

```bash
ansible-playbook -v \
-e '{"prometheus":{"container_name":"docker-hub.example.com:5000/openshift3/prometheus", "version":"latest"}}' \
-e '{"grafana":{"container_name":"docker-hub.example.com:5000/rhceph/rhceph-3-dashboard-rhel7", "version":"latest"}}' \
/usr/share/cephmetrics-ansible/playbook.yml

...
TASK [ceph-prometheus : Create prometheus data directory] ***********************************************************************************************************
fatal: [ceph-admin]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'dict object' has no attribute 'user_id'\n\nThe error appears to have been in '/usr/share/cephmetrics-ansible/roles/ceph-prometheus/tasks/main.yml': line 14, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Create prometheus data directory\n ^ here\n"}
```

If the values instead are placed in `roles/ceph-{grafana,prometheus}/defaults/main.yml` and run like this it will work:

```bash
ansible-playbook -v \
/usr/share/cephmetrics-ansible/playbook.yml
```

This of course defeats the purpose of ansible variables however. I shouldn't have to modify the content of the playbook to run it. I'm not sure why merge_vars.yml even exists really, but it seems to have a logic problem.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.