example42 / puppet-tp

Tiny Puppet - The Universal Installer
http://tiny-puppet.com
Apache License 2.0
68 stars 21 forks source link

Allow any variables for `ensure` of dir #58

Closed ghost closed 5 years ago

ghost commented 5 years ago

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).