{"id":19427299,"url":"https://github.com/theasp/ansible-inventory-yaml-groups","last_synced_at":"2025-07-26T21:07:36.538Z","repository":{"id":81613117,"uuid":"93668393","full_name":"theasp/ansible-inventory-yaml-groups","owner":"theasp","description":"Ansible inventory from YML","archived":false,"fork":false,"pushed_at":"2022-10-04T21:18:51.000Z","size":28,"stargazers_count":6,"open_issues_count":1,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-24T17:47:24.542Z","etag":null,"topics":["ansible","ansible-inventory"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/theasp.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}},"created_at":"2017-06-07T18:47:43.000Z","updated_at":"2023-03-19T14:59:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"24dd377f-9cc4-4882-9dfd-174eb021354e","html_url":"https://github.com/theasp/ansible-inventory-yaml-groups","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/theasp/ansible-inventory-yaml-groups","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theasp%2Fansible-inventory-yaml-groups","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theasp%2Fansible-inventory-yaml-groups/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theasp%2Fansible-inventory-yaml-groups/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theasp%2Fansible-inventory-yaml-groups/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/theasp","download_url":"https://codeload.github.com/theasp/ansible-inventory-yaml-groups/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theasp%2Fansible-inventory-yaml-groups/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267236380,"owners_count":24057654,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-26T02:00:08.937Z","response_time":62,"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":["ansible","ansible-inventory"],"created_at":"2024-11-10T14:11:13.360Z","updated_at":"2025-07-26T21:07:36.484Z","avatar_url":"https://github.com/theasp.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ansible-inventory-yaml-groups\nAlternative YAML formatted inventory for Ansible. This allows you to to assign groups to hosts as well as hosts to groups, and easily make new groups that are supersets and subsets of other groups.\n\n*NOTE:* Ansible supports it's own YAML formatted inventory, see: https://github.com/ansible/ansible/blob/devel/examples/hosts.yaml\n\n# Installation\n\nIf you are using Ansible 2.4 or later you can use the inventory plugin version, otherwise you must use the dynamic inventory version.\n\n## Inventory Plugin (2.4+)\n\nAdd the following to `ansible.cfg`:\n```ini\n[defaults]\ninventory = hosts.yml\ninventory_plugins = /path/to/ansible-inventory-yaml-groups/inventory_plugins\n\n[inventory]\nenable_plugins = host_list, script, yaml_groups, ini\n```\n\n## Dynamic Inventory (Any)\n\nIn `ansible.cfg`, set `inventory` to `yaml_groups.py`.  Addthe following to `ansible.cfg`:\n```ini\n[defaults]\ninventory = /path/to/ansible-inventory-yaml-groups/yaml_groups.py\n```\n\nYou can control the name of the `hosts.yml` file by setting `ANSIBLE_HOSTS_YML`.\n\n# Format of `hosts.yml`\n\nThe YAML file is divided into two sections, `groups` and `hosts`.\n\n## Groups (optional)\nEntries in `groups` are optional, but they allow the creation groups by listing it's `hosts`, and/or `vars` as in the standard Ansible inventory file.  Hosts listed in `hosts` will be created even if there is no corresponding entry in the `hosts` section.\n\nYou can also provide a list of groups to `include` all hosts from, a list of groups to `require` that each host belong to, and a list of groups to `exclude` that each host must not belong to.  The order in which these groups are updated is undefined.  You can use the implicit `all` group here, which is only useful for `include`.\n\n## Hosts (optional)\nEach host in the `hosts` section can have a list of `groups` that it will be a member of, and host varibles defined in `vars`.  Groups will be created even if there is no corresponding group in the groups section.\n\n## Example: `hosts.yml`\n```yaml\n---\ngroups:\n  app1-prod:\n    include:\n      - app1\n    require:\n      - prod\n\n  app1-dev:\n    include:\n      - app1\n    require:\n      - prod\n\n  app2-prod:\n    hosts:\n      - app2-web1\n\n  app2:\n    include:\n      - app2-prod\n      - app2-dev\n\n  all-apps:\n    include:\n      - app1\n      - app2\n\nhosts:\n  web-app1-prod.location1.com:\n    groups:\n      - app1\n      - location1\n      - prod\n      - web\n\n  db-app1-prod.location1.com:\n    groups:\n      - app1\n      - location1\n      - prod\n      - db\n\n  app1-dev.location1.com:\n    vars:\n      EXAMPLE: \"true\"\n    groups:\n      - app1\n      - location2\n      - dev\n      - web\n      - db\n```\n\n# See Also\n- https://github.com/ansible/ansible/blob/devel/examples/hosts.yaml\n- https://github.com/jtyr/ansible-yaml_inventory\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheasp%2Fansible-inventory-yaml-groups","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftheasp%2Fansible-inventory-yaml-groups","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheasp%2Fansible-inventory-yaml-groups/lists"}