{"id":50930356,"url":"https://github.com/mitmx/timeweb-ansible-collection","last_synced_at":"2026-06-17T03:30:32.197Z","repository":{"id":344063560,"uuid":"1180286372","full_name":"mitmx/timeweb-ansible-collection","owner":"mitmx","description":"Коллекция, позволяющая настроить ansible dynamic inventory для timeweb","archived":false,"fork":false,"pushed_at":"2026-03-12T22:57:10.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-13T05:04:42.155Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mitmx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-12T22:22:39.000Z","updated_at":"2026-03-12T22:57:13.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/mitmx/timeweb-ansible-collection","commit_stats":null,"previous_names":["mitmx/timeweb-ansible-collection"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/mitmx/timeweb-ansible-collection","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitmx%2Ftimeweb-ansible-collection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitmx%2Ftimeweb-ansible-collection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitmx%2Ftimeweb-ansible-collection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitmx%2Ftimeweb-ansible-collection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mitmx","download_url":"https://codeload.github.com/mitmx/timeweb-ansible-collection/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitmx%2Ftimeweb-ansible-collection/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34433085,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-17T02:00:05.408Z","response_time":127,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-17T03:30:29.734Z","updated_at":"2026-06-17T03:30:32.190Z","avatar_url":"https://github.com/mitmx.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mitmx.timeweb\n\nAnsible-коллекция для интеграции с **Timeweb Cloud** через динамический \ninventory-плагин `mitmx.timeweb.timeweb`.\n\n---\n\n##  Описание\n\nКоллекция предоставляет inventory-плагин, который получает список \nсерверов из API Timeweb Cloud и динамически формирует инвентарь для Ansible.\n\n---\n\n##  Подробности коллекции\n\n| Поле             | Описание                                             |\n|------------------|------------------------------------------------------|\n| **Collection** | `mitmx.timeweb`                                        |\n| **Inventory Plugin** | `mitmx.timeweb.timeweb`                          |\n| **Supported API Endpoint** | `https://api.timeweb.cloud/api/v1/servers` |\n| **Requirements** | Python `requests`, действующий API-токен Timeweb     |\n\n\n---\n\n##  Установка\n\n### Из приватного Git-репозитория (HTTPS):\n\n```yaml\n# requirements.yml\ncollections:\n  - name: https://github.com/mitmx/timeweb-ansible-collection.git\n    type: git\n    version: main\n```\n\nУстановка:\n\n```bash\nansible-galaxy collection install -r requirements.yml\n```\n\nИли напрямую:\n\n```bash\nansible-galaxy collection install git+https://github.com/mitmx/timeweb-ansible-collection.git\n```\n\n---\n\n## Использование\n\nСоздайте inventory-файл, например `timeweb.yml`:\n\n```yaml\nplugin: mitmx.timeweb.timeweb\napi_token: \"{{ lookup('env','TIMEWEB_TOKEN') }}\"\nvalidate_certs: true\n\n# Необязательные параметры:\n# compose:\n#   ansible_user: \"'root'\"\n# keyed_groups:\n#   - key: region\n#     prefix: region_\n# groups:\n#   running: \"'status' in hostvars[inventory_hostname] and hostvars[inventory_hostname]['status'] == 'on'\"\n```\n\nПроверка работы:\n\n```bash\nansible-inventory -i timeweb.yml --list\n```\n\nЗапуск плейбука с этим inventory:\n\n```bash\nansible-playbook -i timeweb.yml site.yml\n```\n\n---\n\n## Получение API-токена\n\n1. Зайдите в свой аккаунт Timeweb Cloud → раздел **API токены**.\n2. Создайте токен с правами на чтение серверов.\n3. Установите его в переменную окружения:\n\n```bash\nexport TIMEWEB_TOKEN=\"ваш_api_токен\"\n```\n\n---\n\n## Параметры плагина\n\n| Параметр         | Обязателен | Значение по умолчанию       | Описание                                   |\n| ---------------- | ---------- | --------------------------- |--------------------------------------------|\n| `plugin`         | Да         | —                           | Должен быть `mitmx.timeweb.timeweb`        |\n| `api_token`      | Да         | —                           | API-токен Timeweb Cloud                    |\n| `api_endpoint`   | Нет        | `https://api.timeweb.cloud` | Базовый URL API                            |\n| `validate_certs` | Нет        | `true`                      | Проверять SSL-сертификаты                  |\n| `compose`        | Нет        | `{}`                        | Определение переменных через Jinja2        |\n| `keyed_groups`   | Нет        | `[]`                        | Автосоздание групп по значениям переменных |\n| `groups`         | Нет        | `{}`                        | Создание групп по условиям                 |\n\n---\n\n## Пример вывода\n\nРезультат `ansible-inventory --list`:\n\n```json\n{\n  \"_meta\": {\n    \"hostvars\": {\n      \"some-server-name-here\": {\n        \"ansible_host\": \"1.2.3.4\",\n        \"id\": 1234567,\n        \"status\": \"off\",\n        \"flavor\": null,\n        \"region\": \"ru-1\",\n        \"tags\": [],\n        \"project\": 123\n      },\n      \"another-server-name-here\": {\n        \"ansible_host\": \"1.2.3.5\",\n        \"id\": 1234568,\n        \"status\": \"on\",\n        \"flavor\": null,\n        \"region\": \"ru-3\",\n        \"tags\": [],\n        \"project\": 123\n      }\n    }\n  },\n  \"all\": {\n    \"children\": [\"ungrouped\"]\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmitmx%2Ftimeweb-ansible-collection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmitmx%2Ftimeweb-ansible-collection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmitmx%2Ftimeweb-ansible-collection/lists"}