All Projects → StarterSquad → prudentia

StarterSquad / prudentia

Licence: MIT license
A useful Continuous Deployment toolkit.

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to prudentia

corda-kubernetes-deployment
Corda Kubernetes Deployment
Stars: ✭ 30 (+11.11%)
Mutual labels:  deployment-automation
cfn-deploy
A useful GitHub Action to help you deploy cloudformation templates
Stars: ✭ 14 (-48.15%)
Mutual labels:  deployment-automation
bitops
Automate the provisioning and configuration of cloud infrastructure.
Stars: ✭ 28 (+3.7%)
Mutual labels:  deployment-automation
kafkaer
Template based Kafka topic/cluster/ACL management
Stars: ✭ 37 (+37.04%)
Mutual labels:  deployment-automation
ansible-odoo
Automatic deployment for Odoo on Linux
Stars: ✭ 19 (-29.63%)
Mutual labels:  deployment-automation
K8s Deployment Strategies
Kubernetes deployment strategies explained
Stars: ✭ 2,649 (+9711.11%)
Mutual labels:  deployment-automation
Meli
Platform for deploying static sites and frontend applications easily. Automatic SSL, deploy previews, reverse proxy, and more.
Stars: ✭ 2,125 (+7770.37%)
Mutual labels:  deployment-automation
AutoDeploy
Building an automated deployment system which is similar to AWS CodeDeploy
Stars: ✭ 44 (+62.96%)
Mutual labels:  deployment-automation
jt tools
Ruby on Rails Continuous Deployment Ecosystem to maintain Healthy Stable Development
Stars: ✭ 13 (-51.85%)
Mutual labels:  deployment-automation
helm
GitHub action for deploying Helm charts.
Stars: ✭ 107 (+296.3%)
Mutual labels:  deployment-automation
deployment-status
GitHub action for updating deployments with status events.
Stars: ✭ 24 (-11.11%)
Mutual labels:  deployment-automation
ansible-erpnext
Automatic installation for ERPNext on Linux
Stars: ✭ 22 (-18.52%)
Mutual labels:  deployment-automation
monitoring-rancher
🤠How to Set up Rancher Server Monitoring with TIG Stack?
Stars: ✭ 22 (-18.52%)
Mutual labels:  deployment-automation
useful-playbooks
🚚 Useful Ansible playbooks for easily deploy your website or webapp to absolutely fresh remote virtual server and automation many processes. Only 3 minutes from the playbook run to complete setup server and start it.
Stars: ✭ 52 (+92.59%)
Mutual labels:  deployment-automation
takomo
Organize, parameterize and deploy your CloudFormation stacks
Stars: ✭ 27 (+0%)
Mutual labels:  deployment-automation
appleloops
A utility to deploy the additional audio content packages for Apple's audio editing programs.
Stars: ✭ 20 (-25.93%)
Mutual labels:  deployment-automation
jekyll-cd
GitHub Action to build and deploy a Jekyll site to GitHub Pages 🧪
Stars: ✭ 21 (-22.22%)
Mutual labels:  deployment-automation
AutoDeploy
AutoDeploy is a single configuration deployment library
Stars: ✭ 43 (+59.26%)
Mutual labels:  deployment-automation
bk-job
蓝鲸作业平台(Job)是一套运维基础操作管理系统,具备海量任务并发处理能力。除了支持脚本执行、文件分发、定时任务等一系列基础运维场景以外,还支持通过流程调度能力将零碎的单个任务组装成一个自动化作业流程;而每个作业都可做为一个原子节点,提供给上层或周边系统/平台使用,实现调度自动化。
Stars: ✭ 658 (+2337.04%)
Mutual labels:  deployment-automation

Prudentia

Status Health Coverage Version License

Prudentia is a Continuous Deployment toolkit written in Python.

Mission

Prudentia's mission is to help you to get production (or any other environment) ready in minutes instead of days, by streamlining all the actions needed to provision your architectural components.

Features

Prudentia uses Ansible as its main automation system, so it easily understands Ansible playbooks. A playbook is one of the components needed to define a Prudentia Box.

Prudentia currently offers:

  • a CLI (supporting auto-completion) used to interactively define Boxes and run operations on them
  • Here-Document format to script Prudentia environments
  • provisioning of an existing server that can be accessed trough SSH
  • management of the lifecycle of a Box that has been created through Prudentia
  • creating Boxes using one of these providers:
    • Vagrant
    • DigitalOcean
    • local
    • ssh

Currently, all features work with Python 2.7+ and 3.4+.

Prerequisites

You need at minimum:

  • Python 2.7 and pip

To install on a Linux distribution you need:

  • libffi-dev
  • libssl-dev
  • python-dev

Installation

To install Prudentia:

$ pip install prudentia

It may be necessary to have root privileges, in which case:

$ sudo pip install prudentia

To uninstall:

$ pip uninstall prudentia

Box operations

A Simple provider (e.g. Local provider or SSH provider) have the following operations available:

  • register: adds a new box definition to the registry
  • unregister: removes a box from the registry
  • reconfigure: changes the definition of an existing box
  • list: lists all boxes in the registry
  • set: defines or override an Ansible extra variable
  • unset: removes an Ansible extra variable
  • vars: loads Ansible extra variables from an external .yml or .json file (overriding existing ones)
  • envset: sets the value of an environment variable
  • provision: runs tasks defined in the playbook associated with a box
  • decrypt: sets the password used to decrypt Ansible vault files
  • verbose: sets Ansible verbosity, using a value between 0 and 4
  • facts: shows useful information about the box and accepts optional parameter to filter properties

A Factory provider (e.g. Vagrant provider or DigitalOcean provider) extend simple provider and adds the ability to change the box life cycle:

  • create: instantiate a new instance based of the box definition
  • restart: reloads the instance
  • stop: shuts down the instance
  • destroy: kill the instance
  • phoenix: shortcut for stop -> destroy -> create -> start -> provision (citing phoenix server Martin Fowler's article)
  • status: returns the status of the instance

Usage

CLI

We'll show a usage example of the SSH provider bundled with Prudentia.

Make sure you have a server that you can ssh into.

$ prudentia ssh

Check what the Ssh provider can do using tab completion:

(Prudentia > Ssh)
decrypt      EOF          help         list         provision    reconfigure  register     set          unregister   unset        vars

Let's start registering a new box:

(Prudentia > Ssh) register
Specify the playbook path:

Now Prudentia is asking for a playbook path, and this is actually an Ansible playbook.

You can use one of the samples that you can find in the examples/boxes directory. For instance, the tasks.yml that will run some Ansible tasks that we've defined (those tasks are not that meaningful, but they are used as a sanity check in our tests).

So let's continue using the tasks.yml:

(Prudentia > Ssh) register
Specify the playbook path: /path/to/prudentia/examples/boxes/tasks.yml
Specify the box name [default: tasks-host]:
Specify the instance address or inventory: ip.of.your.server
Specify the remote user [default: _your_user_]:
Specify the password for the remote user [default: ssh key]:

Box example -> (/path/to/prudentia/examples/boxes/tasks.yml, tasks-host, ip.of.your.server, _your_user_) added.

You will notice that, for some questions, Prudentia gives suggested answer within [ ]. For instance, the suggested Box name is tasks-host. If you like the suggestion, just press enter to choose it.

So far we've registered a Prudentia Box that can be used to play around. If you want to check the definition again:

(Prudentia > Ssh) list
example -> (/path/to/prudentia/examples/boxes/tasks.yml, tasks-host, ip.of.your.server, _your_user_)

Now that we have double-checked that our Box has been registered, we can provision it:

(Prudentia > Ssh) provision example

PLAY [tasks-host] ***************************************************************

GATHERING FACTS ***************************************************************
ok: [tasks-host]

TASK: [Uname] *****************************************************************
changed: [tasks-host] => {"changed": true, "cmd": ["uname", "-a"], "delta": "0:00:00.005527", "end": "2015-01-01 19:13:58.633534", "rc": 0, "start": "2015-01-01 19:13:58.628007", "stderr": "", "stdout": "Darwin tiziano-air 12.5.0 Darwin Kernel Version 12.5.0: Sun Sep 29 13:33:47 PDT 2013; root:xnu-2050.48.12~1/RELEASE_X86_64 x86_64", "warnings": []}

TASK: [Shuffle] ***************************************************************
ok: [tasks-host] => (item=2) => {
    "item": 2,
    "msg": "2"
}
ok: [tasks-host] => (item=4) => {
    "item": 4,
    "msg": "4"
}
ok: [tasks-host] => (item=1) => {
    "item": 1,
    "msg": "1"
}
ok: [tasks-host] => (item=5) => {
    "item": 5,
    "msg": "5"
}
ok: [tasks-host] => (item=3) => {
    "item": 3,
    "msg": "3"
}

TASK: [No operation] **********************************************************
ok: [tasks-host] => {
    "msg": "Task noop executed."
}

PLAY RECAP ********************************************************************
tasks-host                  : ok=4    changed=1    unreachable=0    failed=0

Play run took 0 minutes

Now Prudentia has done the reasonable uninteresting uname, shuffling a list of ints and noop tasks on the remote machine.

Here-Document

The same sequence of operations can be executed using the Here-Document input:

$ prudentia ssh <<EOF
register
/path/to/prudentia/examples/boxes/tasks.yml
tasks-host
ip.of.your.server
_your_user_

provision tasks-host

unregister tasks-host
EOF

Command arguments

If you want to run few commands that don't require specific inputs then there is an option that is quicker than using the CLI or the Here-Document.

Let's for example have a look at an example right away:

$ prudentia ssh 'decrypt' 'vars ./encrypted-vars.yml' 'provision box-name'

After running this command we will be asked to input the Ansible vault password, after that an encrypted file containing variables will be loaded (we assume that the provided password can correctly decrypt the file) and eventually provision an existing registered ssh box.

Development

You can debug and extend Prudentia (or run the latest develop) simply by sym-linking a bash script that we provided:

$ ln -s `pwd`/prudentia.sh /usr/local/bin/prudentia-dev
$ prudentia-dev

In this way you can have both versions, stable and development, running on your system. The development version will run in a python virtual environment without interfering with the dependencies of the stable version. The only information that will be shared are the boxes definition.

More

Posts

Here you can find a guide on how to use Prudentia to provision a Digital Ocean droplet with the StarterSquad website on it.

Another important source of information is Iwein's post that gives you an idea of what Continuous Delivery is, and where Prudentia fits into the flow.

Questions & Contributions

Questions, Contributions and Feedback are more than welcome.

You can checkout planned new features on the Trello Board. Feel free to create feature requests on github issues.

You can e-mail me at:

[email protected]

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].