Skip to content
This repository was archived by the owner on May 31, 2023. It is now read-only.
This repository was archived by the owner on May 31, 2023. It is now read-only.

cast grafana_port to int before comparing it to 1024 #212

@kapouer

Description

@kapouer

What happened?

The conditional check 'grafana_port <= 1024' failed.
The error was: Unexpected templating type error occurred on ({% if grafana_port <= 1024 %} True {% else %} False {% endif %}): '<=' not supported between instances of 'str' and 'int'
The error appears to be in '/home/dev/.ansible/roles/cloudalchemy.grafana/tasks/preflight.yml': line 80

Did you expect to see some different?
grafana_port should be settable using jinja templates.

How to reproduce it (as minimally and precisely as possible):

  • set_fact: myport=9999
    ...
    grafana_port: "{{ myport }}"

Environment
debian/sid

  • Role version:
    0.16.2

  • Ansible version information:
    2.9.6

  • What else ? *

I tried to use the | int filter but it won't work. "Jinja always output strings".

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions