Skip to content
Snippets Groups Projects
  • Doug Szumski's avatar
    28546710
    Local connection to remote Grafana can fail · 28546710
    Doug Szumski authored
    Following deployment of Grafana, a check is made to ensure that the
    login page is accessible. If the Grafana container has been deployed
    to a remote host, but is not directly accessible over the deployment
    network then the check will fail because the task is set to run with
    connection: local. For example, if Ansible is using a different
    network to the network on which grafana is exposed to connect to the
    remote host then the task may fail. A similar problem exists for the
    remaining two tasks in the post_config file.
    
    Further to this, if Grafana is not accessible, the ansible uri
    module does not return a status field, so no retry attempts are made
    and the task fails with an obscure message:
    
    TASK [grafana : Wait for grafana application ready] *****************
    fatal: [some_remote_node]: FAILED! => {"failed": true, "msg": "The
    conditional check 'result.status == 200' failed. The error was: error
    while evaluating conditional (result.status == 200): 'dict object' has
    no attribute 'status'"}
    
    $ ansible --version
    ansible 2.3.2.0
      config file = /etc/ansible/ansible.cfg
      configured module search path = Default w/o overrides
      python version = 2.7.5 (default, Aug 4 2017, 00:39:18) [GCC 4.8.5 20150623
    (Red Hat 4.8.5-16)]
    
    Change-Id: I77e2129b4a1c5f2f0802fb92eb03395ff72cf5f3
    Closes-Bug: #1742501
    28546710
    History
    Local connection to remote Grafana can fail
    Doug Szumski authored
    Following deployment of Grafana, a check is made to ensure that the
    login page is accessible. If the Grafana container has been deployed
    to a remote host, but is not directly accessible over the deployment
    network then the check will fail because the task is set to run with
    connection: local. For example, if Ansible is using a different
    network to the network on which grafana is exposed to connect to the
    remote host then the task may fail. A similar problem exists for the
    remaining two tasks in the post_config file.
    
    Further to this, if Grafana is not accessible, the ansible uri
    module does not return a status field, so no retry attempts are made
    and the task fails with an obscure message:
    
    TASK [grafana : Wait for grafana application ready] *****************
    fatal: [some_remote_node]: FAILED! => {"failed": true, "msg": "The
    conditional check 'result.status == 200' failed. The error was: error
    while evaluating conditional (result.status == 200): 'dict object' has
    no attribute 'status'"}
    
    $ ansible --version
    ansible 2.3.2.0
      config file = /etc/ansible/ansible.cfg
      configured module search path = Default w/o overrides
      python version = 2.7.5 (default, Aug 4 2017, 00:39:18) [GCC 4.8.5 20150623
    (Red Hat 4.8.5-16)]
    
    Change-Id: I77e2129b4a1c5f2f0802fb92eb03395ff72cf5f3
    Closes-Bug: #1742501