example42/puppet-tp

Allow any variables for `ensure` of dir

Closed this issue · 0 comments

Expected Behavior

Set ensure => 'latest' and vcsrepo => 'git' for tp::dir,
then clone source or keep it latest if the directory exist.

Actual Behavior

ensure => 'latest' makes an error like:

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation 
Error: Error while evaluating a Resource Statement, Evaluation Error: No matching entry for selector 
parameter with value 'latest' (file: 
/etc/puppetlabs/code/environments/production/modules/tp/manifests/dir.pp, line: 211, column: 20) 
(file: /etc/puppetlabs/code/environments/production/modules/tp/manifests/init.pp, line: 69) on node example.com

Steps to Reproduce the Problem

  1. Prepare following manifests (git_test.pp):
tp::dir { '/opt/puppet-tp':
  ensure => 'latest',
  source => 'https://github.com/example42/puppet-tp.git',
  vcsrepo => 'git'
}
  1. Apply manifest:
# puppet apply git_test.pp

Specifications

vcsrepo can manage latest for ensure (puppetlabs/vcsrepo · Puppet Forge).