From ansible-toolkit
Organizes Ansible inventories in INI/YAML, manages group/host vars, and configures dynamic sources like AWS EC2. Useful for host grouping and playbook targeting.
How this skill is triggered — by the user, by Claude, or both
Slash command
/ansible-toolkit:inventory-managerThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Organize Ansible inventory with proper host groups, variables, and dynamic inventory sources.
Organize Ansible inventory with proper host groups, variables, and dynamic inventory sources.
INI format:
# inventory/production
[webservers]
web1 ansible_host=192.168.1.10
web2 ansible_host=192.168.1.11
[databases]
db1 ansible_host=192.168.1.20
db2 ansible_host=192.168.1.21
[loadbalancers]
lb1 ansible_host=192.168.1.30
[production:children]
webservers
databases
loadbalancers
[production:vars]
ansible_user=deploy
ansible_python_interpreter=/usr/bin/python3
environment=production
YAML format:
# inventory/production.yml
all:
children:
production:
children:
webservers:
hosts:
web1:
ansible_host: 192.168.1.10
web2:
ansible_host: 192.168.1.11
databases:
hosts:
db1:
ansible_host: 192.168.1.20
db2:
ansible_host: 192.168.1.21
loadbalancers:
hosts:
lb1:
ansible_host: 192.168.1.30
vars:
ansible_user: deploy
environment: production
Directory structure:
inventory/
├── production
├── staging
├── group_vars/
│ ├── all.yml
│ ├── webservers.yml
│ ├── databases.yml
│ └── production.yml
└── host_vars/
├── web1.yml
└── db1.yml
group_vars/all.yml:
---
# Variables for all hosts
ansible_python_interpreter: /usr/bin/python3
ntp_servers:
- 0.pool.ntp.org
- 1.pool.ntp.org
group_vars/webservers.yml:
---
# Variables for webservers group
nginx_port: 80
nginx_worker_processes: 4
app_directory: /var/www/app
group_vars/production.yml:
---
# Variables for production environment
environment: production
backup_enabled: true
monitoring_enabled: true
host_vars/web1.yml:
---
nginx_worker_connections: 1024
server_id: 1
# Run playbook with specific inventory
ansible-playbook -i inventory/production site.yml
# Target specific group
ansible-playbook -i inventory/production site.yml --limit webservers
# Target specific host
ansible-playbook -i inventory/production site.yml --limit web1
inventory/aws_ec2.yml:
---
plugin: amazon.aws.aws_ec2
regions:
- us-east-1
- us-west-2
filters:
tag:Environment: production
instance-state-name: running
keyed_groups:
- key: tags.Role
prefix: role
- key: tags.Environment
prefix: env
- key: placement.availability_zone
prefix: az
hostnames:
- tag:Name
- private-ip-address
compose:
ansible_host: private_ip_address
inventory/azure_rm.yml:
---
plugin: azure.azcollection.azure_rm
include_vm_resource_groups:
- production-rg
keyed_groups:
- key: tags.role
prefix: role
- key: tags.environment
prefix: env
conditional_groups:
webservers: "'web' in tags.role"
databases: "'db' in tags.role"
inventory/custom.py:
#!/usr/bin/env python3
import json
inventory = {
"webservers": {
"hosts": ["web1", "web2"],
"vars": {
"nginx_port": 80
}
},
"databases": {
"hosts": ["db1", "db2"]
},
"_meta": {
"hostvars": {
"web1": {"ansible_host": "192.168.1.10"},
"web2": {"ansible_host": "192.168.1.11"},
"db1": {"ansible_host": "192.168.1.20"},
"db2": {"ansible_host": "192.168.1.21"}
}
}
}
print(json.dumps(inventory))
All hosts:
ansible all -i inventory/production -m ping
Specific group:
ansible webservers -i inventory/production -m ping
Multiple groups:
ansible 'webservers:databases' -i inventory/production -m ping
Exclude group:
ansible 'all:!databases' -i inventory/production -m ping
Intersection:
ansible 'webservers:&production' -i inventory/production -m ping
Regex:
ansible '~web.*' -i inventory/production -m ping
inventory/
├── production/
│ ├── hosts
│ ├── group_vars/
│ │ ├── all.yml
│ │ └── webservers.yml
│ └── host_vars/
├── staging/
│ ├── hosts
│ ├── group_vars/
│ │ ├── all.yml
│ │ └── webservers.yml
│ └── host_vars/
└── development/
├── hosts
└── group_vars/
└── all.yml
Usage:
# Production
ansible-playbook -i inventory/production site.yml
# Staging
ansible-playbook -i inventory/staging site.yml
# Development
ansible-playbook -i inventory/development site.yml
npx claudepluginhub p/armanzeroeight-ansible-toolkit-plugins-ansible-toolkitGuides Ansible inventory management: static/dynamic files, host patterns, group/host variables, and inventory plugins.
Manages hosts, groups, and variables in Ansible inventory files using INI and YAML formats for infrastructure organization across environments.
Automates infrastructure provisioning, configuration management, and application deployment using Ansible playbooks, roles, and inventory. Useful for patching and managing servers.