Skip to content
/ salt-cli Public

A ruby gem to interact with salt on different providers from a local machine

License

Notifications You must be signed in to change notification settings

auser/salt-cli

Repository files navigation

Salt

Opinionated salt-stack deployment

Dependencies

  • rvm
  • ruby 1.9.3
  • rubygems
  • bundler gem

Installation

$ git clone [email protected]:auser/salt-cli.git
$ cd salt-cli
$ bundle install
$ gem build salt-cli.gemspec
$ gem install salt-cli
$ salt #should now show a list of salt-cli commands

Usage

SaltCli is an opinionated salt stack deployment. If you don't like it, make one for yourself :).

SaltStack provides a developer the ability to write salt stack states once and deploy them to various cloud providers with the same workflow.

By defining a salt-cloud.yml file (or a Vagrantfile, for vagrant), you can easily launch instances in the "cloud" ready to be deployed and highstated.

Current providers supported:

  • aws
  • vagrant

Available commands

  • list
  • launch
  • bootstrap
  • teardown
  • ssh
  • key
  • role
  • command
  • run
  • upload
  • upgrade
  • highstate

Example salt-config.yml

If you have a salt-config.yml at the current working directory, salt-cli will read this file and take care of the magic for you. The format of this file, looks like:

user: ubuntu
plans:
  dev:
    # In order
    - master:
        roles:
          - master
    - monitor:
        roles:
          - monitor
    - hadoop1:
        roles:
          - hadoop_master
          - hbase_master
          - zookeeper
          - elasticsearch
          - hbase_slave
    - hadoop2:
        roles:
          - hbase_slave
          - zookeeper
aws:
  access_key: [ACCESS_KEY]
  secret_key: [SECRET_KEY]
  keyname: [YOUR EC2 KEY]
  # Configs
  machines:
    default:
      flavor: m1.small
      image_id: ami-0cdf4965
    master:
      ports:
        tcp:
          - 4505
          - 4506
    monitor:
      flavor: m1.large
      ports:
        udp:
          - 514
          - 12201
        tcp:
          - 80
          - 2003
          - 2004
          - 8080
          - 9300
          - 9200
    hadoop: &hadoop
      flavor: m1.xlarge
      ports:
        tcp:
          - 54310
          - 9200
          - 9300
          - 2181
          - 60000
          - 60010
          - 60020
          - 2888..3888
    hadoop1:
      <<: *hadoop
    hadoop2:
    api: &api
      ports:
        tcp:
          - 80
          - 8080

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

About

A ruby gem to interact with salt on different providers from a local machine

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published