Skip to main content

consortium_ansible/
error.rs

1//! Error types for Ansible orchestration.
2
3#[derive(Debug, thiserror::Error)]
4pub enum AnsibleError {
5    #[error("ansible environment build failed: {0}")]
6    EnvBuildFailed(String),
7
8    #[error("playbook failed on {host}: {message}")]
9    PlaybookFailed { host: String, message: String },
10
11    #[error("verification failed on {host}: {message}")]
12    VerifyFailed { host: String, message: String },
13
14    #[error("inventory generation failed: {0}")]
15    InventoryFailed(String),
16
17    #[error("no ansible config in fleet configuration")]
18    NoConfig,
19
20    #[error("nix error: {0}")]
21    Nix(#[from] consortium_nix::NixError),
22
23    #[error("dag error: {0}")]
24    Dag(String),
25
26    #[error("{0}")]
27    General(String),
28}
29
30pub type Result<T> = std::result::Result<T, AnsibleError>;