ploy


Nameploy JSON
Version 2.0.1 PyPI version JSON
download
home_pagehttp://github.com/ployground/ploy
SummaryA tool to manage servers through a central configuration. Plugins allow provisioning, configuration and other management tasks.
upload_time2023-06-19 08:43:32
maintainer
docs_urlNone
authorFlorian Schulze
requires_python>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, !=3.6.*
licenseBSD 3-Clause License
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage No coveralls.
            Overview
========

Ploy is a commandline-tool to provision, manage and control server instances.
There are plugins for EC2 (ploy_ec2), FreeBSD Jails (ploy_ezjail) and more.
You can create, delete, monitor and ssh into instances while ploy handles the details like ssh fingerprint checking.
Additional plugins provide advanced functionality like integrating Fabric (ploy_fabric) and Ansible (ploy_ansible).

You can find the detailed documentation at http://ploy.readthedocs.org/en/latest/


Installation
============

ploy is best installed with easy_install, pip or with zc.recipe.egg in a buildout.
It installs two scripts, ``ploy`` and ``ploy-ssh``.


Configuration
=============

All information about server instances is located in ``ploy.conf``, which by default is looked up in ``etc/ploy.conf``.


Plugins
=======

Support for backends and further functionality is implemented by plugins. One plugin is included with ploy.

``plain``
  For regular servers accessible via ssh.

You can see which plugins are available in your current installation with ``ploy -v``.


Plain
-----

With plain instances you can put infos about servers into the configuration to benefit from some ploy features like ssh fingerprint checking and plugins like the Fabric integration.


Options
~~~~~~~

``host`` or ``ip``
  (**required**) The host name or address for the server.

``user``
  The default user for ssh connections. If it's set to ``*`` then the current
  local user name is used.

``port``
  The ssh port number.

``ssh-host-keys`` or ``ssh-fingerprints``
  (**required**) The public ssh host keys (or fingerprints) of the server.

``ssh-host-keys``
  It's best to use the public ssh host keys if available.
  You can either specify the path, or put in the contents directly (``ssh-rsa AAAA...``).
  Multiple host keys can be specified one per line, or separated by commas.

``ssh-fingerprints``
  If set to ``ask`` then manual interactive verification is enabled.
  If set to ``ignore`` then no verification is performed at all!
  Multiple fingerprints can be specified one per line, or separated by commas.
  The format of fingerprints is either 16 bytes as hex numbers separated by colons,
  the same 16 bytes prefixed by ``MD5:``,
  or the hash type, followed by a colon and the base 64 encoded hash digest.

``password-fallback``
  If this boolean is true, then using a password as fallback is enabled if the
  ssh key doesn't work. This is off by default.
  You may be asked more than once for the password.
  The first time is by paramiko which always happens, but is remembered.
  The other times is by the ssh command line tool if it's invoked.

``password``
  Never use this directly! If password-fallback is enabled this password is
  used. This is mainly meant for Fabric scripts which have other ways to get
  the password. On use case is bootstrapping `FreeBSD <http://www.freebsd.org/>`_
  from an `mfsBSD <http://mfsbsd.vx.sk/>`_ distribution where the password is
  fixed.

``proxycommand``
  The command to use in the ProxyCommand option for ssh when using the ``ploy-ssh``
  command. There are some variables which can be used:

    ``path``
      The directory of the ploy.conf file. Useful if you want to use the ``ploy-ssh``
      command itself for the proxy.

    ``known_hosts``
      The absolute path to the known_hosts file managed by ploy.

    ``instances``
      The variables of other instances. For example: instances.foo.ip

  In addition to these the variables of the instance itself are available.

  A full example for a proxycommand::

    proxycommand = {path}/../bin/ploy-ssh vm-master -W {ip}:22

``ssh-key-filename``
  Location of private ssh key to use.

``ssh-extra-args``
  A list of settings separated by newlines passed on to ssh.

  Example::

    ssh-extra-args = ForwardAgent yes


SSH integration
===============

ploy provides an additional tool ``ploy-ssh`` to easily perform SSH based
operations against named instances. Particularly, it encapsulates the
entire *SSH fingerprint* mechanism. For example EC2 instances are often
short-lived and normally trigger warnings, especially, if you are using
elastic IPs.

  Note:: it does so not by simply turning off these checks, but by transparently updating its own fingerprint list using mechanisms provided by the backend plugins.

The easiest scenario is simply to create an SSH session with an instance. You
can either use the ssh subcommand of the ploy tool like so::

  ploy ssh INSTANCENAME

Alternatively you can use the ploy-ssh command directly, like so::

  ploy-ssh INSTANCENAME

The latter has been provided to support scp and rsync. Here are some
examples, you get the idea::

  scp -S `pwd`/bin/ploy-ssh some.file demo-server:/some/path/
  rsync -e "bin/ploy-ssh" some/path fschulze@demo-server:/some/path


Instance names
==============

Instances have an **id** which is the part after the colon in the configuration.
They also have a **unique id** which has the form ``[masterid]-[instanceid]``.
The ``[masterid]`` depends on the plugin.
For plain instances it is ``plain``.
The ``[instanceid]`` is the **id** of the instance.
So, if you have the following config::

  [plain-instance:foo]
  ...

Then the **unique id** of the instance is ``plain-foo``.


Macro expansion
===============

In the ``ploy.conf`` you can use macro expansion for cleaner configuration
files. That looks like this::

  [ec2-instance:demo-server2]
  <= demo-server
  securitygroups = demo-server2

  [ec2-securitygroup:demo-server2]
  <= demo-server

All the options from the specified macro are copied with some exceptions depending on the backend plugin.

If you want to copy data from some other kind of options, you can add a colon
in the macro name. This is useful if you want to have a base for instances
like this::

  [macro:base-instance]
  keypair = default
  region = eu-west-1
  placement = eu-west-1a

  [ec2-instance:server]
  <= macro:base-instance
  ...


Massaging of config values
==========================

Plugins and ploy massage certain string values from the config to convert them to other types and do formatting or expansion.

You can use that yourself, which is useful for the Fabric integration and other things.

Here is a simple example::

  [section]
  massagers =
    intvalue=ploy.config.IntegerMassager
    boolvalue=ploy.config.BooleanMassager
  intvalue = 1
  boolvalue = yes

If you now access those values from for example a fabric task, you get the correct type instead of strings.

The above syntax registers the massagers only for that section.
You can register massagers for other sections or even section groups with this syntax::

  massagers =
    [option]=[sectiongroup]:import.path.to.massager
    [option]=[sectiongroup]:[section]:import.path.to.massager

The parts have the following meaning:

  ``[option]``
    This is the name of the option which should be massaged

  ``[sectiongroup]``
    The name of the section group.
    That's the part before the optional colon in a section.
    To match sections without a colon, use ``global``.
    To match every section, use ``*``.

  ``[section]``
    The name of the section to which this massager is applied.
    If empty, the current section is used.


Buildout specifics
==================

With zc.recipe.egg you can set a custom configfile location like this::

  [ploy]
  recipe = zc.recipe.egg
  eggs = ploy
  arguments = configpath="${buildout:directory}/etc/", configname="servers.cfg"


Changelog
=========

2.0.1 - 2023-06-19
------------------

* Fix ssh timeout handling.
  [witsch, fschulze]

* Fix getargspec deprecation warning with Python 3.x.
  [kappeck, fschulze]


2.0.0 - 2022-08-17
------------------

* Dropped support for Python 3.6.
  [fschulze]

* Added support for Python 3.10.
  [fschulze]


2.0.0b5 - 2021-07-17
--------------------

* Make a proper copy of the configuration for instances with multiple masters.
  [fschulze]

* Use ``format_exc`` for error reporting in ``ssh`` command for more details.
  [fschulze]


2.0.0b4 - 2020-05-13
--------------------

* Fix multiple master association for ``[instance:...]`` sections.
  [fschulze]


2.0.0b3 - 2019-06-09
--------------------

* Some Python 3.x encoding related fixes.
  [fschulze]


2.0.0b2 - 2019-06-03
--------------------

* Add 5 seconds default timeout to ssh connections.
  [fschulze]

* Dropped support for Python 3.4.
  [fschulze]


2.0.0b1 - 2018-02-06
--------------------

* Support YAML configuration files.
  [fschulze]

* Dropped support ``ssh`` lib, only ``paramiko`` is supported.
  [fschulze]

* Dropped support for Python 2.6 and 3.3.
  [fschulze]


1.5.2 - 2018-08-20
------------------

* Stop testing on Python 3.3.
  [fschulze]

* Fix multiple masters for ``instance``.
  [fschulze]


1.5.1 - 2017-12-17
------------------

* Fix getting fingerprints automatically when ``ssh-host-keys`` is used.
  [fschulze]


1.5.0 - 2017-10-03
------------------

* New ``ssh-host-keys`` option which allows to set host keys directly to
  force paramiko to use a specific key type to avoid fingerprint mismatches.
  [fschulze]


1.4.0 - 2017-10-02
------------------

* Allow instance implementations to return multiple fingerprints via
  ``get_fingerprints`` method.
  [fschulze]

* Support other key types than just rsa, because paramiko > 2 defaults to
  ``ed25519``.
  [fschulze]

* Output more information about used keys on fingerprint mismatch.
  [fschulze]


1.3.1 - 2016-06-02
------------------

* Don't get ``ssh-fingerprints`` from master if not set in instance config.
  This fixes automatic fingerprint fetching for EC2, ezjail etc.
  [fschulze]


1.3.0 - 2016-05-21
------------------

* Add option ``ssh-fingerprints`` which allows to specify multiple fingerprints.
  [fschulze]

* Support new output of ``ssh-keygen`` which includes the hash type and
  defaults to ``SHA256``.
  [fschulze]


1.2.1 - 2015-08-27
------------------

* Allow to specify multiple masters per instance.
  [fschulze]


1.2.0 - 2015-03-05
------------------

* Add ``Executor`` helper to handle local and remote command execution. It's
  also handling ssh agent forwarding enabled by either the users ssh config
  or the ``ssh-extra-args`` option.
  [fschulze]


1.1.0 - 2015-02-28
------------------

* Add ``ssh-extra-args`` option.
  [fschulze]

* Add ``annotate`` command to print the configuration with the source of each
  setting.
  [fschulze]

* Allow custom shebang in gzipped startup scripts.
  [fschulze]


1.0.3 - 2015-01-22
------------------

* Drop bad entries from our ``known_hosts`` file to prevent failures
  in paramiko.
  [fschulze]

* Set ``StrictHostKeyChecking=yes`` for all ssh connections to prevent
  interactive asking.
  [fschulze]


1.0.2 - 2014-10-04
------------------

* Ask before terminating an instance.
  [fschulze]

* Fix config setting propagation in some cases of proxied instances.
  [fschulze]

* Close all connections before exiting. This prevents hangs caused by open
  proxy command threads.
  [fschulze]

* Add option to log debug output.
  [fschulze]

* Add helpers to setup proxycommand in plugins.
  [fschulze]


1.0.1 - 2014-08-13
------------------

* Fix error output for plain instances on ssh connection failures.
  [fschulze]


1.0.0 - 2014-07-19
------------------

* Fix removal of bad host keys when using non standard ssh port.
  [fschulze]

* Renamed ``plain-master`` to ``plain``, so the uids of instances are nicer.
  [fschulze]


1.0rc15 - 2014-07-16
--------------------

* Only remove bad host key from known_hosts instead of clearing it completely.
  [fschulze]

* Removed support for ``proxyhost`` option. It caused hangs and failures on
  missing or invalid ssh fingerprints.
  [fschulze]

* Allow empty ``startup_script`` option to mean use no startup script.
  [fschulze]


1.0rc14 - 2014-07-15
--------------------

* Allow ``fingerprint`` to be set to a public host key file.
  [fschulze]


1.0rc13 - 2014-07-08
--------------------

* Better error message for instances missing because the plugin isn't installed.
  [fschulze]

* Fix tests when ploy itself isn't installed.
  [fschulze]


1.0rc12 - 2014-07-08
--------------------

* Use plain conftest.py instead of pytest plugin.
  [fschulze]


1.0rc11 - 2014-07-05
--------------------

* Fix uid method for master instances.
  [fschulze]


1.0rc10 - 2014-07-04
--------------------

* Print plugin versions with ``-v`` and ``--versions``.
  [fschulze]

* Python 3 compatibility.
  [fschulze]


1.0rc9 - 2014-06-29
-------------------

* Let plugins add type of lists to show with the ``list`` command.
  [fschulze]

* Use ``server`` and ``instance`` consistently.
  [fschulze]

* Always make instances accessible by their full name in the form of
  "[master_id]-[instance_id]". Only if there is no conflict, the short version
  with just "[instance_id]" is also available for convenience.
  [fschulze]

* Add instance id validator which limits to letters, numbers, dashes and
  underscores.
  [fschulze]

* Renamed from mr.awsome to ploy.
  [fschulze]


1.0rc8 - 2014-06-16
-------------------

* Give a bit more info on ssh connection failures.
  [fschulze]


1.0rc7 - 2014-06-11
-------------------

* Expose some test fixtures for reuse in plugins.
  [fschulze]

* Add before_terminate and after_start hooks and make it simple for plugins
  to add their own hooks.
  [fschulze]


1.0rc6 - 2014-06-10
-------------------

* Add ``get_path`` method to ConfigSection class.
  [fschulze]


1.0rc5 - 2014-06-09
-------------------

* Provide helper method ``ssh_args_from_info`` on BaseInstance to get the
  arguments for running the ssh executable from the info provided by
  init_ssh_key.
  [fschulze]

* Allow overwriting the command name in help messages for bsdploy.
  [fschulze]

* Make debug command usable for instances that don't have a startup script.
  [fschulze]

* Instances can provide a get_port method to return a default port.
  [fschulze]

* Catch socket errors in init_ssh_key of plain instances to print additional
  info for debugging.
  [fschulze]

* Delay setting of config file path to expose too early use of config in
  plugins. Refs #29
  [fschulze]


1.0rc4 - 2014-05-21
-------------------

* Fix massagers for ``[instance:...]`` sections.
  [fschulze]

* Copy massagers in ConfigSection.copy, so overrides in startup script work
  correctly.
  [fschulze]


1.0rc3 - 2014-05-15
-------------------

* Fetch fingerprints only when necessary. This speeds up connections when the
  fingerprint in known_hosts is still valid.
  [fschulze]


1.0rc2 - 2014-05-14
-------------------

* Moved setuptools-git from setup.py to .travis.yml, it's only needed for
  releases and testing.
  [fschulze]

* More tests.
  [fschulze]


1.0rc1 - 2014-03-23
-------------------

* Test, enhance and document adding massagers via config.
  [fschulze]

* Moved ec2 and fabric integration into separate plugins.
  [fschulze]

* You can now have instances with the same name if the belong to different
  masters, they will then get the name of the master as a prefix to their name.
  [fschulze]

* Add possibility to overwrite the default config name.
  [tomster]

* Improved ``proxycommand`` and documented it.
  [fschulze]

* Make the AWS instance available in masters. This changes the ``get_masters``
  plugin interface.
  [fschulze]

* Use os.execvp instead of subprocess.call. This allows the use of ``assh`` in
  the ``proxycommand`` option, which greatly simplifies it's use.
  [fschulze]

* Added command plugin hooks.
  [fschulze]

* The variable substitution for the ``proxycommand`` option now makes the other
  instances available in a dict under ``instances``. And adds ``known_hosts``.
  [fschulze]

* Load plugins via entry points instead of the ``plugin`` section in the config.
  [fschulze]

* Allow fallback to password for ssh to plain instances.
  [fschulze]

* Add option to ask for manual fingerprint validation for plain instances.
  [fschulze]


0.13 - 2013-09-20
-----------------

* Use os.path.expanduser on all paths, so that one can use ~ in config values
  like the aws keys.
  [fschulze]


0.12 - 2013-09-11
-----------------

* There is no need to add the AWS account id to security group names anymore.
  [fschulze]

* Rules are removed from security groups if they aren't defined in the config.
  [fschulze]

* Allow adding of custom config massagers from inside the config.
  [fschulze]

* Support block device maps to enable use of more than one ephemeral disk.
  [fschulze]

* Added ``do`` method on ec2 and plain instances which allows to call fabric
  commands.
  [fschulze]

* Use PathMassager for ``access-key-id`` and ``secret-access-key`` in the
  ``ec2-master`` section. This might break existing relative paths for these
  options.
  [fschulze]

* Added support for EBS boot instances.
  [fschulze]

* Add option ``ssh-key-filename`` to point to a private ssh key for ec2 and
  plain instances.
  [fschulze]

* Fix Fabric integration for newer versions of Fabric.
  [fschulze]

* Support ``proxycommand`` option for plain instances. This also caused a
  change in the ``init_ssh_key`` API for plugins.
  [fschulze]

* Support ``ProxyCommand`` from ``~/.ssh/config`` for plain instances.
  Requires Fabric 1.5.0 and Paramiko 1.9.0 or newer.
  [fschulze]


0.11 - 2012-11-08
-----------------

* Support both the ``ssh`` and ``paramiko`` libraries depending on which
  Fabric version is used.
  [fschulze]


0.10 - 2012-06-04
-----------------

* Added ``ec2-connection`` which helps in writing Fabric scripts which don't
  connect to a server but need access to the config and AWS (like uploading
  something to S3).
  [fschulze]

* Fix several problems with using a user name other than ``root`` for the
  ``do`` and ``ssh`` commands.
  [fschulze]

* Require Fabric >= 1.3.0.
  [fschulze]

* Require boto >= 2.0.
  [fschulze]

* Added hook for startup script options.
  [fschulze]

* Added possibility to configure hooks.
  [fschulze]

* Refactored to enable plugins for different virtualization or cloud providers.
  [fschulze]

* Added lots of tests.
  [fschulze]


0.9 - 2010-12-09
----------------

* Overwrites now also affect server creation, not just the startup script.
  [fschulze]

* Added ``list`` command which supports just listing ``snapshots`` for now.
  [fschulze]

* Added ``delete-volumes-on-terminate`` option to delete volumes created from
  snapshots on instance termination.
  [fschulze]

* Added support for creating volumes from snapshots on instance start.
  [natea, fschulze]

* Added support for ``~/.ssh/config``. This is a bit limited, because the
  paramiko config parser isn't very good.
  [fschulze]

* Added ``help`` command which provides some info for zsh autocompletion.
  [fschulze]

0.8 - 2010-04-21
----------------

* For the ``do`` command the Fabric options ``reject_unknown_hosts`` and
  ``disable_known_hosts`` now default to true.
  [fschulze]

* Allow adding normal servers to use with ``ssh`` and ``do`` commands.
  [fschulze]

* Refactored ssh connection handling to only open network connections when
  needed. Any fabric option which doesn't need a connection runs right away
  now (like ``-h`` and ``-l``).
  [fschulze]

* Fix status output after ``start``.
  [fschulze]

0.7 - 2010-03-22
----------------

* Added ``snapshot`` method to Server class for easy access from fabfiles.
  [fschulze]

0.6 - 2010-03-18
----------------

* It's now possible to specify files which contain the aws keys in the
  ``[aws]`` section with the ``access-key-id`` and ``secret-access-key``
  options.
  [fschulze]

* Added ``-c``/``--config`` option to specify the config file to use.
  [fschulze]

* Added ``-v``/``--version`` option.
  [tomster (Tom Lazar), fschulze]

* Comment lines in the startup script are now removed before any variables
  in it are expanded, not afterwards.
  [fschulze]

* Use argparse library instead of optparse for more powerful command line
  parsing.
  [fschulze]

0.5 - 2010-03-11
----------------

* Added gzipping of startup script by looking for ``gzip:`` prefix in the
  filename.
  [fschulze]

* Added macro expansion similar to zc.buildout 1.4.
  [fschulze]

0.4 - 2010-02-18
----------------

* Check console output in ``status`` and tell user about it.
  [fschulze]

* Friendly message instead of traceback when trying to ssh into an unavailable
  server.
  [fschulze]

* Remove comment lines from startup script if it's starting with ``#!/bin/sh``
  or ``#!/bin/bash``.
  [fschulze]

* Removed ``-r`` option for ``start`` and ``debug`` commands and replaced it
  with more general ``-o`` option.
  [fschulze]

* Made startup script optional (not all AMIs support it, especially Windows
  ones).
  [fschulze]

* The ``stop`` command actually only stops an instance now (only works with
  instances booted from an EBS volume) and the new ``terminate`` command now
  does what ``stop`` did before.
  [fschulze]

* Better error message when no console output is available for ssh finger
  print validation.
  [fschulze]

* Fixed indentation in documentation.
  [natea (Nate Aune), fschulze]

0.3 - 2010-02-08
----------------

* Removed the ``[host_string]`` prefix of the ``do`` command output.
  [fschulze]

0.2 - 2010-02-02
----------------

* Snapshots automatically get a description with date and volume id.
  [fschulze]

* The ssh command can now be used with scp and rsync.
  [fschulze]


0.1 - 2010-01-21
----------------

* Initial release
  [fschulze]



            

Raw data

            {
    "_id": null,
    "home_page": "http://github.com/ployground/ploy",
    "name": "ploy",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, !=3.6.*",
    "maintainer_email": "",
    "keywords": "",
    "author": "Florian Schulze",
    "author_email": "florian.schulze@gmx.net",
    "download_url": "https://files.pythonhosted.org/packages/38/da/db4e581f30766588c1b07686366e019d86b50eff1dcbf08b0c370dbb4db2/ploy-2.0.1.tar.gz",
    "platform": null,
    "description": "Overview\n========\n\nPloy is a commandline-tool to provision, manage and control server instances.\nThere are plugins for EC2 (ploy_ec2), FreeBSD Jails (ploy_ezjail) and more.\nYou can create, delete, monitor and ssh into instances while ploy handles the details like ssh fingerprint checking.\nAdditional plugins provide advanced functionality like integrating Fabric (ploy_fabric) and Ansible (ploy_ansible).\n\nYou can find the detailed documentation at http://ploy.readthedocs.org/en/latest/\n\n\nInstallation\n============\n\nploy is best installed with easy_install, pip or with zc.recipe.egg in a buildout.\nIt installs two scripts, ``ploy`` and ``ploy-ssh``.\n\n\nConfiguration\n=============\n\nAll information about server instances is located in ``ploy.conf``, which by default is looked up in ``etc/ploy.conf``.\n\n\nPlugins\n=======\n\nSupport for backends and further functionality is implemented by plugins. One plugin is included with ploy.\n\n``plain``\n  For regular servers accessible via ssh.\n\nYou can see which plugins are available in your current installation with ``ploy -v``.\n\n\nPlain\n-----\n\nWith plain instances you can put infos about servers into the configuration to benefit from some ploy features like ssh fingerprint checking and plugins like the Fabric integration.\n\n\nOptions\n~~~~~~~\n\n``host`` or ``ip``\n  (**required**) The host name or address for the server.\n\n``user``\n  The default user for ssh connections. If it's set to ``*`` then the current\n  local user name is used.\n\n``port``\n  The ssh port number.\n\n``ssh-host-keys`` or ``ssh-fingerprints``\n  (**required**) The public ssh host keys (or fingerprints) of the server.\n\n``ssh-host-keys``\n  It's best to use the public ssh host keys if available.\n  You can either specify the path, or put in the contents directly (``ssh-rsa AAAA...``).\n  Multiple host keys can be specified one per line, or separated by commas.\n\n``ssh-fingerprints``\n  If set to ``ask`` then manual interactive verification is enabled.\n  If set to ``ignore`` then no verification is performed at all!\n  Multiple fingerprints can be specified one per line, or separated by commas.\n  The format of fingerprints is either 16 bytes as hex numbers separated by colons,\n  the same 16 bytes prefixed by ``MD5:``,\n  or the hash type, followed by a colon and the base 64 encoded hash digest.\n\n``password-fallback``\n  If this boolean is true, then using a password as fallback is enabled if the\n  ssh key doesn't work. This is off by default.\n  You may be asked more than once for the password.\n  The first time is by paramiko which always happens, but is remembered.\n  The other times is by the ssh command line tool if it's invoked.\n\n``password``\n  Never use this directly! If password-fallback is enabled this password is\n  used. This is mainly meant for Fabric scripts which have other ways to get\n  the password. On use case is bootstrapping `FreeBSD <http://www.freebsd.org/>`_\n  from an `mfsBSD <http://mfsbsd.vx.sk/>`_ distribution where the password is\n  fixed.\n\n``proxycommand``\n  The command to use in the ProxyCommand option for ssh when using the ``ploy-ssh``\n  command. There are some variables which can be used:\n\n    ``path``\n      The directory of the ploy.conf file. Useful if you want to use the ``ploy-ssh``\n      command itself for the proxy.\n\n    ``known_hosts``\n      The absolute path to the known_hosts file managed by ploy.\n\n    ``instances``\n      The variables of other instances. For example: instances.foo.ip\n\n  In addition to these the variables of the instance itself are available.\n\n  A full example for a proxycommand::\n\n    proxycommand = {path}/../bin/ploy-ssh vm-master -W {ip}:22\n\n``ssh-key-filename``\n  Location of private ssh key to use.\n\n``ssh-extra-args``\n  A list of settings separated by newlines passed on to ssh.\n\n  Example::\n\n    ssh-extra-args = ForwardAgent yes\n\n\nSSH integration\n===============\n\nploy provides an additional tool ``ploy-ssh`` to easily perform SSH based\noperations against named instances. Particularly, it encapsulates the\nentire *SSH fingerprint* mechanism. For example EC2 instances are often\nshort-lived and normally trigger warnings, especially, if you are using\nelastic IPs.\n\n  Note:: it does so not by simply turning off these checks, but by transparently updating its own fingerprint list using mechanisms provided by the backend plugins.\n\nThe easiest scenario is simply to create an SSH session with an instance. You\ncan either use the ssh subcommand of the ploy tool like so::\n\n  ploy ssh INSTANCENAME\n\nAlternatively you can use the ploy-ssh command directly, like so::\n\n  ploy-ssh INSTANCENAME\n\nThe latter has been provided to support scp and rsync. Here are some\nexamples, you get the idea::\n\n  scp -S `pwd`/bin/ploy-ssh some.file demo-server:/some/path/\n  rsync -e \"bin/ploy-ssh\" some/path fschulze@demo-server:/some/path\n\n\nInstance names\n==============\n\nInstances have an **id** which is the part after the colon in the configuration.\nThey also have a **unique id** which has the form ``[masterid]-[instanceid]``.\nThe ``[masterid]`` depends on the plugin.\nFor plain instances it is ``plain``.\nThe ``[instanceid]`` is the **id** of the instance.\nSo, if you have the following config::\n\n  [plain-instance:foo]\n  ...\n\nThen the **unique id** of the instance is ``plain-foo``.\n\n\nMacro expansion\n===============\n\nIn the ``ploy.conf`` you can use macro expansion for cleaner configuration\nfiles. That looks like this::\n\n  [ec2-instance:demo-server2]\n  <= demo-server\n  securitygroups = demo-server2\n\n  [ec2-securitygroup:demo-server2]\n  <= demo-server\n\nAll the options from the specified macro are copied with some exceptions depending on the backend plugin.\n\nIf you want to copy data from some other kind of options, you can add a colon\nin the macro name. This is useful if you want to have a base for instances\nlike this::\n\n  [macro:base-instance]\n  keypair = default\n  region = eu-west-1\n  placement = eu-west-1a\n\n  [ec2-instance:server]\n  <= macro:base-instance\n  ...\n\n\nMassaging of config values\n==========================\n\nPlugins and ploy massage certain string values from the config to convert them to other types and do formatting or expansion.\n\nYou can use that yourself, which is useful for the Fabric integration and other things.\n\nHere is a simple example::\n\n  [section]\n  massagers =\n    intvalue=ploy.config.IntegerMassager\n    boolvalue=ploy.config.BooleanMassager\n  intvalue = 1\n  boolvalue = yes\n\nIf you now access those values from for example a fabric task, you get the correct type instead of strings.\n\nThe above syntax registers the massagers only for that section.\nYou can register massagers for other sections or even section groups with this syntax::\n\n  massagers =\n    [option]=[sectiongroup]:import.path.to.massager\n    [option]=[sectiongroup]:[section]:import.path.to.massager\n\nThe parts have the following meaning:\n\n  ``[option]``\n    This is the name of the option which should be massaged\n\n  ``[sectiongroup]``\n    The name of the section group.\n    That's the part before the optional colon in a section.\n    To match sections without a colon, use ``global``.\n    To match every section, use ``*``.\n\n  ``[section]``\n    The name of the section to which this massager is applied.\n    If empty, the current section is used.\n\n\nBuildout specifics\n==================\n\nWith zc.recipe.egg you can set a custom configfile location like this::\n\n  [ploy]\n  recipe = zc.recipe.egg\n  eggs = ploy\n  arguments = configpath=\"${buildout:directory}/etc/\", configname=\"servers.cfg\"\n\n\nChangelog\n=========\n\n2.0.1 - 2023-06-19\n------------------\n\n* Fix ssh timeout handling.\n  [witsch, fschulze]\n\n* Fix getargspec deprecation warning with Python 3.x.\n  [kappeck, fschulze]\n\n\n2.0.0 - 2022-08-17\n------------------\n\n* Dropped support for Python 3.6.\n  [fschulze]\n\n* Added support for Python 3.10.\n  [fschulze]\n\n\n2.0.0b5 - 2021-07-17\n--------------------\n\n* Make a proper copy of the configuration for instances with multiple masters.\n  [fschulze]\n\n* Use ``format_exc`` for error reporting in ``ssh`` command for more details.\n  [fschulze]\n\n\n2.0.0b4 - 2020-05-13\n--------------------\n\n* Fix multiple master association for ``[instance:...]`` sections.\n  [fschulze]\n\n\n2.0.0b3 - 2019-06-09\n--------------------\n\n* Some Python 3.x encoding related fixes.\n  [fschulze]\n\n\n2.0.0b2 - 2019-06-03\n--------------------\n\n* Add 5 seconds default timeout to ssh connections.\n  [fschulze]\n\n* Dropped support for Python 3.4.\n  [fschulze]\n\n\n2.0.0b1 - 2018-02-06\n--------------------\n\n* Support YAML configuration files.\n  [fschulze]\n\n* Dropped support ``ssh`` lib, only ``paramiko`` is supported.\n  [fschulze]\n\n* Dropped support for Python 2.6 and 3.3.\n  [fschulze]\n\n\n1.5.2 - 2018-08-20\n------------------\n\n* Stop testing on Python 3.3.\n  [fschulze]\n\n* Fix multiple masters for ``instance``.\n  [fschulze]\n\n\n1.5.1 - 2017-12-17\n------------------\n\n* Fix getting fingerprints automatically when ``ssh-host-keys`` is used.\n  [fschulze]\n\n\n1.5.0 - 2017-10-03\n------------------\n\n* New ``ssh-host-keys`` option which allows to set host keys directly to\n  force paramiko to use a specific key type to avoid fingerprint mismatches.\n  [fschulze]\n\n\n1.4.0 - 2017-10-02\n------------------\n\n* Allow instance implementations to return multiple fingerprints via\n  ``get_fingerprints`` method.\n  [fschulze]\n\n* Support other key types than just rsa, because paramiko > 2 defaults to\n  ``ed25519``.\n  [fschulze]\n\n* Output more information about used keys on fingerprint mismatch.\n  [fschulze]\n\n\n1.3.1 - 2016-06-02\n------------------\n\n* Don't get ``ssh-fingerprints`` from master if not set in instance config.\n  This fixes automatic fingerprint fetching for EC2, ezjail etc.\n  [fschulze]\n\n\n1.3.0 - 2016-05-21\n------------------\n\n* Add option ``ssh-fingerprints`` which allows to specify multiple fingerprints.\n  [fschulze]\n\n* Support new output of ``ssh-keygen`` which includes the hash type and\n  defaults to ``SHA256``.\n  [fschulze]\n\n\n1.2.1 - 2015-08-27\n------------------\n\n* Allow to specify multiple masters per instance.\n  [fschulze]\n\n\n1.2.0 - 2015-03-05\n------------------\n\n* Add ``Executor`` helper to handle local and remote command execution. It's\n  also handling ssh agent forwarding enabled by either the users ssh config\n  or the ``ssh-extra-args`` option.\n  [fschulze]\n\n\n1.1.0 - 2015-02-28\n------------------\n\n* Add ``ssh-extra-args`` option.\n  [fschulze]\n\n* Add ``annotate`` command to print the configuration with the source of each\n  setting.\n  [fschulze]\n\n* Allow custom shebang in gzipped startup scripts.\n  [fschulze]\n\n\n1.0.3 - 2015-01-22\n------------------\n\n* Drop bad entries from our ``known_hosts`` file to prevent failures\n  in paramiko.\n  [fschulze]\n\n* Set ``StrictHostKeyChecking=yes`` for all ssh connections to prevent\n  interactive asking.\n  [fschulze]\n\n\n1.0.2 - 2014-10-04\n------------------\n\n* Ask before terminating an instance.\n  [fschulze]\n\n* Fix config setting propagation in some cases of proxied instances.\n  [fschulze]\n\n* Close all connections before exiting. This prevents hangs caused by open\n  proxy command threads.\n  [fschulze]\n\n* Add option to log debug output.\n  [fschulze]\n\n* Add helpers to setup proxycommand in plugins.\n  [fschulze]\n\n\n1.0.1 - 2014-08-13\n------------------\n\n* Fix error output for plain instances on ssh connection failures.\n  [fschulze]\n\n\n1.0.0 - 2014-07-19\n------------------\n\n* Fix removal of bad host keys when using non standard ssh port.\n  [fschulze]\n\n* Renamed ``plain-master`` to ``plain``, so the uids of instances are nicer.\n  [fschulze]\n\n\n1.0rc15 - 2014-07-16\n--------------------\n\n* Only remove bad host key from known_hosts instead of clearing it completely.\n  [fschulze]\n\n* Removed support for ``proxyhost`` option. It caused hangs and failures on\n  missing or invalid ssh fingerprints.\n  [fschulze]\n\n* Allow empty ``startup_script`` option to mean use no startup script.\n  [fschulze]\n\n\n1.0rc14 - 2014-07-15\n--------------------\n\n* Allow ``fingerprint`` to be set to a public host key file.\n  [fschulze]\n\n\n1.0rc13 - 2014-07-08\n--------------------\n\n* Better error message for instances missing because the plugin isn't installed.\n  [fschulze]\n\n* Fix tests when ploy itself isn't installed.\n  [fschulze]\n\n\n1.0rc12 - 2014-07-08\n--------------------\n\n* Use plain conftest.py instead of pytest plugin.\n  [fschulze]\n\n\n1.0rc11 - 2014-07-05\n--------------------\n\n* Fix uid method for master instances.\n  [fschulze]\n\n\n1.0rc10 - 2014-07-04\n--------------------\n\n* Print plugin versions with ``-v`` and ``--versions``.\n  [fschulze]\n\n* Python 3 compatibility.\n  [fschulze]\n\n\n1.0rc9 - 2014-06-29\n-------------------\n\n* Let plugins add type of lists to show with the ``list`` command.\n  [fschulze]\n\n* Use ``server`` and ``instance`` consistently.\n  [fschulze]\n\n* Always make instances accessible by their full name in the form of\n  \"[master_id]-[instance_id]\". Only if there is no conflict, the short version\n  with just \"[instance_id]\" is also available for convenience.\n  [fschulze]\n\n* Add instance id validator which limits to letters, numbers, dashes and\n  underscores.\n  [fschulze]\n\n* Renamed from mr.awsome to ploy.\n  [fschulze]\n\n\n1.0rc8 - 2014-06-16\n-------------------\n\n* Give a bit more info on ssh connection failures.\n  [fschulze]\n\n\n1.0rc7 - 2014-06-11\n-------------------\n\n* Expose some test fixtures for reuse in plugins.\n  [fschulze]\n\n* Add before_terminate and after_start hooks and make it simple for plugins\n  to add their own hooks.\n  [fschulze]\n\n\n1.0rc6 - 2014-06-10\n-------------------\n\n* Add ``get_path`` method to ConfigSection class.\n  [fschulze]\n\n\n1.0rc5 - 2014-06-09\n-------------------\n\n* Provide helper method ``ssh_args_from_info`` on BaseInstance to get the\n  arguments for running the ssh executable from the info provided by\n  init_ssh_key.\n  [fschulze]\n\n* Allow overwriting the command name in help messages for bsdploy.\n  [fschulze]\n\n* Make debug command usable for instances that don't have a startup script.\n  [fschulze]\n\n* Instances can provide a get_port method to return a default port.\n  [fschulze]\n\n* Catch socket errors in init_ssh_key of plain instances to print additional\n  info for debugging.\n  [fschulze]\n\n* Delay setting of config file path to expose too early use of config in\n  plugins. Refs #29\n  [fschulze]\n\n\n1.0rc4 - 2014-05-21\n-------------------\n\n* Fix massagers for ``[instance:...]`` sections.\n  [fschulze]\n\n* Copy massagers in ConfigSection.copy, so overrides in startup script work\n  correctly.\n  [fschulze]\n\n\n1.0rc3 - 2014-05-15\n-------------------\n\n* Fetch fingerprints only when necessary. This speeds up connections when the\n  fingerprint in known_hosts is still valid.\n  [fschulze]\n\n\n1.0rc2 - 2014-05-14\n-------------------\n\n* Moved setuptools-git from setup.py to .travis.yml, it's only needed for\n  releases and testing.\n  [fschulze]\n\n* More tests.\n  [fschulze]\n\n\n1.0rc1 - 2014-03-23\n-------------------\n\n* Test, enhance and document adding massagers via config.\n  [fschulze]\n\n* Moved ec2 and fabric integration into separate plugins.\n  [fschulze]\n\n* You can now have instances with the same name if the belong to different\n  masters, they will then get the name of the master as a prefix to their name.\n  [fschulze]\n\n* Add possibility to overwrite the default config name.\n  [tomster]\n\n* Improved ``proxycommand`` and documented it.\n  [fschulze]\n\n* Make the AWS instance available in masters. This changes the ``get_masters``\n  plugin interface.\n  [fschulze]\n\n* Use os.execvp instead of subprocess.call. This allows the use of ``assh`` in\n  the ``proxycommand`` option, which greatly simplifies it's use.\n  [fschulze]\n\n* Added command plugin hooks.\n  [fschulze]\n\n* The variable substitution for the ``proxycommand`` option now makes the other\n  instances available in a dict under ``instances``. And adds ``known_hosts``.\n  [fschulze]\n\n* Load plugins via entry points instead of the ``plugin`` section in the config.\n  [fschulze]\n\n* Allow fallback to password for ssh to plain instances.\n  [fschulze]\n\n* Add option to ask for manual fingerprint validation for plain instances.\n  [fschulze]\n\n\n0.13 - 2013-09-20\n-----------------\n\n* Use os.path.expanduser on all paths, so that one can use ~ in config values\n  like the aws keys.\n  [fschulze]\n\n\n0.12 - 2013-09-11\n-----------------\n\n* There is no need to add the AWS account id to security group names anymore.\n  [fschulze]\n\n* Rules are removed from security groups if they aren't defined in the config.\n  [fschulze]\n\n* Allow adding of custom config massagers from inside the config.\n  [fschulze]\n\n* Support block device maps to enable use of more than one ephemeral disk.\n  [fschulze]\n\n* Added ``do`` method on ec2 and plain instances which allows to call fabric\n  commands.\n  [fschulze]\n\n* Use PathMassager for ``access-key-id`` and ``secret-access-key`` in the\n  ``ec2-master`` section. This might break existing relative paths for these\n  options.\n  [fschulze]\n\n* Added support for EBS boot instances.\n  [fschulze]\n\n* Add option ``ssh-key-filename`` to point to a private ssh key for ec2 and\n  plain instances.\n  [fschulze]\n\n* Fix Fabric integration for newer versions of Fabric.\n  [fschulze]\n\n* Support ``proxycommand`` option for plain instances. This also caused a\n  change in the ``init_ssh_key`` API for plugins.\n  [fschulze]\n\n* Support ``ProxyCommand`` from ``~/.ssh/config`` for plain instances.\n  Requires Fabric 1.5.0 and Paramiko 1.9.0 or newer.\n  [fschulze]\n\n\n0.11 - 2012-11-08\n-----------------\n\n* Support both the ``ssh`` and ``paramiko`` libraries depending on which\n  Fabric version is used.\n  [fschulze]\n\n\n0.10 - 2012-06-04\n-----------------\n\n* Added ``ec2-connection`` which helps in writing Fabric scripts which don't\n  connect to a server but need access to the config and AWS (like uploading\n  something to S3).\n  [fschulze]\n\n* Fix several problems with using a user name other than ``root`` for the\n  ``do`` and ``ssh`` commands.\n  [fschulze]\n\n* Require Fabric >= 1.3.0.\n  [fschulze]\n\n* Require boto >= 2.0.\n  [fschulze]\n\n* Added hook for startup script options.\n  [fschulze]\n\n* Added possibility to configure hooks.\n  [fschulze]\n\n* Refactored to enable plugins for different virtualization or cloud providers.\n  [fschulze]\n\n* Added lots of tests.\n  [fschulze]\n\n\n0.9 - 2010-12-09\n----------------\n\n* Overwrites now also affect server creation, not just the startup script.\n  [fschulze]\n\n* Added ``list`` command which supports just listing ``snapshots`` for now.\n  [fschulze]\n\n* Added ``delete-volumes-on-terminate`` option to delete volumes created from\n  snapshots on instance termination.\n  [fschulze]\n\n* Added support for creating volumes from snapshots on instance start.\n  [natea, fschulze]\n\n* Added support for ``~/.ssh/config``. This is a bit limited, because the\n  paramiko config parser isn't very good.\n  [fschulze]\n\n* Added ``help`` command which provides some info for zsh autocompletion.\n  [fschulze]\n\n0.8 - 2010-04-21\n----------------\n\n* For the ``do`` command the Fabric options ``reject_unknown_hosts`` and\n  ``disable_known_hosts`` now default to true.\n  [fschulze]\n\n* Allow adding normal servers to use with ``ssh`` and ``do`` commands.\n  [fschulze]\n\n* Refactored ssh connection handling to only open network connections when\n  needed. Any fabric option which doesn't need a connection runs right away\n  now (like ``-h`` and ``-l``).\n  [fschulze]\n\n* Fix status output after ``start``.\n  [fschulze]\n\n0.7 - 2010-03-22\n----------------\n\n* Added ``snapshot`` method to Server class for easy access from fabfiles.\n  [fschulze]\n\n0.6 - 2010-03-18\n----------------\n\n* It's now possible to specify files which contain the aws keys in the\n  ``[aws]`` section with the ``access-key-id`` and ``secret-access-key``\n  options.\n  [fschulze]\n\n* Added ``-c``/``--config`` option to specify the config file to use.\n  [fschulze]\n\n* Added ``-v``/``--version`` option.\n  [tomster (Tom Lazar), fschulze]\n\n* Comment lines in the startup script are now removed before any variables\n  in it are expanded, not afterwards.\n  [fschulze]\n\n* Use argparse library instead of optparse for more powerful command line\n  parsing.\n  [fschulze]\n\n0.5 - 2010-03-11\n----------------\n\n* Added gzipping of startup script by looking for ``gzip:`` prefix in the\n  filename.\n  [fschulze]\n\n* Added macro expansion similar to zc.buildout 1.4.\n  [fschulze]\n\n0.4 - 2010-02-18\n----------------\n\n* Check console output in ``status`` and tell user about it.\n  [fschulze]\n\n* Friendly message instead of traceback when trying to ssh into an unavailable\n  server.\n  [fschulze]\n\n* Remove comment lines from startup script if it's starting with ``#!/bin/sh``\n  or ``#!/bin/bash``.\n  [fschulze]\n\n* Removed ``-r`` option for ``start`` and ``debug`` commands and replaced it\n  with more general ``-o`` option.\n  [fschulze]\n\n* Made startup script optional (not all AMIs support it, especially Windows\n  ones).\n  [fschulze]\n\n* The ``stop`` command actually only stops an instance now (only works with\n  instances booted from an EBS volume) and the new ``terminate`` command now\n  does what ``stop`` did before.\n  [fschulze]\n\n* Better error message when no console output is available for ssh finger\n  print validation.\n  [fschulze]\n\n* Fixed indentation in documentation.\n  [natea (Nate Aune), fschulze]\n\n0.3 - 2010-02-08\n----------------\n\n* Removed the ``[host_string]`` prefix of the ``do`` command output.\n  [fschulze]\n\n0.2 - 2010-02-02\n----------------\n\n* Snapshots automatically get a description with date and volume id.\n  [fschulze]\n\n* The ssh command can now be used with scp and rsync.\n  [fschulze]\n\n\n0.1 - 2010-01-21\n----------------\n\n* Initial release\n  [fschulze]\n\n\n",
    "bugtrack_url": null,
    "license": "BSD 3-Clause License",
    "summary": "A tool to manage servers through a central configuration. Plugins allow provisioning, configuration and other management tasks.",
    "version": "2.0.1",
    "project_urls": {
        "Homepage": "http://github.com/ployground/ploy"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "607b268e2beba0263a8d20ba632f094d4d6cac1c618fbede8fa066b644550cb8",
                "md5": "248aac9cb6ac46f6fbc3f69b29900337",
                "sha256": "55240de7393090945f728a31123dea2d131c07261c7b071a361a4de7f6ce8e2a"
            },
            "downloads": -1,
            "filename": "ploy-2.0.1-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "248aac9cb6ac46f6fbc3f69b29900337",
            "packagetype": "bdist_wheel",
            "python_version": "2.7",
            "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, !=3.6.*",
            "size": 51880,
            "upload_time": "2023-06-19T08:43:29",
            "upload_time_iso_8601": "2023-06-19T08:43:29.560342Z",
            "url": "https://files.pythonhosted.org/packages/60/7b/268e2beba0263a8d20ba632f094d4d6cac1c618fbede8fa066b644550cb8/ploy-2.0.1-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "38dadb4e581f30766588c1b07686366e019d86b50eff1dcbf08b0c370dbb4db2",
                "md5": "993fc5460a31ba7bd524aac7d5b5c16d",
                "sha256": "2868ad8ab5a348532daeb139a49fbfddc5a783ef1dc878fbe28e0a102d582faf"
            },
            "downloads": -1,
            "filename": "ploy-2.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "993fc5460a31ba7bd524aac7d5b5c16d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, !=3.6.*",
            "size": 54823,
            "upload_time": "2023-06-19T08:43:32",
            "upload_time_iso_8601": "2023-06-19T08:43:32.283463Z",
            "url": "https://files.pythonhosted.org/packages/38/da/db4e581f30766588c1b07686366e019d86b50eff1dcbf08b0c370dbb4db2/ploy-2.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-06-19 08:43:32",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ployground",
    "github_project": "ploy",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "ploy"
}
        
Elapsed time: 0.28539s