| Crates.io | ansible |
| lib.rs | ansible |
| version | 0.2.0 |
| created_at | 2025-05-07 21:41:40.73592+00 |
| updated_at | 2025-05-08 12:52:00.773373+00 |
| description | Rust API for Ansible |
| homepage | |
| repository | https://github.com/Lxkota95/ansible |
| max_upload_size | |
| id | 1664579 |
| size | 11,334 |
Rust API for Ansible
use ansible::{Inventory, Load};
let inventory = Inventory::load(PathBuf::from('/path/to/inventory'))?;
let data = inventory.data
use ansible::{Inventory, Load};
let inventory = Inventory::load(PathBuf::from('/path/to/inventory'))?;
let host = inventory.get_host("<hostname>")?;
hostvars = host.get_vars()?;
use ansible::{Inventory, Load};
let inventory = Inventory::load(PathBuf::from('/path/to/inventory'))?;
let hosts = inventory.get_hosts()?;
for host in hosts {
hostvars = host.get_vars()?;
}
cargo test -- --nocapture to see stdout