{ "info": { "author": "Gena Makhomed", "author_email": "makhomed@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Console", "Intended Audience :: Developers", "Intended Audience :: System Administrators", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Operating System :: POSIX :: Linux", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 2 :: Only", "Topic :: Software Development", "Topic :: Software Development :: Build Tools", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: System :: Clustering", "Topic :: System :: Software Distribution", "Topic :: System :: Systems Administration" ], "description": ".. image:: https://travis-ci.org/makhomed/fabrix.svg?branch=master\n :target: https://travis-ci.org/makhomed/fabrix\n\n.. image:: https://codecov.io/gh/makhomed/fabrix/branch/master/graph/badge.svg\n :target: https://codecov.io/gh/makhomed/fabrix\n\n.. image:: https://readthedocs.org/projects/fabrix/badge/\n :target: https://fabrix.readthedocs.io/\n\n.. image:: https://badge.fury.io/py/Fabrix.svg\n :target: https://badge.fury.io/py/Fabrix\n\n|\n\n`Fabric `_ is tool for application deployment and systems administration tasks.\nBut configuration management with Fabric is not easy, because Fabric\ndoes not provide any useful functions for configuration management.\n\n`cuisine `_ and `fabtools `_\nare two well known attempts to make Fabric more comfortable for configiration management,\nthey are based on ideas of `Chef `_ and `Puppet `_.\n\n`Ansible `_ is well known tool for configuration management.\nBut Ansible has its own drawbacks. Ansible requires from users learning huge yaml-based programming language.\nAlready exists `more then 1300 Ansible modules `_.\nYou need to spent many time for learning this special Ansible programming language and Ansible modules.\nAnd after all you often still need to write own shell scripts or even write own Ansible modules,\nbecause potential of Ansible yaml-based programming language is very limited.\n\n**Fabrix** has an approach to create useful and simple Fabric extension for configuration management.\n\n**Fabrix** is build to integrate all advantages of Fabric and Ansible without any of their drawbacks.\n\n**Fabrix** allows write easy to understand Ansible-like idempotent fabfiles on pure Python.\n\n\nInstallation\n------------\n\n.. code-block:: bash\n\n pip install -U fabrix\n\nLinks\n-----\n\n* `Fabrix Documentation `_\n* `Fabrix GitHub Home Page `_\n* `Fabrix Python Package Index `_\n\nExamples\n--------\n\nUsing Jinja2 templates\n~~~~~~~~~~~~~~~~~~~~~~\n\n.. code-block:: python\n\n from fabrix.api import render\n\n def hello():\n print render(\"Hello, {{ name }}!\", name=\"World\")\n\nEditing systemd unit files\n~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n.. code-block:: python\n\n from fabrix.api import systemctl_edit, systemctl_restart\n\n def example():\n changed = systemctl_edit(\"mysqld.service\", \"\"\"\n [Service]\n LimitNOFILE = 262144\n \"\"\")\n if changed:\n systemctl_restart(\"mysqld.service\")\n\nEditing configuration files\n~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n.. code-block:: python\n\n from fabric.api import run\n from fabrix.api import edit_file, replace_line, substitute_line, strip_line\n\n def edit_grub():\n changed = edit_file(\"/etc/default/grub\",\n replace_line(r\"GRUB_TIMEOUT=.*\", r\"GRUB_TIMEOUT=1\"),\n replace_line(r\"(GRUB_CMDLINE_LINUX=.*)\\brhgb\\b(.*)\", r\"\\1selinux=0\\2\"),\n replace_line(r\"(GRUB_CMDLINE_LINUX=.*)\\bquiet\\b(.*)\", r\"\\1panic=1\\2\"),\n substitute_line(r\"\\s+\", r\" \"),\n strip_line(),\n )\n if changed:\n run(\"grub2-mkconfig -o /boot/grub2/grub.cfg\")\n\nInstalling PHP 7.0 from remi repo\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n.. code-block:: python\n\n from fabrix.api import is_file_not_exists, yum_install\n from fabrix.api import edit_file, edit_ini_section, replace_line\n\n def install_php():\n\n if is_file_not_exists(\"/etc/yum.repos.d/epel.repo\"):\n yum_install(\"https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm\")\n\n if is_file_not_exists(\"/etc/yum.repos.d/remi-php70.repo\"):\n yum_install(\"https://rpms.remirepo.net/enterprise/remi-release-7.rpm\")\n\n edit_file(\"/etc/yum.repos.d/remi-php70.repo\",\n edit_ini_section(\"[remi-php70]\",\n replace_line(\"enabled=0\", \"enabled=1\")\n )\n )\n\n yum_install(\"\"\"\n php-cli\n php-common\n php-fpm\n php-gd\n php-mbstring\n php-mysql\n php-pdo\n php-pear\n php-pecl-imagick\n php-process\n php-xml\n php-opcache\n php-mcrypt\n php-soap\n \"\"\")\n\nUsing external configuration\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nConfiguration file ``fabfile.yaml``:\n\n.. code-block:: yaml\n\n roles:\n - role: db\n hosts:\n - db1\n - db2\n - role: web\n hosts:\n - web1\n - web2\n - web3\n\n role_vars:\n - role: web\n vars:\n name: webserver\n\n host_vars:\n - host: web1\n vars:\n name: nginx\n\n defaults:\n name: generic\n\nCode ``fabfile.py``:\n\n.. code-block:: python\n\n from fabric.api import env, run, roles, execute\n from fabrix.api import conf\n\n @roles(\"db\")\n def migrate():\n print \"Hello, %s!\" % conf.name\n pass\n\n @roles(\"web\")\n def update():\n print \"Hello, %s!\" % conf.name\n pass\n\n def deploy():\n execute(migrate)\n execute(update)\n\nAfter running ``fab deploy`` we can see:\n\n.. code-block:: bash\n\n $ fab deploy\n [db1] Executing task 'migrate'\n Hello, generic!\n [db2] Executing task 'migrate'\n Hello, generic!\n [web1] Executing task 'update'\n Hello, nginx!\n [web2] Executing task 'update'\n Hello, webserver!\n [web3] Executing task 'update'\n Hello, webserver!\n\nMore details and examples you can see in `Fabrix Documentation `_.", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/makhomed/fabrix", "keywords": "configuration management", "license": "GPLv3", "maintainer": "", "maintainer_email": "", "name": "Fabrix", "package_url": "https://pypi.org/project/Fabrix/", "platform": "Linux", "project_url": "https://pypi.org/project/Fabrix/", "project_urls": { "Homepage": "https://github.com/makhomed/fabrix" }, "release_url": "https://pypi.org/project/Fabrix/0.3/", "requires_dist": null, "requires_python": "", "summary": "Fabrix is Fabric extension for configuration management", "version": "0.3" }, "last_serial": 3336226, "releases": { "0.3": [ { "comment_text": "", "digests": { "md5": "438db436e5563ce3a23f357b65b24cd6", "sha256": "91951c4379be9810f59a569c2c3e51632d717597df7026fc541c0037b54b159f" }, "downloads": -1, "filename": "Fabrix-0.3.tar.gz", "has_sig": false, "md5_digest": "438db436e5563ce3a23f357b65b24cd6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 44044, "upload_time": "2017-11-15T18:07:36", "url": "https://files.pythonhosted.org/packages/25/27/f696306461e40bd9d413f72c297a7b80a567468e76548421fa909e157e7e/Fabrix-0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "438db436e5563ce3a23f357b65b24cd6", "sha256": "91951c4379be9810f59a569c2c3e51632d717597df7026fc541c0037b54b159f" }, "downloads": -1, "filename": "Fabrix-0.3.tar.gz", "has_sig": false, "md5_digest": "438db436e5563ce3a23f357b65b24cd6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 44044, "upload_time": "2017-11-15T18:07:36", "url": "https://files.pythonhosted.org/packages/25/27/f696306461e40bd9d413f72c297a7b80a567468e76548421fa909e157e7e/Fabrix-0.3.tar.gz" } ] }