File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
spec/acceptance/peadm_spec/plans Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change 44 $t = get_targets(' *' )
55 wait_until_available($t )
66
7- parallelize($t ) |$target | {
8- $fqdn = run_command(' hostname -f' , $target )
9- $target .set_var(' certname' , $fqdn .first[' stdout' ].chomp)
10- $command = " yq eval '(.groups[].targets[] | select(.uri == \" ${target.uri}\" ).name) = \" ${target.vars['certname']}\" ' -i ${inventory_file} "
11- run_command($command , ' localhost' )
7+ $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+ }
12+ $command = " yq eval '(.groups[].targets[] | select(.uri == \" ${target.uri}\" ).name) = \" ${fqdn['stdout'].chomp}\" ' -i ${inventory_file} "
13+ $result = run_command($command , ' localhost' ).first
14+ if $result [' exit_code' ] != 0 {
15+ fail(" Failed to update inventory file for target ${uri} : ${result['stderr']}" )
16+ }
1217 }
1318}
You can’t perform that action at this time.
0 commit comments