code: def packages(
      state, host, packages=None,
      present=True, latest=False, update=False, clean=False,
  ):
      '''
      Install/remove/update yum packages & updates.
  
      + packages: list of packages to ensure
      + present: whether the packages should be installed
      + latest: whether to upgrade packages without a specified version
      + update: run yum update
      + clean: run yum clean
  
      Versions:
          Package versions can be pinned like yum: ``<pkg>-<version>``
      '''
  
      if clean:
          yield 'yum clean all'
  
      if update:
          yield _update(state, host)
  
      yield ensure_packages(
          packages, host.fact.rpm_packages, present,
          install_command='yum install -y',
          uninstall_command='yum remove -y',
          upgrade_command='yum update -y',
          version_join='-',
          latest=latest,
      f packages(
      state, host, packages=None,
      present=True, latest=False, update=False, clean=False,
  ):
      '''
      Install/remove/update yum packages & updates.
  
      + packages: list of packages to ensure
      + present: whether the packages should be installed
      + latest: whether to upgrade packages without a specified version
      + update: run yum update
      + clean: run yum clean
  
      Versions:
          Package versions can be pinned like yum: ``<pkg>-<version>``
      '''
  
      if clean:
          yield 'yum clean all'
  
      if update:
          yield _update(state, host)
  
      yield ensure_packages(
          packages, host.fact.rpm_packages, present,
          install_command='yum install -y',
          uninstall_command='yum remove -y',
          upgrade_command='yum update -y',
          version_join='-',
          latest=latest,
      )
docs: Install/remove/update yum packages & updates.
  
      + packages: list of packages to ensure
      + present: whether the packages should be installed
      + latest: whether to upgrade packages without a specified version
      + update: run yum update
      + clean: run yum clean
  
      Versions:
          Package versions can be pinned like yum: ``<pkg>-<version>``