Coder Social home page Coder Social logo

smallops's Introduction

#SmallOps Automated Ops via Fabric.

##Why We use Chef at work and its great. Especially when you are managing a bunch of machines. For my home servers I dont really want to use Chef. Its a little too much for what I do. So this was my solution to not writing bash scripts.

Installation

You will need Fabric http://docs.fabfile.org/en/1.5/#installation as well as the SmallOps code https://github.com/asmedrano/SmallOps

Before you get started

Fabric communicates to your server via SSH so make sure you have that all set up. If you'd like, you can set up passwordless sudo for the user you run any sudo commands as. This is up to you. If you don't, you'll end up sitting there typing in the password more than once.

Running it

cd into the directory with the SmallOps code

Run it

$ fab -H ip_or_hostname_for_server -u user_to_run_as go:mysite/samplescript

Scripts

SmallOps uses config.ini type files to orchestrate actions. As of right now you'll need to have your directory structured in this way. By default SmallOps looks for scripts in a scripts directory of your 'site'.

├── core
├── fabfile.py
└── resources -> ../SmallOpsResources # this is symbolic link. Using it this way lets you keep your scripts in thier own gitrepo. See: 
└── mysite
    ├── files
    │   └── test.txt
    └── scripts
        └── samplescript.ini
└── myothersite
    ├── files
    │   └── test.txt
    └── scripts
        └── anothersamplescript.ini

Example Script

;BTW this is comment 

;[package]
;package=nginx
;label=nginx

;[service]
;service=nginx
;label=Restart Service Example
;action=restart

;[bash]
;label=bash example
;cmd=ls /home

;[git]
;label=Git Example
;url=git://github.com/asmedrano/myShell.git
;branch=master
;directory=/tmp/test
;user=someuser
;sync=False

;[file]
;label=File Example
;name=/path/tofile/on/your/local/system
;directory=/path/on/server
;user=someuser
;mode=0755

Supported directives

Right now SmallOps knows 5 directives:

package installs packages via apt-get

service usefull for managing a service such as nginx or apache2

bash ... Bash Commands

git Clone and pull git repos

file Put local files onto the target server

Directives

All directives support the following options:

label A label for the action you are running

user The user to execute as #TODO though most of them are implemented.

Hopefully the options specific to the directive are self explanitory. I will however add some better docs later.

smallops's People

Contributors

asmedrano avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.