Skip to content

Latest commit

 

History

History

roles

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Fabricio: infrastructures

This example shows how to use roles within different infrastructures. There are one role and one infrastructure defined in fabfile.py. But you can define as many additional roles and infrastructures as you need.

Requirements

Files

  • fabfile.py, Fabricio configuration
  • README.md, this file
  • Vagrantfile, Vagrant config

Virtual Machine creation

Run vagrant up and wait until VM will be created.

List of available commands

fab --list

Deploy

To deploy to a particular infrastructure you need to provide its name before any other command:

fab vagrant app

This command will start deploy to the vagrant infrastructure.

Also you can use vagrant.confirm command to skip confirmation dialog and start tasks execution immediately.

If no infrastructure selected then Fabricio will use default roles definition (in that case you should manually set default roles in your fabfile.py, see Fabric documentation). Also if there is no hosts found for a role then any task which needs to be executed on a remote host will be skipped.

Deploy to localhost

Same configuration can be deployed to localhost:

fab localhost app

even without SSH daemon enabled:

fab localhost:force_local=yes app

The latter is possible due to special "force_local" parameter passed to localhost infrastructure definition. See fabfile.py for details.

Parallel execution

Any Fabricio command can be executed in parallel mode. This mode provides advantages when you have more then one host to deploy to. Use --parallel option if you want to run command on all hosts simultaneously:

fab --parallel vagrant app

Customization

See "Hello World" Customization section.