ansible
Rust API for Ansible
Progress Tracker
- Ansible inventory command
- Load trait for inventory to json
- API to get hosts from inventory
- API to get vars for host
- Add Ansible test data to repo for use in test suite
- Official Rust docs
- Ansible adhoc command
- Ansible playbook command
Features
- Load Ansible inventory data into serde json object
use ;
let inventory = load?;
let data = inventory.data
- Get specific host from Ansible inventory
use ;
let inventory = load?;
let host = inventory.get_host?;
hostvars = host.get_vars?;
- Get all hosts from Ansible inventory
use ;
let inventory = load?;
let hosts = inventory.get_hosts?;
for host in hosts
Tests
- Execute tests with
cargo test -- --nocaptureto see stdout