Explicit ordering

When you are trying to determine an error in the evaluation of your class, it can be helpful to use the chaining arrow syntax to force your resources to evaluate in the order that you specified. For instance, if you have an exec resource that is failing, you can create another exec resource that outputs the information used within your failing exec. For example, we have the following exec code:

file {'arrow':
  path => '/tmp/arrow',
  ensure => 'directory',
}
exec {'arrow_debug_before':
  command => 'echo debug_before',
  path => '/usr/bin:/bin',
}
exec {'arrow_example':
  command => 'echo arrow',
  path => '/usr/bin:/bin',
  require => File['arrow'],
}
exec {'arrow_debug_after':
  command => 'echo debug_after',
  path => '/usr/bin:/bin',
}

Now, ...

Get Troubleshooting Puppet now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.