Integrate Elasticsearch and Kibana with Fuel
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

pre_build_hook 3.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #!/bin/bash
  2. set -eux
  3. . "$(dirname "$(readlink -f "$0")")"/functions.sh
  4. # Puppet manifests
  5. CONCAT_TARBALL_URL="https://forgeapi.puppetlabs.com/v3/files/puppetlabs-concat-1.2.4.tar.gz"
  6. STDLIB_TARBALL_URL="https://forgeapi.puppetlabs.com/v3/files/puppetlabs-stdlib-4.7.0.tar.gz"
  7. ELASTICSEARCH_TARBALL_URL="https://forgeapi.puppetlabs.com/v3/files/elasticsearch-elasticsearch-0.10.1.tar.gz"
  8. # Dependency for Elasticsearch 0.10.x
  9. DATACAT_TARBALL_URL="https://forgeapi.puppetlabs.com/v3/files/richardc-datacat-0.6.2.tar.gz"
  10. FIREWALL_TARBALL_URL="https://forgeapi.puppetlabs.com/v3/files/puppetlabs-firewall-1.7.2.tar.gz"
  11. APACHE_TARBALL_URL="https://forgeapi.puppetlabs.com/v3/files/puppetlabs-apache-1.4.0.tar.gz"
  12. HTPASSWD_TARBALL_URL="https://forgeapi.puppetlabs.com/v3/files/leinaddm-htpasswd-0.0.3.tar.gz"
  13. TZ_VERSION="2016j-0ubuntu0.14.04_all"
  14. # Packages needed to install JRE headless
  15. download_packages http://mirrors.kernel.org/ubuntu/pool/main/p/pcsc-lite/libpcsclite1_1.8.10-1ubuntu1_amd64.deb \
  16. http://mirrors.kernel.org/ubuntu/pool/main/j/java-common/java-common_0.51_all.deb \
  17. "http://security.ubuntu.com/ubuntu/pool/main/t/tzdata/tzdata-java_${TZ_VERSION}.deb" \
  18. "http://security.ubuntu.com/ubuntu/pool/main/t/tzdata/tzdata_${TZ_VERSION}.deb" \
  19. http://security.ubuntu.com/ubuntu/pool/main/c/ca-certificates/ca-certificates_20160104ubuntu0.14.04.1_all.deb \
  20. http://mirrors.kernel.org/ubuntu/pool/main/c/ca-certificates-java/ca-certificates-java_20130815ubuntu1_all.deb \
  21. http://security.ubuntu.com/ubuntu/pool/main/o/openjdk-7/openjdk-7-jre-headless_7u121-2.6.8-1ubuntu0.14.04.3_amd64.deb \
  22. http://mirrors.kernel.org/ubuntu/pool/main/c/ca-certificates-java/ca-certificates-java_20130815ubuntu1_all.deb \
  23. https://download.elastic.co/kibana/kibana/kibana_4.5.1_amd64.deb \
  24. https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/deb/elasticsearch/2.3.3/elasticsearch-2.3.3.deb
  25. # Download curator and dependencies
  26. download_packages http://packages.elastic.co/curator/4/debian/pool/main/p/python/python-elasticsearch-curator_4.0.6_all.deb \
  27. http://packages.elastic.co/curator/4/debian/pool/main/p/python/python-elasticsearch_2.3.0_all.deb \
  28. http://packages.elastic.co/curator/4/debian/pool/main/p/python/python-click_6.6_all.deb \
  29. http://packages.elastic.co/curator/4/debian/pool/main/p/python/python-pyyaml_3.11_amd64.deb
  30. check_md5sum python-elasticsearch-curator_4.0.6_all.deb eb69388edf54aafa2445423f615c0817
  31. check_md5sum python-click_6.6_all.deb f508745fcd6f64a317cc94603b7f4f9d
  32. check_md5sum python-pyyaml_3.11_amd64.deb 9f4ef75d24f6bc92879e0c57dc4f4b71
  33. check_md5sum python-elasticsearch_2.3.0_all.deb 4d17c82d397fc57034d78e9d09ae400d
  34. # Install puppet manifests
  35. download_puppet_module "concat" "$CONCAT_TARBALL_URL"
  36. download_puppet_module "stdlib" "$STDLIB_TARBALL_URL"
  37. download_puppet_module "elasticsearch" "$ELASTICSEARCH_TARBALL_URL"
  38. download_puppet_module "firewall" "$FIREWALL_TARBALL_URL"
  39. download_puppet_module "datacat" "$DATACAT_TARBALL_URL"
  40. download_puppet_module "apache" "${APACHE_TARBALL_URL}"
  41. download_puppet_module "htpasswd" "${HTPASSWD_TARBALL_URL}"
  42. # Update tzdata-java package to remove strict dependency on tzdata (see LP bug #1560436)
  43. ROOT="$(dirname "$(readlink -f "$0")")"
  44. DEB_REPO="${ROOT}"/repositories/ubuntu/
  45. TMP_DIR=$(mktemp -d || exit 1)
  46. cp "${DEB_REPO}/tzdata-java_${TZ_VERSION}.deb" "${TMP_DIR}"
  47. cd "${TMP_DIR}" || exit 1
  48. ar x "tzdata-java_${TZ_VERSION}.deb" || exit 1
  49. tar xzvf control.tar.gz || exit 1
  50. sed -i 's/Depends: tzdata (=/Depends: tzdata (>=/' control || exit 1
  51. tar czvf control.tar.gz md5sums control || exit 1
  52. ar r "tzdata-java_${TZ_VERSION}.deb" control.tar.gz data.tar.xz || exit 1
  53. mv "tzdata-java_${TZ_VERSION}.deb" "${DEB_REPO}/" || exit 1
  54. cd /tmp || exit 1
  55. rm -rf "${TMP_DIR}" || exit 1