Skip to content

merge_vars.yml does not allow for extravars #232

@dlbewley

Description

@dlbewley

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

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:

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions