Snapshots via Grafana Anonymous Access

+ Anonymous access on grafana allows pngs to be rendered without authentication
+ Fixed ansible 2.0 depreciation warning.
+ Specify ansible_python_interpreter to avoid following issue:
  - https://github.com/ansible/ansible/issues/13773

Change-Id: I2f68d8e9ad5f9f39befb05a023cc68b1de754e94
This commit is contained in:
Alex Krzos 2016-03-30 23:15:16 -04:00
parent cc5fee596b
commit 86dba51a41
8 changed files with 17 additions and 17 deletions

View File

@ -4,20 +4,20 @@
#
- name: Generate General Snapshots
shell: "mkdir -p /home/stack/browbeat/{{results_dir}}/{{item[0]}}/; curl -X GET -H 'Authorization: Bearer {{grafana_api_key}}' 'http://{{grafana_ip}}:{{grafana_port}}/render/dashboard-solo/db/openstack-general-system-performance?panelId={{item[1].panelId}}&from={{from}}&to={{to}}&var-Cloud={{var_cloud}}&var-Node={{item[0]}}{{host_suffix}}&var-Interface=interface-test&var-Disk=disk-sda&width=1200' > /home/stack/browbeat/{{results_dir}}/{{item[0]}}/{{item[0]}}-{{item[1].name}}.png"
shell: "mkdir -p /home/stack/browbeat/{{results_dir}}/{{item[0]}}/; curl -X GET 'http://{{grafana_ip}}:{{grafana_port}}/render/dashboard-solo/db/openstack-general-system-performance?panelId={{item[1].panelId}}&from={{from}}&to={{to}}&var-Cloud={{var_cloud}}&var-Node={{item[0]}}{{host_suffix}}&var-Interface=interface-test&var-Disk=disk-sda&width=1200' > /home/stack/browbeat/{{results_dir}}/{{item[0]}}/{{item[0]}}-{{item[1].name}}.png"
with_nested:
- "{{ hosts_in_group }}"
- "{{ general_panels }}"
- name: Generate Disk Snapshots
shell: "mkdir -p /home/stack/browbeat/{{results_dir}}/{{item[0]}}/;curl -X GET -H 'Authorization: Bearer {{grafana_api_key}}' 'http://{{grafana_ip}}:{{grafana_port}}/render/dashboard-solo/db/openstack-general-system-performance?panelId={{item[2].panelId}}&from={{from}}&to={{to}}&var-Cloud={{var_cloud}}&var-Node={{item[0]}}{{host_suffix}}&var-Interface=interface-test&var-Disk=disk-{{item[1]}}&width=1200' > /home/stack/browbeat/{{results_dir}}/{{item[0]}}/{{item[0]}}-{{item[2].name}}-{{item[1]}}.png"
shell: "mkdir -p /home/stack/browbeat/{{results_dir}}/{{item[0]}}/;curl -X GET 'http://{{grafana_ip}}:{{grafana_port}}/render/dashboard-solo/db/openstack-general-system-performance?panelId={{item[2].panelId}}&from={{from}}&to={{to}}&var-Cloud={{var_cloud}}&var-Node={{item[0]}}{{host_suffix}}&var-Interface=interface-test&var-Disk=disk-{{item[1]}}&width=1200' > /home/stack/browbeat/{{results_dir}}/{{item[0]}}/{{item[0]}}-{{item[2].name}}-{{item[1]}}.png"
with_nested:
- "{{ hosts_in_group }}"
- "{{ disks_in_group }}"
- "{{ disk_panels }}"
- name: Generate Interface Snapshots
shell: "mkdir -p /home/stack/browbeat/{{results_dir}}/{{item[0]}}/;curl -X GET -H 'Authorization: Bearer {{grafana_api_key}}' 'http://{{grafana_ip}}:{{grafana_port}}/render/dashboard-solo/db/openstack-general-system-performance?panelId={{item[2].panelId}}&from={{from}}&to={{to}}&var-Cloud={{var_cloud}}&var-Node={{item[0]}}{{host_suffix}}&var-Interface=interface-{{item[1]}}&var-Disk=disk-sda&width=1200' > /home/stack/browbeat/{{results_dir}}/{{item[0]}}/{{item[0]}}-{{item[2].name}}-{{item[1]}}.png"
shell: "mkdir -p /home/stack/browbeat/{{results_dir}}/{{item[0]}}/;curl -X GET 'http://{{grafana_ip}}:{{grafana_port}}/render/dashboard-solo/db/openstack-general-system-performance?panelId={{item[2].panelId}}&from={{from}}&to={{to}}&var-Cloud={{var_cloud}}&var-Node={{item[0]}}{{host_suffix}}&var-Interface=interface-{{item[1]}}&var-Disk=disk-sda&width=1200' > /home/stack/browbeat/{{results_dir}}/{{item[0]}}/{{item[0]}}-{{item[2].name}}-{{item[1]}}.png"
with_nested:
- "{{ hosts_in_group }}"
- "{{ interfaces_in_group }}"

View File

@ -3,42 +3,48 @@
# Snapshot Dashboard
#
# Example Usage:
# ansible-playbook -i hosts browbeat/snapshot-general-performance-dashboard.yml -e "grafana_ip=1.1.1.1 grafana_port=3000 grafana_api_key=<apikey> from=1455649200000 to=1455656400000 results_dir=results/ var_cloud=openstack"
# ansible-playbook -i hosts browbeat/snapshot-general-performance-dashboard.yml -e "grafana_ip=1.1.1.1 grafana_port=3000 from=1455649200000 to=1455656400000 results_dir=results/ var_cloud=openstack"
#
# Append snapshot_compute=true to run snapshots against computes.
#
- hosts: undercloud
- hosts: localhost
gather_facts: false
remote_user: stack
vars:
ansible_connection: local
ansible_python_interpreter: "/usr/bin/python"
host_type: undercloud
host_suffix: ""
hosts_in_group: groups['undercloud']
hosts_in_group: "{{groups['undercloud']}}"
disks_in_group: "{{disks['undercloud']}}"
interfaces_in_group: "{{interfaces['undercloud']}}"
roles:
- grafana-snapshot
- hosts: undercloud
- hosts: localhost
gather_facts: false
remote_user: stack
vars:
ansible_connection: local
ansible_python_interpreter: "/usr/bin/python"
host_type: controller
host_suffix: ""
hosts_in_group: groups['controller']
hosts_in_group: "{{groups['controller']}}"
disks_in_group: "{{disks['controller']}}"
interfaces_in_group: "{{interfaces['controller']}}"
roles:
- grafana-snapshot
- hosts: undercloud
- hosts: localhost
gather_facts: false
remote_user: stack
vars:
ansible_connection: local
ansible_python_interpreter: "/usr/bin/python"
host_type: compute
host_suffix: ""
hosts_in_group: groups['compute']
hosts_in_group: "{{groups['compute']}}"
disks_in_group: "{{disks['compute']}}"
interfaces_in_group: "{{interfaces['compute']}}"
roles:

View File

@ -22,7 +22,6 @@ grafana:
- openstack-general-system-performance
snapshot:
enabled: false
grafana_api_key: (Your API Key Here)
snapshot_compute: false
perfkit:
enabled: true

View File

@ -22,7 +22,6 @@ grafana:
- openstack-general-system-performance
snapshot:
enabled: false
grafana_api_key: (Your API Key Here)
snapshot_compute: false
perfkit:
enabled: true

View File

@ -23,7 +23,6 @@ grafana:
- openstack-general-system-performance
snapshot:
enabled: false
grafana_api_key: (Your API Key Here)
snapshot_compute: false
rally:
enabled: true

View File

@ -23,7 +23,6 @@ grafana:
- openstack-general-system-performance
snapshot:
enabled: false
grafana_api_key: (Your API Key Here)
snapshot_compute: false
rally:
enabled: true

View File

@ -22,7 +22,6 @@ grafana:
- openstack-general-system-performance
snapshot:
enabled: false
grafana_api_key: (Your API Key Here)
snapshot_compute: false
perfkit:
enabled: true
@ -141,4 +140,4 @@ perfkit:
- name: unixbench-centos-m1-small
enabled: false
benchmarks: unixbench
data_disk_size: 10
data_disk_size: 10

View File

@ -15,7 +15,6 @@ class Grafana:
def get_extra_vars(self, from_ts, to_ts, result_dir, test_name):
extra_vars = 'grafana_ip={} '.format(self.config['grafana']['grafana_ip'])
extra_vars += 'grafana_port={} '.format(self.config['grafana']['grafana_port'])
extra_vars += 'grafana_api_key={} '.format(self.config['grafana']['snapshot']['grafana_api_key'])
extra_vars += 'from={} '.format(from_ts)
extra_vars += 'to={} '.format(to_ts)
extra_vars += 'results_dir={}/{} '.format(result_dir, test_name)