Creating Influx data source with Ansible - TLS Skip Verify fails to initialize correctly

  • What Grafana version and what operating system are you using?
    Grafana 8.3.3 on RHEL7

  • What are you trying to achieve?
    Trying to create an influx data source with ansible

  • How are you trying to achieve it?
    Ansible playbook. Role looks like:

  • name: Create data source
    url: “https://{{ grafana_instance }}/api/datasources”
    url_username: “{{ grafana_admin_user }}”
    url_password: “{{ grafana_admin_pwd }}”
    method: POST
    force_basic_auth: yes
    body_format: json
    name : “{{ item.dsname }}”,
    url : “{{ http_prefix }}://{{ item.influx_vip }}:8086”,
    database : “{{ item.dbname }}”,
    type : influxdb,
    access : proxy,
    user : “{{ grafana_user }}”,
    jsondata : { tlsSkipVerify: “true” },
    securejsondata : { password : “{{ grafana_password }}” },
    validate_certs: no
    - “{{ data_source_info }}”
  • What happened?
    Data source is created. The TLS Skip Verify button is set to ‘true’. However, when I test the data source it says “Bad Gateway”. Toggling the TLS Skip Verify flag to false, back to true, then save and test - the data source works. What am I missing in initializing that flag?

  • What did you expect to happen?
    Expected the data source to work. Instead, I need to toggle the Skip TLS Verify flag manually.

  • Can you copy/paste the configuration(s) that you are having problems with?
    See ansible role above

  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.
    Don’t have access to the log files at the moment. I can probably get them if necessary.
    But toggling the one flag makes it work. Looks like the flag is set in the GUI but not active.
    The error from the GUI was “Bad Gateway”

  • Did you follow any online instructions? If so, what is the URL?
    No - used a combination of ansible URI documentation and looked at various Grafana and influx docs