Case study for setting up local repository

Review this case study to understand - how to prepare a local repository for Ambari 7.1.x.x and HDP 7.1.x.x on Centos7:

yum install yum-utils createrepo -y
yum install httpd -y
//firewall configuration
sudo systemctl start httpd
sudo systemctl status httpd
mkdir -p /var/www/html/
wget -nv -O /etc/yum.repos.d/ambari.repo
wget -nv -O /etc/yum.repos.d/hdp.repo
yum repolist
cd /var/www/html
mkdir -p ambari/centos7
cd ambari/centos7/
reposync -r ambari-7.1.x.x
cd ../..
mkdir -p hdp/centos7
cd hdp/centos7/
reposync -r HDP-7.1.x.x
reposync -r HDP-UTILS-
createrepo /var/www/html/ambari/centos7/ambari-7.1.x.x
createrepo /var/www/html/hdp/centos7/HDP-7.1.x.x
createrepo /var/www/html/hdp/centos7/HDP-UTILS-
The repositories will be available at the local web server: