{ "info": { "author": "Tiziano Perrucci", "author_email": "tiziano@startersquad.com", "bugtrack_url": null, "classifiers": [], "description": "=========\nPrudentia\n=========\n|status| |health| |coverage| |version| |license|\n\nPrudentia is a Continuous Deployment toolkit written in Python.\n\n*******\nMission\n*******\nPrudentia's mission is to help you to get production (or any other environment) ready in minutes instead of days, by \nstreamlining all the actions needed to provision your architectural components.\n\n********\nFeatures\n********\nPrudentia uses Ansible_ as its main automation system, so it easily understands Ansible playbooks.\nA playbook is one of the components needed to define a Prudentia Box.\n\nPrudentia currently offers:\n\n* a CLI_ (supporting auto-completion) used to interactively define Boxes and run operations on them\n* Here-Document_ format to script Prudentia environments\n* provisioning of an existing server that can be accessed trough SSH\n* management of the lifecycle of a Box that has been created through Prudentia\n* creating Boxes using one of these providers:\n\n * Vagrant\n * DigitalOcean\n * local\n * ssh\n\nCurrently, all features work with Python 2.7+ and 3.4+.\n\n*************\nPrerequisites\n*************\nYou need at minimum:\n\n* Python 2.7 and pip\n\nTo install on a Linux distribution you need:\n\n* libffi-dev\n* libssl-dev\n* python-dev\n\n************\nInstallation\n************\nTo install Prudentia:\n\n.. code-block:: bash\n\n $ pip install prudentia\n\n\nIt may be necessary to have root privileges, in which case:\n\n.. code-block:: bash\n\n $ sudo pip install prudentia\n\n\nTo uninstall:\n\n.. code-block:: bash\n\n $ pip uninstall prudentia\n\n**************\nBox operations\n**************\nA Simple provider (e.g. Local provider or SSH provider) have the following operations available:\n\n* *register*: adds a new box definition to the registry\n* *unregister*: removes a box from the registry\n* *reconfigure*: changes the definition of an existing box\n* *list*: lists all boxes in the registry\n* *set*: defines or override an Ansible extra variable\n* *unset*: removes an Ansible extra variable\n* *vars*: loads Ansible extra variables from an external .yml or .json file (overriding existing ones)\n* *envset*: sets the value of an environment variable\n* *provision*: runs tasks defined in the playbook associated with a box\n* *decrypt*: sets the password used to decrypt Ansible vault files\n* *verbose*: sets Ansible verbosity, using a value between 0 and 4\n* *facts*: shows useful information about the box and accepts optional parameter to filter properties\n\nA Factory provider (e.g. Vagrant provider or DigitalOcean provider) extend simple provider and adds the ability\nto change the box life cycle:\n\n* *create*: instantiate a new instance based of the box definition\n* *restart*: reloads the instance\n* *stop*: shuts down the instance\n* *destroy*: kill the instance\n* *phoenix*: shortcut for stop -> destroy -> create -> start -> provision (citing `phoenix server`_ Martin Fowler's article)\n* *status*: returns the status of the instance\n\n*****\nUsage\n*****\n\nCLI\n===\nWe'll show a usage example of the SSH provider bundled with Prudentia.\n\n**Make sure you have a server that you can ssh into**.\n\n.. code-block:: bash\n\n $ prudentia ssh\n\nCheck what the Ssh provider can do using tab completion::\n\n (Prudentia > Ssh)\n decrypt EOF help list provision reconfigure register set unregister unset vars\n\nLet's start registering a new box::\n\n (Prudentia > Ssh) register\n Specify the playbook path:\n\nNow Prudentia is asking for a playbook path, and this is actually an Ansible playbook.\n\nYou can use one of the samples that you can find in the `examples/boxes` directory.\nFor instance, the `tasks.yml` that will run some Ansible tasks that we've defined (those tasks are not that meaningful,\nbut they are used as a sanity check in our tests).\n\nSo let's continue using the `tasks.yml`::\n\n (Prudentia > Ssh) register\n Specify the playbook path: /path/to/prudentia/examples/boxes/tasks.yml\n Specify the box name [default: tasks-host]:\n Specify the instance address or inventory: ip.of.your.server\n Specify the remote user [default: _your_user_]: \n Specify the password for the remote user [default: ssh key]:\n\n Box example -> (/path/to/prudentia/examples/boxes/tasks.yml, tasks-host, ip.of.your.server, _your_user_) added.\n\nYou will notice that, for some questions, Prudentia gives suggested answer within `[ ]`. For instance, the suggested\nBox name is `tasks-host`. If you like the suggestion, just press enter to choose it.\n\nSo far we've registered a Prudentia Box that can be used to play around. If you want to check the definition again::\n\n (Prudentia > Ssh) list\n example -> (/path/to/prudentia/examples/boxes/tasks.yml, tasks-host, ip.of.your.server, _your_user_)\n \nNow that we have double-checked that our Box has been registered, we can provision it::\n\n (Prudentia > Ssh) provision example\n \n PLAY [tasks-host] ***************************************************************\n \n GATHERING FACTS ***************************************************************\n ok: [tasks-host]\n \n TASK: [Uname] *****************************************************************\n 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\": []}\n\n TASK: [Shuffle] *************************************************************** \n ok: [tasks-host] => (item=2) => {\n \"item\": 2, \n \"msg\": \"2\"\n }\n ok: [tasks-host] => (item=4) => {\n \"item\": 4, \n \"msg\": \"4\"\n }\n ok: [tasks-host] => (item=1) => {\n \"item\": 1, \n \"msg\": \"1\"\n }\n ok: [tasks-host] => (item=5) => {\n \"item\": 5, \n \"msg\": \"5\"\n }\n ok: [tasks-host] => (item=3) => {\n \"item\": 3, \n \"msg\": \"3\"\n }\n \n TASK: [No operation] ********************************************************** \n ok: [tasks-host] => {\n \"msg\": \"Task noop executed.\"\n }\n\n PLAY RECAP ********************************************************************\n tasks-host : ok=4 changed=1 unreachable=0 failed=0\n \n Play run took 0 minutes\n\nNow Prudentia has done the reasonable uninteresting uname, shuffling a list of ints and noop tasks on the remote machine.\n\nHere-Document\n=============\nThe same sequence of operations can be executed using the `Here-Document`_ input:\n\n.. code-block:: bash\n\n $ prudentia ssh <