Confirm the repository is configured by checking the repo list.
yum repolist
You should see the Ambari and HDP utilities repositories in the list. The version values vary depending the installation.
repo id repo name | AMBARI-1.x | Ambari 1.x | HDP-UTILS-1.1.0.17 | Hortonworks Data Platform Utils
Install the Ambari bits using yum. This also installs PostgreSQL.
yum install ambari-server