Skip to content

Commit

Permalink
Add Clone and Debug traits for `rs_ansible::AnsiblePlaybookComman…
Browse files Browse the repository at this point in the history
…d` (#15)

* feat: add `Clone` and `Debug`  traits for AnsiblePlaybookCommand
  • Loading branch information
ce7elem authored Nov 9, 2023
1 parent f906d1b commit 7293408
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pub fn verify_binary(binary: &str) -> Result<(), Box<dyn Error>> {
}
}

#[derive(Clone)]
#[derive(Debug, Clone)]
pub struct DefaultExecutor {}

impl DefaultExecutor {
Expand Down
3 changes: 2 additions & 1 deletion src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ pub fn ansible_set_env(key: &str, value: &str) {

/// Has those parameters described on `Connections Options` section within
/// ansible-playbook's man page, and which defines how to connect to hosts.
#[derive(Debug, Clone)]
pub struct AnsibleConnectionOptions {
pub ask_pass: bool,
pub connection: String,
Expand Down Expand Up @@ -136,7 +137,7 @@ impl AnsibleConnectionOptions {
machinectl Systemd's machinectl privilege escalation
dzdo Centrify's Direct Authorize
*/
#[derive(Default)]
#[derive(Debug, Default, Clone)]
pub struct AnsiblePrivilegeEscalationOptions {
pub ask_become_pass: bool,
pub do_become: bool,
Expand Down
2 changes: 2 additions & 0 deletions src/playbook.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use std::process::Child;
/// Parameters described on `Options` section within
/// ansible-playbook's man page, and which defines which should be
/// the ansible-playbook execution behavior.
#[derive(Debug, Clone)]
pub struct AnsiblePlaybookOptions {
pub ask_vault_password: bool, // ask for vault password
pub check: bool, // don't make any changes; instead, try to predict some of the changes that may occur
Expand Down Expand Up @@ -235,6 +236,7 @@ impl AnsiblePlaybookOptions {
}

/// Ansible-playbook command representation and how to execute it
#[derive(Debug, Clone)]
pub struct AnsiblePlaybookCmd {
pub binary: String, // Ansible binary
pub executor: DefaultExecutor, // Ansible binary
Expand Down

0 comments on commit 7293408

Please sign in to comment.