Skip to content

Commit

Permalink
gg
Browse files Browse the repository at this point in the history
  • Loading branch information
RolandSherwin committed Jan 15, 2024
1 parent 8ec262f commit ea37a50
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions src/ansible.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,14 @@ impl AnsibleRunner {
// It takes a PathBuf as an argument which represents the inventory path.
// It returns a Result containing a vector of tuples. Each tuple contains a string representing the name and the ansible host.
//
// Set retry_count to re-run the ansible runner if the inventory list is empty
// Set re_attempt to re-run the ansible runner if the inventory list is empty
pub async fn inventory_list(
&self,
inventory_path: PathBuf,
retry_count: Option<usize>,
re_attempt: bool,
) -> Result<Vec<(String, IpAddr)>> {
// Run the external command and store the output.
let retry_count = retry_count.unwrap_or(0);
let retry_count = if re_attempt { 3 } else { 0 };
let mut count = 0;
let mut inventory = Vec::new();

Expand Down
4 changes: 2 additions & 2 deletions src/deploy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ impl DeployCmd {
.inventory_list(
PathBuf::from("inventory")
.join(format!(".{}_build_inventory_digital_ocean.yml", self.name)),
Some(3),
true,
)
.await?;
let build_ip = build_inventory[0].1;
Expand Down Expand Up @@ -167,7 +167,7 @@ impl DeployCmd {
".{}_genesis_inventory_digital_ocean.yml",
self.name
)),
None,
false,
)
.await?;
let genesis_ip = genesis_inventory[0].1;
Expand Down
8 changes: 4 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ impl TestnetDeploy {
.inventory_list(
PathBuf::from("inventory")
.join(format!(".{name}_genesis_inventory_digital_ocean.yml")),
None,
false,
)
.await?;
let genesis_ip = genesis_inventory[0].1;
Expand Down Expand Up @@ -486,15 +486,15 @@ impl TestnetDeploy {

let genesis_inventory = self
.ansible_runner
.inventory_list(genesis_inventory_path, None)
.inventory_list(genesis_inventory_path, false)
.await?;
let build_inventory = self
.ansible_runner
.inventory_list(build_inventory_path, None)
.inventory_list(build_inventory_path, false)
.await?;
let remaining_nodes_inventory = self
.ansible_runner
.inventory_list(remaining_nodes_inventory_path, None)
.inventory_list(remaining_nodes_inventory_path, false)
.await?;

// It also seems to be possible for a workspace and inventory files to still exist, but
Expand Down
4 changes: 2 additions & 2 deletions src/logs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,11 +248,11 @@ impl TestnetDeploy {
// Get the inventory of all the nodes
let mut all_node_inventory = self
.ansible_runner
.inventory_list(genesis_inventory_path, None)
.inventory_list(genesis_inventory_path, false)
.await?;
all_node_inventory.extend(
self.ansible_runner
.inventory_list(remaining_nodes_inventory_path, None)
.inventory_list(remaining_nodes_inventory_path, false)
.await?,
);
Ok(all_node_inventory)
Expand Down
2 changes: 1 addition & 1 deletion src/logstash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ impl LogstashDeploy {
.inventory_list(
PathBuf::from("inventory")
.join(format!(".{name}_logstash_inventory_digital_ocean.yml")),
None,
false,
)
.await?;
let logstash_ip = logstash_inventory[0].1;
Expand Down

0 comments on commit ea37a50

Please sign in to comment.