Giter VIP home page Giter VIP logo

cyclosible's Introduction

Cyclosible

Join the chat at https://gitter.im/cycloidio/cyclosible

Build Status Coverage Status Stories in Ready

Cyclosible is a project backed by Cycloid in order to manage Ansible with a REST API.

The goal of Cyclosible is to be a lightweight application opensourced as a free alternative to Ansible Tower.

Cyclosible is used internally at Cycloid to let our customers use their own CI and interact with our deployment stack.

Technologies used

Cyclosible is built upon these technologies:

Prerequisite

Install REDIS

To start with Cyclosible, you will need to install redis. For this we suggest to create a redis docker container

Create Virtual Environment

First, install virtualenv:

sudo pip install virtualenv
sudo pip install virtualenvwrapper

Then, create the virtualenv:

mkvirtualenv cyclosible27 --no-site-packages -p /usr/bin/python2.7

I suggest here to install python 2.7 as ansible does not support python 3 yet.

Now, to work in your virtual environment, you can enable it with:

workon cyclosible27

Install Cyclosible

You will need to clone this repository. Then you will be able to install the requirements:

pip install cyclosible

When you activate your virtual environment, you should be able to use cyclosible script:

which cyclosible

Configure the S3 bucket

S3 bucket is optional if you enable the S3 storage plugin.

You will need to activate the Website Hosting on your S3 bucket, and apply this permission (where cycloid-cyclosible is the name of your bucket):

{
  "Version":"2012-10-17",
  "Statement":[{
    "Sid":"PublicReadGetObject",
        "Effect":"Allow",
      "Principal": "*",
      "Action":["s3:GetObject"],
      "Resource":["arn:aws:s3:::cycloid-cyclosible/*"
      ]
    }
  ]
}

Configure the application

By default, there is some fields pre-configured in the cyclosible/Cyclosible/settings.py file.

To make things easier to configure and to not loose your modifications after an upgrade of the package, you can override these settings providing your own settings file.

For this, create an environment variable named CYCLOSIBLE_CONFIG and point it to your settings file, for example in /etc/cyclosible/settings.py.

Now you just have top copy the content from the settings.py to your custom settings.py.

Before starting the application, we need to create the database. You can also configure the DATABASE settings, by default it will create a SQLite3 database. Please refer to the django website (link is above this parameter) to configure it correctly.

Then, apply the schema:

CYCLOSIBLE_CONFIG=/etc/cyclosible/settings.py cyclosible migrate

It will populate the database. Then you need to create a superuser:

CYCLOSIBLE_CONFIG=/etc/cyclosible/settings.py cyclosible createsuperuser

Start the application

The best way to run the application on production is to use supervisord.

There are 3 applications to start :

  • This one will start the webserver (DEV mode):
CYCLOSIBLE_CONFIG=/etc/cyclosible/settings.py cyclosible runserver
  • This one will start the worker which will run the playbook:
CYCLOSIBLE_CONFIG=/etc/cyclosible/settings.py cyclosible celery worker
  • This one will check if there are some tasks ton run on crontabs (actually optional):
CYCLOSIBLE_CONFIG=/etc/cyclosible/settings.py cyclosible celery beat

Now you should be able to connect on the admin interface: http://<yourip>:8000/admin/

Development

All unit tests are run with tox:

pip install tox

Then, run tox at the root of the project:

tox

cyclosible's People

Contributors

gitter-badger avatar seraf avatar waffle-iron avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cyclosible's Issues

Ansible V2 compatibility

Ansible v2 will be soon available and Cyclosible should be able to run playbooks. The runner library has been removed on the V2.

Add color in logs

There should be an option to enable the color or not. Should Cyclosible store the log twice, one with color, the other without color ?

Why should I need mysql if I prefer postgres?

Collecting Cyclosible
Downloading cyclosible-0.3.1.tar.gz
Requirement already satisfied (use --upgrade to upgrade): djangorestframework in /usr/local/lib/python2.7/dist-packages (from Cyclosible)
Requirement already satisfied (use --upgrade to upgrade): django>=1.8 in /usr/local/lib/python2.7/dist-packages (from Cyclosible)
Collecting mysqlclient (from Cyclosible)
Downloading mysqlclient-1.3.7.tar.gz (79kB)
100% |████████████████████████████████| 81kB 274kB/s
Complete output from command python setup.py egg_info:
sh: 1: mysql_config: not found
Traceback (most recent call last):
File "", line 20, in
File "/tmp/pip-build-bX9o9l/mysqlclient/setup.py", line 17, in
metadata, options = get_config()
File "setup_posix.py", line 44, in get_config
libs = mysql_config("libs_r")
File "setup_posix.py", line 26, in mysql_config
raise EnvironmentError("%s not found" % (mysql_config.path,))
EnvironmentError: mysql_config not found

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-bX9o9l/mysqlclient

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.