O'Reilly logo

Salt Cookbook by Anirban Saha

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Managing package repositories

Managing packages is an extremely important and base requirement of infrastructure management. However, to manage packages, we need proper package repositories configured. In this chapter, you will learn about how to efficiently manage package repositories with Salt.

How to do it...

Configure two new minions called salt-minion-centos (with OS as CentOS) and salt-minion-ubuntu (with OS as Ubuntu). Configure the environment grain with the value of staging environment in both the minions:

  1. Create a new state directory called pkg_repo in the staging environment.
  2. Create and edit /opt/salt-cookbook/staging/pkg_repo/init.sls to have the following entries:
    salt-repo: pkgrepo.managed: {% if grains['lsb_distrib_id'] == "CentOS" %} ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required