#!/bin/bash

# Copyright (c) 2013 Hortonworks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.

##########################################################
# Element install script for turning on a local yum
# repository for certain HDP elements that should be available on an
# image that may not have web access.
#
##########################################################

# create a new local yum repository definition that
# includes:
#    1. HDP-Utils
#    2. Ambari Updates (for Ambari updates to Nagios)

cat >> /etc/yum.repos.d/hdp-local-repos.repo <<EOF

[HDP-UTILS-1.1.0.16-LOCAL]
name=Hortonworks Data Platform Version - HDP-UTILS-1.1.0.16 - LOCAL
baseurl=file:///opt/hdp-local-repos/hdputils/repos/centos6
gpgcheck=0
enabled=1
priority=1

[Updates-ambari-1.2.5.17-LOCAL]
name=ambari-1.2.5.17 - Updates LOCAL
baseurl=file:///opt/hdp-local-repos/ambari/centos6/1.x/updates/1.2.5.17
gpgcheck=0
enabled=1
priority=1

EOF
