Skip to main content

A simple provisioning tool

Project description


`prvsn` is a simple provisioning tool.

[![Pypi version](](
[![Pypi license](](
![Python 2](
![Python 3](


- provisioning of local machine
- provisioning of remote machine over ssh

## Motivation

The motivation for this tool is too keep track of configuration steps and being able to rebuild a small setup (e.g. a raspberry pi) quickly and with minimal effort.

### Goals

Easy for quickly setup a machine for hacking:

- easy to provision a single machine
- works in python
- simple way to
- add a file, possibly a template
- install package
- run a command in bash
- works out of the box:
- python 2.7 & 3 compatibility
- no external dependencies

### Non-Goals

Large scale provisioning:

- provision thousands or more machines
- strict dependencies, complex dependency graph
- external recipes & supermarket/store support

If those are your goals, have a look at Puppet or Chef or others.

## Installation

### Install

From PyPi:

pip install prvsn

From Github:

git clone
cd prvsn
python install

Or for development:

python develop

## Usage

### Hierarchy

Configurations are called `roles` and are grouped into a `runbook`.

The file hierarchy looks like:

|- roles
|- web
|- ...
|- desktop
|- files

- `` is the main python entry point
- `files` is to contain any files you want to use

### Tasks

A role's `` can contain one or more `tasks` (also called `states` since they're mostly descriptive).

Common task options include:

- `secure`: no output will be shown on console nor logs.

#### Command Tasks

`command(interpreter, cmd)`


Runs some code in bash. Hopefully this is never needed.

bash('echo "hello"')

echo "hello"


Runs some code in ruby.

#### File Tasks

`file(source, file, replacements={})`:

`source` can either be a URL or a file's path relative to the role's `files` directory.

file('asound.conf', '/etc/asound.conf')


replacements rules can be specified, so the file acts as a template.


#### Kernel Tasks

`module(name)` (linux only):

Adds and loads a module.


#### Package Tasks


Should automatically detect the package manager in presence.
If multiple managers are present, it is possible to explicitly specify which to use:





### Command line

#### init

Creates the hierarchy for a new runbook.

prvsn init -b path/to/runbook

#### provision

Default command if no host is specified. Provisions the machine `prvsn` runs on.

prvsn provision -b path/to/runbook -r role1,role2

or alternatively, if running from the runbook directory:

prvsn -r role1,role2

`--sudo` can be used to provision as root.

#### package

Creates an executable package with the runbook and the roles. The default package name is `package.pyz`.

prvsn package -b path/to/runbook -r role1,role2 -o mypackage.pyz

The package can then be run individually:

python mypackage.pyz

#### remote

Default command if a host is specified. Provision a remote host by:

1. creating a package
2. sending the package over ssh
3. running the package over ssh


prvsn remote -b path/to/runbook -r role1,role2 -n myhostname -u myuser

Additionally, ssh public key will be installed on the remote host (if no key is present, one is created). To disable this behavior, use '--no-copy-keys'.

`--sudo` can be used to provision as root (on the remote host).

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

prvsn-0.2.tar.gz (12.2 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