Skip to main content

Automation Swiss Army knife

Project description

mac is a command line tool that allows to
  • bootstrap bash scripts when you are creating a new cloud server, allowing to hook configuration management systems like Puppet, Chef, Ansible and more

  • create cloud infrastructures in Amazon Web Services, Google Cloud Engine, Digital Ocean and Rackspace.

  • manage servers and infrastructures

mac is very useful for a set of business cases such:

Installing the CLI

An automatic installation can be performed with the following command:

curl -sSL https://manageacloud.com/mac | bash

You can also use pip install:

pip install mac --pre

Getting started with the CLI

Once is installed, you need to login. Create an account (it takes 1 minute) if you don’t have one available.

$ mac -h
usage: mac [-h] [--version] [-v] [-q]
           {login,instance,configuration,infrastructure} ...

Manageacloud.com CLI

optional arguments:
  -h, --help            show this help message and exit
  --version             show program\'s version number and exit
  -v, --verbose         Show verbose information
  -q, --quiet           Enable loggable output

mac's CLI commands:
  {login,instance,configuration,infrastructure}
    login               Login into Manageacloud.com
    instance            Instance related operations
    configuration       Server configuration related operations
    infrastructure      Infrastructure operations

Documentation

Documentation is available at https://manageacloud.com/article/orchestration/cli

Examples

Create two instances of Demo Application in Amazon Web Services and configure a load balancer.

mac: 0.7.1
description: Infrastructure demo
name: demo
version: '1.0'

roles:

  app:
    instance create:
      configuration: demo_application
      environment:
      - DB_IP: 127.0.0.1
      - APP_BRANCH: master

actions:
   get_id:
      ssh: wget -q -O - http://169.254.169.254/latest/meta-data/instance-id

   get_availability_zone:
      ssh: wget -q -O - http://169.254.169.254/latest/meta-data/placement/availability-zone


resources:

   build_lb:
      create bash:
        aws elb create-load-balancer
          --load-balancer-name my-load-balancer
          --listeners Protocol=HTTP,LoadBalancerPort=80,InstanceProtocol=HTTP,InstancePort=80
          --region infrastructure.app_inf.location
          --availability-zones role.app.get_availability_zone

   register_lb:
      create bash:
        aws elb register-instances-with-load-balancer
          --load-balancer-name my-load-balancer
          --instances role.app.get_id
          --region infrastructure.app_inf.location

infrastructures:

  app_inf:
    name: app
    provider: amazon
    location: us-east-1
    hardware: t1.micro
    role: app
    amount: 2

  build_lb_inf:
    resource: build_lb

  register_lb_inf:
    resource: register_lb
Demo requirements:
  • Install and configure aws cli and mac cli

  • Deploy a production server at Manageacloud (sign up takes 1 minute)

  • save the previous contents to a file called infrastructure.macfile and run the command mac infrastructure macfile infrastructure.macfile

Build status

mac-1 Wheezy 7

mac-2 Ubuntu Trusty Tahr 14.04

mac-3 CentOS 6.5

mac-5 CentOS 7

mac-6 Ubuntu Utopic Unicorn 14.10

mac-7 Debian Jessie 8

mac-8 Ubuntu Ubuntu Vivid Vervet 15.04

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mac-0.9.0.tar.gz (45.3 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page