Manually configuring RHEL repositories and installing dependant packages

Prerequisites
  • Ensure you are logged in as the root user.

  • Ensure an IP address is assigned to the PCIe NIC in this system for Internet connectivity. The Internet connectivity is required to connect to the Red Hat repositories to install and update the packages.

    For more information about configuring Internet connectivity, see Configuring Internet connectivity on NPS toolkit host.

  • Ensure your system is registered with the Red Hat Customer Portal using the Red Hat Subscription-Manager. For more information about registering with the Red Hat Customer Portal, see Red Hat Subscription management.

Procedure
  1. Set your host name in FQDN format and update the /etc/hosts file. To set the host name, perform the following steps:
    1. Run the following command:
      hostname <host name>
    2. Clear any existing host names in the /etc/hosts file, and enter the host name as <host name>.
    3. Save and exit this file.
    4. To verify the host name, run the following command:
      hostnamectl
  2. If you use proxy servers for the Internet connectivity, edit the /etc/profile file and add the required entries. To configure the /etc/profile file, perform the following steps:
    1. To edit the /etc/profile file, run the following command:
      vi /etc/profile
    2. Add the following lines at the end of this file:
      export http_proxy=<URL of proxy server and port number>
      export https_proxy=<URL of proxy server and port number>
      export no_proxy=<IP address of NPS host>,localhost,
      XXX.X.X.X,XX.XX.X.X/XX
    3. Save and exit the file.
  3. If you use proxy servers for the Internet connectivity, ensure that the following entries are available in the /etc/rhsm/rhsm.conf file:
    an http proxy server to use
    proxy_hostname = <DNS name or IP address of the proxy server>
    
    port for http proxy server
    proxy_port = <port number>
    
    user name for authenticating to an http proxy, if needed
    proxy_user = <username>
    
    password for basic http proxy auth, if needed
    proxy_password = <password>
  4. Register to subscription manager using below command by passing your RHEL account credentials.
    subscription-manager register --username <rhel_username> --password <rhel_password> --force
  5. To enable the required Red Hat Enterprise Linux repositories, do the following:
    1. Run the following command:
      subscription-manager list --available –all
    2. Search for subscription name as openstack, system type as Virtual and copy the pool ID.
    3. Provide the pool ID:
      
      subscription-manager attach --pool=<pool_id>
      
    4. To enable only the required RHEL repositories, run the following commands:
      
      sudo subscription-manager repos --enable=rhel-7-server-rpms --enable=rhel-7-server-extras-rpms --enable=rhel-7-server-rh-common-rpms --enable=rhel-ha-for-rhel-7-server-rpms --enable=rhel-7-server-openstack-13-rpms --enable=rhel-7-server-rhceph-3-tools-rpms
      
  6. To refresh and update the repositories with the latest packages, run the following commands:
    yum repolist
    yum update -y
  7. To install the dependency packages, run the following commands:
    yum install ansible –y
    yum install wget –y
    
  8. Perform the following steps to configure yum and docker:
    1. Create docker.service.d directory under /etc/system/system path using following commands:
      cd /etc/systemd/system
      mkdir docker.service.d
      
    2. If you are using proxy servers, run the following commands:
      1. To set proxy for yum, edit /etc/yum.conf file:

        vi /etc/yum.conf
      2. Add the following line as the last line of yum.conf file

        proxy=http://<proxy_url>:<proxy_port>
      3. Create http-proxy.conf and https-proxy.conf file inside docker.service.d directory and configure it using following commands:
        echo -e '[Service]\nEnvironment="HTTP_PROXY= http://<proxy_url>:<proxy_port>"' > /etc/systemd/system/docker.service.d/http-proxy.conf
        
        echo -e '[Service]\nEnvironment="HTTPS_PROXY= http://<proxy_url>:<proxy_port>"' > /etc/systemd/system/docker.service.d/https-proxy.conf
        
        If proxy required auth then run following commands:
        echo -e '[Service]\nEnvironment="HTTP_PROXY=http://{{ proxy_user }}:{{ proxy_password }}@http://<proxy_url>:<proxy_port>"' > /etc/systemd/system/docker.service.d/http-proxy.conf
        
        echo -e '[Service]\nEnvironment="HTTPS_PROXY=http://<proxy_user>:<proxy_password >@http://<proxy_url>:<proxy_port>"' > /etc/systemd/system/docker.service.d/https-proxy.conf
        
    3. Add NO_PROXY in docker configuration using following commands:
      echo -e 'Environment="NO_PROXY=localhost,127.0.0.1,<NPS_TOOLKIT_VM_IP>"' >> /etc/systemd/system/docker.service.d/http-proxy.conf
      
      echo -e 'Environment="NO_PROXY=localhost,127.0.0.1,<NPS_TOOLKIT_VM_IP>"' >> /etc/systemd/system/docker.service.d/https-proxy.conf
      
  9. To enable and start the docker services, run the following commands:
    systemctl daemon-reload
    	systemctl start docker
    	systemctl restart docker
    
  10. To verify the status of Docker, run the following command:
    systemctl status docker
  11. After the required dependency packages are successfully installed, disable and remove the the Network Manager service using the following commands:
    systemctl stop NetworkManager
    systemctl disable NetworkManager