]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commit
dashboard: add a last default value in grafana-server host section
authorGuillaume Abrioux <gabrioux@redhat.com>
Mon, 20 May 2019 14:32:08 +0000 (16:32 +0200)
committerGuillaume Abrioux <gabrioux@redhat.com>
Mon, 3 Jun 2019 11:36:38 +0000 (13:36 +0200)
commit5457312e6232ffc8df0c4e47e9914ff7322049e4
treed94062316ee343f6819cf2a6c5fa50eeed1e993c
parent6e2e30db54bafb271f7f5bd087f426e5762d9e7e
dashboard: add a last default value in grafana-server host section

If there is no mgrs and mons in the inventory, it will fail with the following error:

```
ERROR! The field 'hosts' has an invalid value, which includes an undefined variable. The error was: 'dict object' has no attribute 'mons'

The error appears to be in '/home/guits/ceph-ansible/site-docker.yml.sample': line 539, column 3, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

- hosts: '{{ (groups["mgrs"] | default(groups["mons"]))[0] }}'
  ^ here
We could be wrong, but this one looks like it might be an issue with
missing quotes. Always quote template expression brackets when they
start a value. For instance:

    with_items:
      - {{ foo }}

Should be written as:

    with_items:
      - "{{ foo }}"
```

let's add an  `omit` so it just display this message instead:

```
PLAY [[]] *******************
skipping: no hosts matched
```

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
site-container.yml.sample
site.yml.sample