Hello Together,

i have a strange behaviour wich i cant explain myself. I want to create a 
new custom type (and later a provider) who can configure our own created 
software. For this, i createt a test module and put there everything for my 
development. It looks like this 

.
├── lib
│   └── puppet
│       ├── provider
│       └── type
│           └── custom_type.rb
└── manifests
    └── init.pp


In Module development, my steps would be this:

1. Make changes
2. appy on a node
3. Make changes
4. ...

But if i apply a module who uses a custom type, i only can make changes 
until i never use this custom type on a puppetmaster before. It looks like, 
the puppetmaster "remembers" the custom type and every change results in a 
failure. If i reset my puppetmaster, add the changed custom type, 
everything works fine. Let explain me this in code, because my english is 
not so good:

For example i have a very emtpy custom_type

Puppet::Type.newtype(:custom_type) do
  newparam(:name) do
    isnamevar
  end
 end

and the init.pp from my module looks like this:

class type_test{

       custom_type { 'aname':
       }
}

It works fine if i apply this.

When i add now a  new parameter for example:

Puppet::Type.newtype(:custom_type) do
  newparam(:name) do
    isnamevar
  end

  newparam(:envid) do
    # validate is tring or false
    validate do |value|
      unless value.is_a?(String)
        raise Puppet::Error, 'Parameter envid is not a string.'
      end
    end
  end
end

and i apply this by the new init.pp

class type_test{
        custom_type { 'aname':
            envid => '78121-1239-0000-1231',
        }
}

he gives me the following failure:

Could not retrieve catalog from remote server: Error 400 on SERVER: Invalid 
> parameter envid on custom_type[aname] at 
> /etc/puppet/environments/development/modules/type_test/manifests/init.pp:8 
> on node xyz
>

The strange this is: If i reset now my puppetmaster on a older snapshot and 
apply the new version of my custom_type.rb and init.pp again. everything 
works fine. I have this on every change, for example, adding more 
parameters, propertys or even i make it ensurable. 

It cant be the right way, to always reset everythng on a older snapshot or? 
Why the puppetmaster "rembers" the custom_type definition and does not 
accept changes? How i handle this?

Thanks for any help

Akai

-- 
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/92af8117-be93-45ce-adc8-48605e7141f8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to