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

Configuring cloud profiles


Salt cloud profiles are the components that provide more cloud service provider-specific configuration options, and also minion-specific parameters when using Salt cloud. In this recipe, you will learn how to use cloud profile configurations in Salt.

How to do it...

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

cookbook_ec2_prod_db:
  provider: cookbook_ec2_us_west_2
  minion:
    master: salt-master
    environment: production
  image: ami-721b7b42
  script: bootstrap-salt
  sync_after_install: all

  network_interfaces:
    - DeviceIndex: 0
      PrivateIpAddresses:
        - Primary: True
      AssociatePublicIpAddress: False
      SubnetId: subnet-4236c535
      SecurityGroupId:
        - sg-5b35a03e
  grains:
    server_type: db
    environment: production
  tag: {'Environment': 'Production', 'Role': 'Database'}

How it works...

In this recipe, we demonstrated the procedure to configure Salt cloud profiles, and the various attributes involved.

The...