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:
- Create a new state directory called
pkg_repo
in the staging environment. - 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" %} ...
Get Salt Cookbook now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.