File tree 1 file changed +12
-6
lines changed
spec/acceptance/peadm_spec/plans
1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change 4
4
$t = get_targets(' *' )
5
5
wait_until_available($t )
6
6
7
- $fqdn_results = wait(
8
- parallelize( $t ) | $target | {
9
- $fqdn = run_command( ' hostname -f ' , $target )
10
- $ target .set_var( ' certname ' , $ fqdn.first[ ' stdout ' ].chomp )
7
+ $fqdn_results = $t .map | $target | {
8
+ $fqdn = run_command( ' hostname -f ' , $target ).first
9
+ if $fqdn [ ' exit_code ' ] != 0 {
10
+ fail( " Failed to get FQDN for target ${ target.name}: ${ fqdn['stderr']} " )
11
11
}
12
- )
12
+ $target .set_var(' certname' , $fqdn [' stdout' ].chomp)
13
+ }
13
14
14
15
$fqdn_results .each |$result | {
15
- $command = " yq eval '(.groups[].targets[] | select(.uri == \" ${result.target.uri}\" ).name) = \" ${result.value}\" ' -i ${inventory_file} "
16
+ $command = " yq eval '(.groups[].targets[] | select(.uri == \" ${uri} \" ).name) = \" ${certname} \" ' -i ${inventory_file} "
17
+ $result = run_command($command , ' localhost' ).first
18
+ if $result [' exit_code' ] != 0 {
19
+ fail(" Failed to update inventory file for target ${uri} : ${result['stderr']}" )
20
+ }
21
+ $command = " yq eval '(.groups[].targets[] | select(.uri == \" ${uri} \" ).name) = \" ${certname} \" ' -i ${inventory_file} "
16
22
run_command($command , ' localhost' )
17
23
}
18
24
}
You can’t perform that action at this time.
0 commit comments