aisible


Nameaisible JSON
Version 0.2.0 PyPI version JSON
download
home_pagehttps://github.com/etapsc/AIsible
SummaryA tool to run Ansible commands and analyze output with LLMs
upload_time2024-09-11 03:38:41
maintainerNone
docs_urlNone
authorKullat Nunu
requires_python>=3.7
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Aisible

Aisible is an advanced DevOps tool that combines the power of Ansible with AI-driven analysis. It runs Ansible ad-hoc commands or playbooks and uses Language Models (LLMs) to provide insightful summaries and analyses of the output.

## Purpose

Aisible aims to streamline DevOps workflows by:

1. Executing Ansible commands or playbooks across your infrastructure
2. Analyzing the output using state-of-the-art Language Models
3. Providing concise, actionable insights about your systems' state

This tool is particularly useful for:
- Quick system health checks
- Identifying outliers and potential issues in your infrastructure
- Summarizing complex Ansible outputs for easier understanding

## Installation

To install Aisible, you can use pip:

```bash
pip install aisible
```

Ensure you have Python 3.7 or later installed on your system.

## Configuration

Aisible uses a configuration file ('aisible.cfg') to customize its behavior. By default, it looks for this file in the current directory, but you can specify a different path using the '-c' or '--config' option.

Example 'aisible.cfg':

```ini
[prompts]
system_message = Your custom system message here.
user_message_template = Your custom user message template here.
request_specific_user_message_addon = Additional instructions for the LLM.
```

If no custom prompts are specified in the configuration file, Aisible uses the default prompts.
The default prompts are designed to provide comprehensive and relevant analysis of Ansible outputs without requiring any additional configuration. However, you can customize them in the configuration file to better suit your specific needs.
Or ypu can improve prompts for your specific environment by specifying `request_specific_user_message_addon` in the configuration file.

## Usage

Aisible can be used to run Ansible ad-hoc commands or playbooks:

```bash
aisible [pattern] -i INVENTORY [options]
```

### Options:

- '-i, --inventory': Specify inventory file path (required)
- '-m, --module': Module name to execute (for ad-hoc commands)
- '-p, --playbook': Path to Ansible playbook file
- '-a, --args': Module arguments (for ad-hoc commands)
- '-u, --user': Connect as this user
- '-b, --become': Run operations with become (privilege escalation)
- '-K, --ask-become-pass': Ask for privilege escalation password
- '-c, --config': Path to config file (default: aisible.cfg)

### Environment Variables:

Set at least one of the following API keys as environment variables:

- 'ANTHROPIC_API_KEY': For using Anthropic's Claude
- 'OPENAI_API_KEY': For using OpenAI's GPT
- 'GEMINI_API_KEY': For using Google's Gemini

## Examples

1. Run an ad-hoc command to check disk usage:

```bash
aisible all -i inventory.yml -m shell -a "df -h"
```

2. Execute a playbook:

```bash
aisible all -i inventory.yml -p my_playbook.yml
```

3. Check the status of a service with privilege escalation:

```bash
aisible webservers -i inventory.yml -m systemd -a "name=nginx state=started" -b -K
```

4. Use a custom configuration file:

```bash
aisible all -i inventory.yml -m ping -c /path/to/custom_config.cfg
```

## Output

Aisible will execute the Ansible command or playbook and then provide an AI-generated analysis of the output. The analysis will include:

- Overview of the execution status
- Key metrics and data points
- Identification of outliers or deviations
- Notable patterns in the data
- Suggestions for further investigation or action

## Examples with output

```bash
aisible -i hosts.yaml all -p system_check.yml
```

Output:
```plaintext
System Check Summary
====================

Hosts: 15 (host01 to host15)

SSH Connections:
  3 connections: 14 hosts
  5 connections: host12

Ubuntu Version:
  All hosts: Ubuntu 22.04.4 LTS

Nginx Status:
  All hosts: Active

Security Messages:
  All hosts: No critical security messages found
  
Disk Usage:
  Root partition (/dev/sda3):
    Size: 1.6T
    Used: 83G - 101G (6-7%)
  Boot partition (/dev/sda2):
    Size: 2.0G
    Used: 170M (10%)

Memory Usage:
  Total: 47Gi on all hosts
  Used:
    10Gi - 20Gi: 7 hosts
    21Gi - 30Gi: 6 hosts
    34Gi: host05
  Free:
    10Gi - 20Gi: 3 hosts
    21Gi - 30Gi: 9 hosts
    31Gi - 34Gi: 3 hosts

Notes:
- All hosts running Ubuntu 22.04.4 LTS
- Nginx active on all hosts
- Disk usage consistent across hosts, low utilization
- Memory usage varies, with host05 showing highest usage

Recommendations:
1. Investigate higher SSH connections on host12
2. Monitor memory usage on host05

This summary provides an overview of the system check results, highlighting key findings and potential areas for further investigation.
```


## Contributing

Contributions to Aisible are welcome! Please refer to the CONTRIBUTING.md file for guidelines on how to contribute to this project.

## License

Aisible is released under the MIT License. See the LICENSE file for more details.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/etapsc/AIsible",
    "name": "aisible",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": null,
    "author": "Kullat Nunu",
    "author_email": "ak@etapiscium.com",
    "download_url": "https://files.pythonhosted.org/packages/6d/16/a61bf6751f0c658fb0a517dfb54c0e12f2781323602d9e9262e8480013fa/aisible-0.2.0.tar.gz",
    "platform": null,
    "description": "# Aisible\n\nAisible is an advanced DevOps tool that combines the power of Ansible with AI-driven analysis. It runs Ansible ad-hoc commands or playbooks and uses Language Models (LLMs) to provide insightful summaries and analyses of the output.\n\n## Purpose\n\nAisible aims to streamline DevOps workflows by:\n\n1. Executing Ansible commands or playbooks across your infrastructure\n2. Analyzing the output using state-of-the-art Language Models\n3. Providing concise, actionable insights about your systems' state\n\nThis tool is particularly useful for:\n- Quick system health checks\n- Identifying outliers and potential issues in your infrastructure\n- Summarizing complex Ansible outputs for easier understanding\n\n## Installation\n\nTo install Aisible, you can use pip:\n\n```bash\npip install aisible\n```\n\nEnsure you have Python 3.7 or later installed on your system.\n\n## Configuration\n\nAisible uses a configuration file ('aisible.cfg') to customize its behavior. By default, it looks for this file in the current directory, but you can specify a different path using the '-c' or '--config' option.\n\nExample 'aisible.cfg':\n\n```ini\n[prompts]\nsystem_message = Your custom system message here.\nuser_message_template = Your custom user message template here.\nrequest_specific_user_message_addon = Additional instructions for the LLM.\n```\n\nIf no custom prompts are specified in the configuration file, Aisible uses the default prompts.\nThe default prompts are designed to provide comprehensive and relevant analysis of Ansible outputs without requiring any additional configuration. However, you can customize them in the configuration file to better suit your specific needs.\nOr ypu can improve prompts for your specific environment by specifying `request_specific_user_message_addon` in the configuration file.\n\n## Usage\n\nAisible can be used to run Ansible ad-hoc commands or playbooks:\n\n```bash\naisible [pattern] -i INVENTORY [options]\n```\n\n### Options:\n\n- '-i, --inventory': Specify inventory file path (required)\n- '-m, --module': Module name to execute (for ad-hoc commands)\n- '-p, --playbook': Path to Ansible playbook file\n- '-a, --args': Module arguments (for ad-hoc commands)\n- '-u, --user': Connect as this user\n- '-b, --become': Run operations with become (privilege escalation)\n- '-K, --ask-become-pass': Ask for privilege escalation password\n- '-c, --config': Path to config file (default: aisible.cfg)\n\n### Environment Variables:\n\nSet at least one of the following API keys as environment variables:\n\n- 'ANTHROPIC_API_KEY': For using Anthropic's Claude\n- 'OPENAI_API_KEY': For using OpenAI's GPT\n- 'GEMINI_API_KEY': For using Google's Gemini\n\n## Examples\n\n1. Run an ad-hoc command to check disk usage:\n\n```bash\naisible all -i inventory.yml -m shell -a \"df -h\"\n```\n\n2. Execute a playbook:\n\n```bash\naisible all -i inventory.yml -p my_playbook.yml\n```\n\n3. Check the status of a service with privilege escalation:\n\n```bash\naisible webservers -i inventory.yml -m systemd -a \"name=nginx state=started\" -b -K\n```\n\n4. Use a custom configuration file:\n\n```bash\naisible all -i inventory.yml -m ping -c /path/to/custom_config.cfg\n```\n\n## Output\n\nAisible will execute the Ansible command or playbook and then provide an AI-generated analysis of the output. The analysis will include:\n\n- Overview of the execution status\n- Key metrics and data points\n- Identification of outliers or deviations\n- Notable patterns in the data\n- Suggestions for further investigation or action\n\n## Examples with output\n\n```bash\naisible -i hosts.yaml all -p system_check.yml\n```\n\nOutput:\n```plaintext\nSystem Check Summary\n====================\n\nHosts: 15 (host01 to host15)\n\nSSH Connections:\n  3 connections: 14 hosts\n  5 connections: host12\n\nUbuntu Version:\n  All hosts: Ubuntu 22.04.4 LTS\n\nNginx Status:\n  All hosts: Active\n\nSecurity Messages:\n  All hosts: No critical security messages found\n  \nDisk Usage:\n  Root partition (/dev/sda3):\n    Size: 1.6T\n    Used: 83G - 101G (6-7%)\n  Boot partition (/dev/sda2):\n    Size: 2.0G\n    Used: 170M (10%)\n\nMemory Usage:\n  Total: 47Gi on all hosts\n  Used:\n    10Gi - 20Gi: 7 hosts\n    21Gi - 30Gi: 6 hosts\n    34Gi: host05\n  Free:\n    10Gi - 20Gi: 3 hosts\n    21Gi - 30Gi: 9 hosts\n    31Gi - 34Gi: 3 hosts\n\nNotes:\n- All hosts running Ubuntu 22.04.4 LTS\n- Nginx active on all hosts\n- Disk usage consistent across hosts, low utilization\n- Memory usage varies, with host05 showing highest usage\n\nRecommendations:\n1. Investigate higher SSH connections on host12\n2. Monitor memory usage on host05\n\nThis summary provides an overview of the system check results, highlighting key findings and potential areas for further investigation.\n```\n\n\n## Contributing\n\nContributions to Aisible are welcome! Please refer to the CONTRIBUTING.md file for guidelines on how to contribute to this project.\n\n## License\n\nAisible is released under the MIT License. See the LICENSE file for more details.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A tool to run Ansible commands and analyze output with LLMs",
    "version": "0.2.0",
    "project_urls": {
        "Homepage": "https://github.com/etapsc/AIsible"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d7df5549dbdeecbf1faa91a64956da2c0a4af7341b257d4780e8917354e84d2c",
                "md5": "f948c838814b018da1be237184f044be",
                "sha256": "2ca955c40d717771d01215cb6aca750479ff158775cda74f2ca53989c0d13293"
            },
            "downloads": -1,
            "filename": "aisible-0.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f948c838814b018da1be237184f044be",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 8126,
            "upload_time": "2024-09-11T03:38:39",
            "upload_time_iso_8601": "2024-09-11T03:38:39.540109Z",
            "url": "https://files.pythonhosted.org/packages/d7/df/5549dbdeecbf1faa91a64956da2c0a4af7341b257d4780e8917354e84d2c/aisible-0.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6d16a61bf6751f0c658fb0a517dfb54c0e12f2781323602d9e9262e8480013fa",
                "md5": "be27bd29b8e306a8009f35d856b19d06",
                "sha256": "f1df10ec18acb8bff72a1ec3b097a702bf341a7f738f8402c5eee9da19428a73"
            },
            "downloads": -1,
            "filename": "aisible-0.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "be27bd29b8e306a8009f35d856b19d06",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 8421,
            "upload_time": "2024-09-11T03:38:41",
            "upload_time_iso_8601": "2024-09-11T03:38:41.057571Z",
            "url": "https://files.pythonhosted.org/packages/6d/16/a61bf6751f0c658fb0a517dfb54c0e12f2781323602d9e9262e8480013fa/aisible-0.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-11 03:38:41",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "etapsc",
    "github_project": "AIsible",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "aisible"
}
        
Elapsed time: 0.33977s