Ask Your Question

Revision history [back]

I'm quite new to Puppet myself, so I know exactly how you feel :)

Had a quick look at your snippet - please keep in mind that Puppet does not execute serially. Rather, it uses internal ordering - which is random, unless you specifically set dependencies between your resources.

Example:

#removes previous Java from path
windows_path {'removejavapath':
  ensure      => absent,
  directory   => "C:\\Program Files\\Java\\jdk1.7.0_51\\bin"
}  
#Adds java to the path.
windows_path {'javaPath':
  ensure      => present,
  directory   => "C:\\Program Files\\Java\\$file\\bin",
  require => Window_path['removejavapath'],
}

Puppet will now know to execute removal before attempting to re-add the path.

I'm quite new to Puppet myself, so I know exactly how you feel :)

Had a quick look at your snippet - please keep in mind that Puppet does not execute serially. Rather, it uses internal ordering - which is random, unless you specifically set dependencies between your resources.resources. Example:

Example:

#removes previous Java from path
windows_path {'removejavapath':
  ensure      => absent,
  directory   => "C:\\Program Files\\Java\\jdk1.7.0_51\\bin"
}  
#Adds java to the path.
windows_path {'javaPath':
  ensure      => present,
  directory   => "C:\\Program Files\\Java\\$file\\bin",
  require => Window_path['removejavapath'],
}

Puppet will now know to execute removal before attempting to re-add the path.