You do it as follows:

plan puppet6::puppet_upgrade(
  TargetSpec $nodes,
) {

  $targets = get_targets($nodes)
  $targets.each |$target| {
    apply($nodes) {
      class { 'puppet6::upgrade': location => $target.vars['location'] }
    }
  }

}

-Kevin

On Thursday, September 19, 2019 at 12:00:18 PM UTC+2, Andy Hall wrote:
>
> OK so how do I get the plan to read from the inventory file ?? I am 
> running this plan :
>
> bolt plan run puppet6::puppet_upgrade -i inventory.yaml --nodes 
> puppet6_nodes
>
> And am getting this error :
>
> puppet6::puppet_upgrade: expects a value for parameter 'location'
>
> Here is my inventory file :
>
> groups:
>   - name: puppet6_nodes
>     nodes:
>       - host-name-01
>     vars:
>       location: ldn1
>
> And here is the plan with params :
>
> plan puppet6::puppet_upgrade(
>   TargetSpec $nodes,
>   String $location,
> ) {
>
>   apply($nodes) {
>     class { 'puppet6::upgrade': location => $location }
>   }
>
> }
>
> Do the nodes and vars not get passed from the inventory to the plan ?? 
> Thanks.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/192bec52-0ab4-407d-b016-290b4c185e13%40googlegroups.com.

Reply via email to