Move yum-based install into function
Move yum-based install into function

Move yum-based install into a function, to make way for a second
related function where use dnf later

Change-Id: Iad09f3753ecdfa0c10cb8a0970a3c8e5a2dccab1

takahashinobuyuki/diskimage-builder,takahashinobuyuki/diskimage-builder,CSC-IT-Center-for-Science/diskimage-builder,openstack/diskimage-builder,openstack/diskimage-builder,CSC-IT-Center-for-Science/diskimage-builder,zioproto/diskimage-builder,zioproto/diskimage-builder,switch-ch/diskimage-builder,switch-ch/diskimage-builder