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
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Managing network configurations


Network configuration can be termed as one of the most critical steps in infrastructure management. Without this, or with the slightest mistake in the configuration, one can easily mess up the infrastructure. However, with a little bit of care, this task can be efficiently managed with Salt using the network module. In this recipe, you will learn how to do the same.

How to do it...

We will use the same minion as the previous recipe. Make sure the minion has a new interface added, and we will use it as eth2 interface.

  1. Create a new state directory called network in the staging environment.

  2. Create and edit /opt/salt-cookbook/staging/network/init.sls to have the following entries (the network data will differ):

    eth2:
      network.managed:
        - enabled: True
        - type: eth
        - proto: none
        - ipaddr: 192.168.0.15
        - netmask: 255.255.255.0
        - dns:
          - 8.8.8.8
    
    routes:
      network.routes:
        - name: eth2
        - routes:
          - name: dmz_network
            ipaddr...