aboutsummaryrefslogtreecommitdiffstats
path: root/deployment/onap-lab-ci/heat/grafana/grafana_vm_config.yaml
diff options
context:
space:
mode:
Diffstat (limited to 'deployment/onap-lab-ci/heat/grafana/grafana_vm_config.yaml')
-rw-r--r--deployment/onap-lab-ci/heat/grafana/grafana_vm_config.yaml61
1 files changed, 61 insertions, 0 deletions
diff --git a/deployment/onap-lab-ci/heat/grafana/grafana_vm_config.yaml b/deployment/onap-lab-ci/heat/grafana/grafana_vm_config.yaml
new file mode 100644
index 000000000..1151d7095
--- /dev/null
+++ b/deployment/onap-lab-ci/heat/grafana/grafana_vm_config.yaml
@@ -0,0 +1,61 @@
+#cloud-config
+# vim: syntax=yaml
+write_files:
+- path: /opt/format-disks
+ permissions: '0700'
+ content: |
+ #!/bin/bash
+ voldata_id="%voldata_id%"
+ voldata_dev="/dev/disk/by-id/virtio-$(echo ${voldata_id} | cut -c -20)"
+ mkfs.ext4 ${voldata_dev}
+ mkdir -pv /var/lib/influxdb
+ echo "${voldata_dev} /var/lib/influxdb ext4 defaults 1 2" >> /etc/fstab
+ mount /var/lib/influxdb
+- path: /opt/grafana_vm_entrypoint.sh
+ permissions: '0755'
+ content: |
+ #!/bin/bash -x
+
+ printenv
+
+ cp ~ubuntu/.ssh/authorized_keys /root/.ssh
+
+ cat > /etc/apt/apt.conf.d/90curtin-aptproxy<<EOF
+ Acquire::http::Proxy "http://10.145.122.117:8000/";
+ EOF
+
+ source /etc/lsb-release
+ curl -sL https://repos.influxdata.com/influxdb.key | sudo apt-key add -
+ echo "deb https://repos.influxdata.com/${DISTRIB_ID,,} ${DISTRIB_CODENAME} stable" | sudo tee /etc/apt/sources.list.d/influxdb.list
+ curl https://packagecloud.io/gpg.key | sudo apt-key add -
+ echo "deb https://packagecloud.io/grafana/stable/debian/ stretch main" | sudo tee /etc/apt/sources.list.d/grafana.list
+
+ apt-get update
+
+ cat >> /etc/inputrc <<EOF
+ set show-all-if-ambiguous on
+ set show-all-if-unmodified on
+ set match-hidden-files off
+ set mark-symlinked-directories on
+ EOF
+
+ export HOME=/root
+ apt-get -y install git
+ git config --global user.email "grafana@localhost"
+ git config --global user.name "grafana"
+ apt-get -y install etckeeper
+
+ apt-get -y install influxdb
+ apt-get -y install grafana
+
+ systemctl daemon-reload
+
+ systemctl enable influxdb
+ systemctl start influxdb
+
+ systemctl enable grafana-server.service
+ systemctl start grafana-server
+
+runcmd:
+- /opt/format-disks
+- /opt/grafana_vm_entrypoint.sh