Book Image

Salt Cookbook

By : Anirban Saha
Book Image

Salt Cookbook

By: Anirban Saha

Overview of this book

Table of Contents (18 chapters)
Salt Cookbook
About the Author
About the Reviewer

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:

        {% if grains['lsb_distrib_id'] == "CentOS" %}
        - humanname: CentOS-$releasever - Epel Repo
        - mirrorlist: 6&arch=$basearch
        - comments:
            - "#baseurl=$bas earch"
        - gpgcheck...