{ "info": { "author": "Dale Stirling and Darren Wurf", "author_email": "feedback@puredistortion.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Console", "Intended Audience :: Developers", "Intended Audience :: Information Technology", "Intended Audience :: System Administrators", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Topic :: Software Development :: Build Tools", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "budgie\n======\n \n[![Build Status](https://travis-ci.org/puredistortion/budgie.png?branch=master)](https://travis-ci.org/puredistortion/budgie)\n\nA pythonic remote control of servers via ssh\n\nInstallation\n------------\n\nInstall the library\n\n virtualenv venv && . venv/bin/activate # optional\n pip install sh\n wget https://raw2.github.com/puredistortion/budgie/master/budgie.py\n\n\nYou need to configure passwordless SSH for your remote hosts:\n\n ssh-keygen -q -t rsa -N 'your_password_here' -f ~/.ssh/id_rsa\n ssh-copy-id localhost # Repeat this for each host\n eval `ssh-agent`\n ssh-add\n ssh localhost pwd # test connection\n\nNext, create an SSH config file in `~/.ssh/config` describing your hosts:\n\n Host localhost\n User user\n HostName localhost\n IdentityFile ~/.ssh/id_rsa.key\n\n Host osx\n User user\n HostName steve-mac\n IdentityFile ~/.ssh/id_rsa.key\n\n Host projects\n User user\n HostName 192.168.1.30\n IdentityFile ~/.ssh/projects.key\n\n Host prod\n User produser\n HostName prod.example.com\n IdentityFile ~/.ssh/deploy.key\n\nUsage\n-----\n\nNow you can run remote commands using simple python code\n\n from budgie import localhost\n print localhost.hostname(), localhost.uptime()\n localhost.touch('/tmp/latest')\n\nYou can also callhosts ing this alternate method if the magic above is to much\n\n import budgie\n print budgie.ssh('localhost'), budgie.ssh('localhost').uptime()\n budgie.ssh('localhost').touch('/tmp/latest')\n\n\nPassing in SSH Options\n----------------------\nbudgie will allow the passing in of SSH options. At this time this is done through the bake method in the same way you would pass this into the sh.ssh()\n\n budgie.localhost.bake('-o', 'UserKnownHostsFile=/dev/null', '-o', 'StrictHostKeyChecking=no').whoami()\n\nor \n\n budgie.ssh().bake('-o', 'UserKnownHostsFile=/dev/null', '-o', 'StrictHostKeyChecking=no', '127.0.0.1').whoami()\n\nThis does need to be cleaned up to make more logical sense. \n\nUsing Sudo\n----------\nJust as in sh sudo is just treated as another budgie command. \n\nSo executing a remote command is as simple as:\n\n budgie.localhost.sudo.cat('/etc/hosts')\n\nYou will need to ensure that sudo is either allowing the remote user you connect with to exec the command via /etc/sudoers\n\nBudgie Host Groups\n-----------------\nbudgie offers the ability to bundle ssh hosts for batch command execution. This is done through creating a host group. A host group will take in a list of host names or budgie.ssh instances.\n\n web_servers = budgie.HostGroup()\n web_servers.add('www1.example.com')\n web_servers.add('www2.example.com')\n\n webservers.add(['www1.example.com', 'www2.example.com'])\n\n www1 = budgie.ssh('www1.example.com')\n www2 = budgie.ssh('www2.example.com')\n webservers.add([www1, www2])\n\nor\n\n web_servers.HostGroup(['www1.example.com', 'www2.example.com'])\n\n www1 = budgie.ssh('www1.example.com')\n www2 = budgie.ssh('www2.example.com')\n web_servers.HostGroup([www1, www2])\n\nOnce a budgie.HostGroup() is created it can be intereacted with like a standard dictionary.\n\nCommands can be executed against the host group and results of execution will be supplied back as a dictionary\n\n result = web_servers.whoami()\n\nResult would contain\n\n {'www1': 'www1.example.com', 'www2': 'www2.example.com'}\n\n\n\nRunning Tests\n-------------\n\n`tests.py` can be called via the commandlime and is run on each commit through Travis CIq\n\nTests can be called by running\n\n python tests.py\n\nThis is the current test suite being applied to builds\n *Import Test\n *Direct Call Goes to Exception Test\n *Command Execution (whoami) Test\n *HostGroup Creation\n *HostGroup Manipulation (add, remove)\n *HostGroup Command Execution (whoami) Test\n\nCommand execution test uses SSH options that allow for the automatic generation of SSH keypairs and discarding them from known hosts at the conclusion of the connection.\n\n\n\n", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://www.python.org/puredistortion/budgie", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "budgie", "package_url": "https://pypi.org/project/budgie/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/budgie/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://www.python.org/puredistortion/budgie" }, "release_url": "https://pypi.org/project/budgie/0.1/", "requires_dist": null, "requires_python": null, "summary": "Pythonic remote commands via ssh", "version": "0.1" }, "last_serial": 1216518, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "a35621b62b9627eab94a75a29df43b1d", "sha256": "154ce1bc2bdb8492247daf33b7eda15655072ac3debc56dcac393897374afb33" }, "downloads": -1, "filename": "budgie-0.1.tar.gz", "has_sig": false, "md5_digest": "a35621b62b9627eab94a75a29df43b1d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5080, "upload_time": "2014-09-07T22:38:59", "url": "https://files.pythonhosted.org/packages/e8/02/67e8aa454764f54de6e5af8409accbd9346107675b8a4fcec059adbf345f/budgie-0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a35621b62b9627eab94a75a29df43b1d", "sha256": "154ce1bc2bdb8492247daf33b7eda15655072ac3debc56dcac393897374afb33" }, "downloads": -1, "filename": "budgie-0.1.tar.gz", "has_sig": false, "md5_digest": "a35621b62b9627eab94a75a29df43b1d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5080, "upload_time": "2014-09-07T22:38:59", "url": "https://files.pythonhosted.org/packages/e8/02/67e8aa454764f54de6e5af8409accbd9346107675b8a4fcec059adbf345f/budgie-0.1.tar.gz" } ] }