hamstercage


Namehamstercage JSON
Version 0.2.1 PyPI version JSON
download
home_pagehttps://hamstercage.io/
SummaryPets not cattle. A straightforward way to manage configuration files.
upload_time2023-09-15 10:18:15
maintainer
docs_urlNone
authorStefan Bethke
requires_python>=3.8,<4.0
licenseApache2.0
keywords configuration-management
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Hamstercage – Config Management for Pets, not Cattle

[![](https://img.shields.io/github/workflow/status/hamstercage/hamstercage/Build%20and%20Publish%20to%20PyPI?style=for-the-badge)](https://github.com/hamstercage/hamstercage/actions)
[![](https://img.shields.io/pypi/v/hamstercage?style=for-the-badge)](https://pypi.org/project/hamstercage/)
[![](https://img.shields.io/badge/Twitter-1DA1F2?style=for-the-badge&logo=twitter&logoColor=white)](https://twitter.com/hamstercageio)
## Overview
If you work professionally with many machines and config, you like will have heard "cattle, not pets" as the philosophy for managing machines, VMs, etc., and you're likely using Ansible, Puppet, SaltStack, or another configuration management system that allows you to express configuration as code. This approach works well when you have many targets that share many traits, you have a lab where you can test configuration changes, and you have full time staff to take care of it all.

However, if you're running a handful of boxes or VPSes for a small organisation, or just for yourself and your friends and family, your workflow might actually look quite different: you make changes to the live configuration of your web server, for example, and after you're satisfied that everything is working, you might want to save the key bits of config somewhere safe, so you can refer back to it later. Setting up any of the heavy tools can be cumbersome, especially for making quick provisional changes: in the worstcase scenario, you modify a file in the source repo, commit it, then run the tool to apply it to your machine.

Hamstercage aims to make it easy to save and restore your config by using a Git repo, by editing the config files directly on the target machine, then saving the new config into the repository. In other words: pets, not cattle.

Hamstercage is geared towards managing config files as complete files. To keep things simple, there are no facilities to update individual lines in files, update system configuration settings through some API, or other more complex logic. Hamstercage can be used to manage shell script files or binaries for custom tools, however.

To allow one repository to be used for multiple targets, sets of files can be managed. Each set is called a tag. You can select the tags to use each time you run Hamstercage. The manifest also contains a list of hostnames and the tags to use for each. This makes it possible to run the same Hamstercage command on multiple hosts, and have files be applied to each according to their respective purpose. 

## Installation and Usage

See [Hamstercage Documentation](https://hamstercage.io/documentation/) and the [Hamstercage Homepage](https://hamstercage.io/).

## Quick Start

```shell
pip install hamstercage
mkdir hamsters
cd hamsters
git init
hamstercage init
hamstercage -t all add /etc/profile
git add .
git commit
```

## Developing Hamstercage

### Installing Development Snapshots

The GitHub workflow automatically builds a snapshot version on each push to the main branch. To work with these snapshots, install them from [Test PyPI](https://test.pypi.org/project/hamstercage/):
```shell
sudo pip install --upgrade --index-url https://test.pypi.org/simple/ hamstercage
```

### Poetry For Dependency Management and Building

The project uses [Poetry](https://python-poetry.org), which you should install locally. After installing Poetry, you can install all necessary dependencies:
```shell
poetry install
```

### Source Code Formatting With Black

The GitHub workflow checks source code formatting with [black](https://github.com/psf/black).

To format all code automatically:
```shell
poetry run black .
```

When working on the code, you might want to [configure your IDE to automatically reformat the code with black](https://black.readthedocs.io/en/stable/integrations/editors.html).

            

Raw data

            {
    "_id": null,
    "home_page": "https://hamstercage.io/",
    "name": "hamstercage",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8,<4.0",
    "maintainer_email": "",
    "keywords": "configuration-management",
    "author": "Stefan Bethke",
    "author_email": "stb@lassitu.de",
    "download_url": "https://files.pythonhosted.org/packages/56/24/eef8c2e2eb5bd9954a28313448c988ef629446f7c17344bb080fa39c95b7/hamstercage-0.2.1.tar.gz",
    "platform": null,
    "description": "# Hamstercage \u2013 Config Management for Pets, not Cattle\n\n[![](https://img.shields.io/github/workflow/status/hamstercage/hamstercage/Build%20and%20Publish%20to%20PyPI?style=for-the-badge)](https://github.com/hamstercage/hamstercage/actions)\n[![](https://img.shields.io/pypi/v/hamstercage?style=for-the-badge)](https://pypi.org/project/hamstercage/)\n[![](https://img.shields.io/badge/Twitter-1DA1F2?style=for-the-badge&logo=twitter&logoColor=white)](https://twitter.com/hamstercageio)\n## Overview\nIf you work professionally with many machines and config, you like will have heard \"cattle, not pets\" as the philosophy for managing machines, VMs, etc., and you're likely using Ansible, Puppet, SaltStack, or another configuration management system that allows you to express configuration as code. This approach works well when you have many targets that share many traits, you have a lab where you can test configuration changes, and you have full time staff to take care of it all.\n\nHowever, if you're running a handful of boxes or VPSes for a small organisation, or just for yourself and your friends and family, your workflow might actually look quite different: you make changes to the live configuration of your web server, for example, and after you're satisfied that everything is working, you might want to save the key bits of config somewhere safe, so you can refer back to it later. Setting up any of the heavy tools can be cumbersome, especially for making quick provisional changes: in the worstcase scenario, you modify a file in the source repo, commit it, then run the tool to apply it to your machine.\n\nHamstercage aims to make it easy to save and restore your config by using a Git repo, by editing the config files directly on the target machine, then saving the new config into the repository. In other words: pets, not cattle.\n\nHamstercage is geared towards managing config files as complete files. To keep things simple, there are no facilities to update individual lines in files, update system configuration settings through some API, or other more complex logic. Hamstercage can be used to manage shell script files or binaries for custom tools, however.\n\nTo allow one repository to be used for multiple targets, sets of files can be managed. Each set is called a tag. You can select the tags to use each time you run Hamstercage. The manifest also contains a list of hostnames and the tags to use for each. This makes it possible to run the same Hamstercage command on multiple hosts, and have files be applied to each according to their respective purpose. \n\n## Installation and Usage\n\nSee [Hamstercage Documentation](https://hamstercage.io/documentation/) and the [Hamstercage Homepage](https://hamstercage.io/).\n\n## Quick Start\n\n```shell\npip install hamstercage\nmkdir hamsters\ncd hamsters\ngit init\nhamstercage init\nhamstercage -t all add /etc/profile\ngit add .\ngit commit\n```\n\n## Developing Hamstercage\n\n### Installing Development Snapshots\n\nThe GitHub workflow automatically builds a snapshot version on each push to the main branch. To work with these snapshots, install them from [Test PyPI](https://test.pypi.org/project/hamstercage/):\n```shell\nsudo pip install --upgrade --index-url https://test.pypi.org/simple/ hamstercage\n```\n\n### Poetry For Dependency Management and Building\n\nThe project uses [Poetry](https://python-poetry.org), which you should install locally. After installing Poetry, you can install all necessary dependencies:\n```shell\npoetry install\n```\n\n### Source Code Formatting With Black\n\nThe GitHub workflow checks source code formatting with [black](https://github.com/psf/black).\n\nTo format all code automatically:\n```shell\npoetry run black .\n```\n\nWhen working on the code, you might want to [configure your IDE to automatically reformat the code with black](https://black.readthedocs.io/en/stable/integrations/editors.html).\n",
    "bugtrack_url": null,
    "license": "Apache2.0",
    "summary": "Pets not cattle. A straightforward way to manage configuration files.",
    "version": "0.2.1",
    "project_urls": {
        "Documentation": "https://hamstercage.io/documentation/",
        "Homepage": "https://hamstercage.io/",
        "Repository": "https://github.com/hamstercage/hamstercage/"
    },
    "split_keywords": [
        "configuration-management"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6b313a692ab7a4218134214a5f24d3d0c5ab0992574a0e86664557d437ea81d4",
                "md5": "5e5aad5c8681096bc4fe219afa44758d",
                "sha256": "2ec3b0260bd27a259ef19a5a2b29b34a1402e11266e3f9ce560dfba4fcf6c8ef"
            },
            "downloads": -1,
            "filename": "hamstercage-0.2.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5e5aad5c8681096bc4fe219afa44758d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8,<4.0",
            "size": 25925,
            "upload_time": "2023-09-15T10:18:13",
            "upload_time_iso_8601": "2023-09-15T10:18:13.614927Z",
            "url": "https://files.pythonhosted.org/packages/6b/31/3a692ab7a4218134214a5f24d3d0c5ab0992574a0e86664557d437ea81d4/hamstercage-0.2.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5624eef8c2e2eb5bd9954a28313448c988ef629446f7c17344bb080fa39c95b7",
                "md5": "a6e7d31d815249b8d40e00982ae80471",
                "sha256": "b3516a74d30260150585e67391dfb1c905413a433df114ae30fe650d67b23151"
            },
            "downloads": -1,
            "filename": "hamstercage-0.2.1.tar.gz",
            "has_sig": false,
            "md5_digest": "a6e7d31d815249b8d40e00982ae80471",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8,<4.0",
            "size": 23315,
            "upload_time": "2023-09-15T10:18:15",
            "upload_time_iso_8601": "2023-09-15T10:18:15.259467Z",
            "url": "https://files.pythonhosted.org/packages/56/24/eef8c2e2eb5bd9954a28313448c988ef629446f7c17344bb080fa39c95b7/hamstercage-0.2.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-09-15 10:18:15",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "hamstercage",
    "github_project": "hamstercage",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "hamstercage"
}
        
Elapsed time: 0.11684s