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

Extending profiles and providers


To ensure efficient use of providers and profiles in Salt cloud, the feature of extending enables providers and profiles to extend other providers and profiles, so that their attributes can be inherited and configurations can be made more organized. In this recipe, you will learn how to configure the extend feature in Salt cloud.

How to do it...

Edit /etc/salt/cloud.profiles to add the following entries:

cookbook_ec2_prod_common_app:
  provider: cookbook_ec2_us_west_2
  minion:
    master: salt-master
    environment: production
  image: ami-721b7b42
  grains:
    server_type: app
    environment: production
  tag: {'Environment': 'Production', 'Role': 'Application'}
  del_root_vol_on_destroy: True
  script: bootstrap-salt
  sync_after_install: all

cookbook_ec2_prod_app_us-west-2b:

  availability_zone: us-west-2b

  network_interfaces:
    - DeviceIndex: 0
      PrivateIpAddresses:
        - Primary: True
      AssociatePublicIpAddress: False
      SubnetId...