Did you look at what URLs “/etc/yum.repos.d/ambari.repo” pointing to? Try typing in those URLs in the browser, if you get 404 errors you may need to update ambari.repo to point to correct URLs.
/etc/yum.repos.d/ambari.repo with updated URLs for [ambari-1.x] section below.
[ambari-1.x]
name=Ambari 1.x
baseurl=http://s3.amazonaws.com/public-repo-1.hortonworks.com/AMBARI-1.x/repos/centos6/
gpgcheck=1
gpgkey=http://s3.amazonaws.com/public-repo-1.hortonworks.com/AMBARI-1.x/repos/centos6/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1