cindy-cli 0.2.0

Managing infrastructure at breakneck speed.
cindy-cli-0.2.0 is not a library.

Cindy

crates.io docs.rs Home Page License

A remarkably simple infrastructure management solution.

The purpose of this project is to provide a faster, safer, simpler, and overall better alternative to current provisioning tools like Ansible and Salt.

It aims to solve all of the pain points of Ansible, while still being "agent-less" and easy to use.

You write Rust. That's it.

You get the full power of the Rust language and ecosystem, on the orchestrator and on the remote machine.

A minimal example demonstrating the sample use:

#[cindy::wire]
struct Vars {
    my_var_a: u64,
    my_var_b: String,
}

#[cindy::inventory]
fn inventory() -> cindy::Inventory<Vars> {
    cindy::Inventory::new([
            cindy::Host::new(
                "host-a.myenterprise.net",
                ["location:prague", "service:grafana"],
                Vars {
                    my_var_a: 42,
                    my_var_b: "Hello".into(),
                },
            ),
            cindy::Host::new(
                "host-b.myenterprise.net",
                ["location:prague", "service:nginx"],
                Vars {
                    my_var_a: 77,
                    my_var_b: "Hiya".into(),
                },
            ),
        ],
    )
}

#[cindy::remote]
async fn do_stuff(x: u64) -> cindy::Result<u64> {
    let result = x * 3;
    println!("{result}");
    Ok(result)
}

#[cindy::main]
async fn main(host: cindy::Host<Vars>) -> cindy::Result<()> {
    let mut result = do_stuff(host.vars.my_var_a).await?;
    result += 23;
    result = do_stuff(result).await?;
    println!("Final result: {result}");

    Ok(())
}

Running it is as simple as running cindy play --limit 'location:prague & !service:nginx'