Replace dummy 1.1.1.1 values for graphite_host, grafana_host

This adds a sanity check that will fail if the user has not filled out
the grafana_host and graphite_host values in group_vars/all.yml

It will cause the grafana playbook execution to fail with a debug warning
which is cleaner than having it execute all the way through only to fail later.

We would ship these entries defined but empty as a result.

Patchset #2: correct typo in commit title
Patchset #3: move to top of playbook so if it fails it will be right away.
Patchset #4: README.MD update: specify that these values need to be filled in

Change-Id: I333798398ee0a84d1af51b9344b7c4798aad2043
This commit is contained in:
Will Foster 2016-06-03 12:26:01 +01:00
parent 009ce02548
commit b29d74f4de
3 changed files with 11 additions and 2 deletions

View File

@ -93,6 +93,7 @@ the docker related settings will work with your target host.
##### Install grafana service
Prior to installing grafana, please review install/group_vars/all.yml file and your ansible inventory file
You will need to define values for the grafana_host and graphite_host IP addresses here.
```
# ansible-playbook -i hosts install/grafana.yml
```

View File

@ -67,7 +67,8 @@ grafana_docker_image: grafana/grafana:2.6.0
# Graphite Configuration
########################################
# Graphite Server ip address (Collectd -> Graphite server)
graphite_host: 1.1.1.1
# you must fill out graphite_host prior to playbook execution
graphite_host:
graphite_port: 80
# Graphite prefix / Cloud name used both with graphite and grafana dashboards
graphite_prefix: openstack
@ -79,7 +80,8 @@ graphite_password: calvin
# Grafana Dashboarding Configuration
########################################
# Grafana Server IP Address/Port (Can be hosted on the Graphite server)
grafana_host: 1.1.1.1
# you must fill out grafana_host prior to playbook execution
grafana_host:
grafana_port: 3000
grafana_username: admin
grafana_password: admin

View File

@ -3,6 +3,12 @@
# Install/run grafana-server for browbeat
#
# check that grafana_host and graphite_host is entered prior to playbook run
- name: Check Graphite/Grafana Host IP Address
fail:
msg="** Edit grafana_host and graphite_host in ../install/group_vars/all.yml before running **"
when: ((grafana_host is none) and (graphite_host is none))
- name: Import EPEL GPG Key
rpm_key: key=https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7
state=present