puppetbolt

How to access YAML variable in puppet bolt plan

yaml file

groups:
-name: test
targets:
-uri: test.abc.edu
vars:
server_short_name: test123
config:
transport: ssh

plan test:passvariablevalue(
 
TargetSpec $targets

){
    
    # Gather facts 
   $tragets.apply_prep
    
   get_targets('development').each | $traget | {
      $results= run_command ("touch /shiva/files/svc.test.${target.vars['server_short_name']}",$target, {_run_as => 
'root'})
      out::message ("${results}")
 
   }



}

Run plan

bolt plan run test:test:passvariablevalue -t test