--- # # Generate Openstack collectd to graphite dashboards # - name: Generate All Openstack Nodes CPU/Memory/Disk/Network Dashboards template: src: "{{item}}.json.j2" dest: "{{role_path}}/files/{{item}}.json" with_items: - all_cpu_graphs - all_memory_graphs - all_disk_graphs - all_network_graphs - name: Remove Existing Dashboards command: "curl -X DELETE -H 'Content-Type: application/json' http://{{grafana_username}}:{{grafana_password}}@{{grafana_host}}:{{grafana_port}}/api/dashboards/db/{{item}}" when: overwrite_existing with_items: - "{{dashboard_cloud_name}}-all-nodes-cpu" - "{{dashboard_cloud_name}}-all-nodes-memory" - "{{dashboard_cloud_name}}-all-nodes-disk" - "{{dashboard_cloud_name}}-all-nodes-network" - openstack-general-system-performance - cloud-system-performance-comparsion - name: Upload Dashboards to Grafana command: "curl -X POST -H 'Content-Type: application/json' -d @{{item}} http://{{grafana_username}}:{{grafana_password}}@{{grafana_host}}:{{grafana_port}}/api/dashboards/db" with_items: - "{{role_path}}/files/all_cpu_graphs.json" - "{{role_path}}/files/all_memory_graphs.json" - "{{role_path}}/files/all_disk_graphs.json" - "{{role_path}}/files/all_network_graphs.json" - "{{role_path}}/files/openstack_general_system_performance.json" - "{{role_path}}/files/cloud_system_performance_comparsion.json" - name: Remove leftover json file(s) file: path={{item}} state=absent with_items: - "{{role_path}}/files/all_cpu_graphs.json" - "{{role_path}}/files/all_memory_graphs.json" - "{{role_path}}/files/all_disk_graphs.json" - "{{role_path}}/files/all_network_graphs.json"