programming Package¶
programming
Package¶
Roles in this namespace are meant to configure programming languages in Debian distributions.
nodejs
Module¶
Roles in this namespace are meant to provide Node.js utility methods for Debian and Ubuntu distributions.
-
class
provy.more.debian.programming.nodejs.
NodeJsRole
(prov, context)[source]¶ Bases:
provy.core.roles.Role
This role provides Node.js utilities for Debian and Ubuntu distributions.
Example:
from provy.core import Role from provy.more.debian import NodeJsRole class MySampleRole(Role): def provision(self): self.provision_role(NodeJsRole)
-
is_already_installed
()[source]¶ Checks if Node.js is already installed on the server.
Example:
from provy.core import Role from provy.more.debian import NodeJsRole class MySampleRole(Role): def provision(self): with self.using(NodeJsRole) as nodejs: nodejs.is_already_installed() # True or False
-
provision
()[source]¶ Installs Node.js, NPM and their dependencies. This method should be called upon if overriden in base classes, or Node won’t work properly in the remote server.
If the server is a Debian, will install via source packages, if it’s Ubuntu, will install via Chris Lea’s official PPA repository.
Example:
from provy.core import Role from provy.more.debian import NodeJsRole class MySampleRole(Role): def provision(self): self.provision_role(NodeJsRole) # no need to call this if using with block.
-
provision_to_debian
()[source]¶ Installs Node.js, NPM and their dependencies via source packages.
It’s not recommended that you use this method directly; Instead, provision this role directly and it will find out the best way to provision.
Also, this method doesn’t check if Node.js is already installed before provisioning it.
Example:
from provy.core import Role from provy.more.debian import NodeJsRole class MySampleRole(Role): def provision(self): with self.using(NodeJsRole) as nodejs: nodejs.provision_to_debian()
-
provision_to_ubuntu
()[source]¶ Installs Node.js, NPM and their dependencies via Chris Lea’s official PPA repository.
It’s not recommended that you use this method directly; Instead, provision this role directly and it will find out the best way to provision.
Also, this method doesn’t check if Node.js is already installed before provisioning it.
Example:
from provy.core import Role from provy.more.debian import NodeJsRole class MySampleRole(Role): def provision(self): with self.using(NodeJsRole) as nodejs: nodejs.provision_to_ubuntu()
-
php
Module¶
Roles in this namespace are meant to provide PHP utilities for Debian and Ubuntu distributions.
-
class
provy.more.debian.programming.php.
PHPRole
(prov, context)[source]¶ Bases:
provy.core.roles.Role
This role provides PHP utilities for Debian distributions.
Additionally, installs php5-dev (PHP source libraries), php-pear (PHP package management) and php5-fpm (FastCGI implementation for PHP which can be used with Nginx).
Example:
from provy.core import Role from provy.more.debian import PHPRole class MySampleRole(Role): def provision(self): self.provision_role(PHPRole)
-
provision
()[source]¶ Installs PHP 5 (probably 5.3, depending on your server) and its dependencies.
If your server is a Debian (non-derived) machine, it also adds the dotdeb repositories for PHP 5.3, so that you can use them with
AptitudeRole
to install what you need.This method should be called upon if overriden in base classes, or PHP won’t work properly in the remote server.
Example:
from provy.core import Role from provy.more.debian import PHPRole class MySampleRole(Role): def provision(self): self.provision_role(PHPRole) # no need to call this if using with block.
-
ruby
Module¶
Roles in this namespace are meant to provide Ruby utility methods for Debian distributions.
-
class
provy.more.debian.programming.ruby.
RubyRole
(prov, context)[source]¶ Bases:
provy.core.roles.Role
This role provides Ruby utilities for Debian distributions.
Variables: - version – Ruby version to install. By default, install package “1.9.1” - which, in effect, refers to “1.9.2” (only uses the “1.9.1” name for compatibility reasons).
- priority – Priority to attribute to this Ruby version in the server. By default, it’s 400 - which is already higher than the default Ruby installation in some Debian-like systems -.
Example:
from provy.core import Role from provy.more.debian import RubyRole class MySampleRole(Role): def provision(self): self.provision_role(RubyRole) # Now, suppose we want the new Ruby installed, but not as the default one: RubyRole.version = 1.8 RubyRole.priority = 10 self.provision_role(RubyRole) RubyRole.version = 1.9.1 RubyRole.priority = 1 self.provision_role(RubyRole) # As priority 10 wins over 1, Ruby 1.8 will be used as the default "ruby" executable.
-
priority
= 400¶
-
provision
()[source]¶ Installs Ruby and its dependencies. This method should be called upon if overriden in base classes, or Ruby won’t work properly in the remote server.
Example:
from provy.core import Role from provy.more.debian import RubyRole class MySampleRole(Role): def provision(self): self.provision_role(RubyRole) # no need to call this if using with block.
-
version
= '1.9.1'¶