Hi all, 

I'm developing a resource that allows the declaration of keys in the Etcd 
key value store. 

My type looks like this:

Puppet::ResourceApi.register_type(
  name: 'etcd_key',
  docs: 'This type allows the management of etcd keys as Puppet resources.',
  attributes: {
    ensure: {
      type: 'Enum[present, absent]',
      desc: 'Whether the key should be present in the etcd structure.',
      default: 'present',
    },
    path: {
      type: 'String',
      desc: 'The path of the key you want to manage in the etcd structure.',
      behaviour: :namevar,
    },
    directory: {
      type: 'Boolean',
      desc: 'Whether this key is a directory or not.',
      default: false,
    },
    value: {
      type: 'String',
      desc: 'The value of the key. Mutually exclusive if with is_directory 
=> true.',
    },
  },
)


What I want to be able to do is make the value/directory parameters 
mutually exclusive as a directory does not have a 'value' in etcd, and 
similarly a key with a value cannot be a directory. Currently though, 
Puppet complains that I'm excluding required parameters when I declare them.

Is this possible with the resource API or do I need to use the low level 
provider implementation?

Thanks! Ben

-- 
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/5bb1535f-0c14-4aee-98f6-91fd7d68c4f7%40googlegroups.com.

Reply via email to