On 17/09/15 06:58, Cody Herriges wrote: > I wrote my first composite namevar type a few years and ago and all the > magic is basically a single block of code inside the type... > > https://github.com/puppetlabs/puppetlabs-java_ks/blob/master/lib/puppet/type/java_ks.rb#L145-L169 > > It basically boils down to these three things: > > * Pick your namevars > (https://github.com/puppetlabs/puppetlabs-java_ks/blob/master/lib/puppet/type/java_ks.rb#L49-L64) > * Pick a delimiter > - Personally I'd use @ here since we are talking about domains > * Build your self.title_patterns method, accounting for delimited names > and arbitrary names. > > While it looks like the README never got updated, the java_ks example > supports both meaningful titles and arbitrary ones. > > java_ks { 'activemq_puppetca_keystore': > ensure => latest, > name => 'puppetca', > certificate => '/etc/puppet/ssl/certs/ca.pem', > target => '/etc/activemq/broker.ks', > password => 'puppet', > trustcacerts => true, > } > > java_ks { 'broker.example.com:/etc/activemq/broker.ks': > ensure => latest, > certificate => > '/etc/puppet/ssl/certs/broker.example.com.pe-internal-broker.pem', > private_key => > '/etc/puppet/ssl/private_keys/broker.example.com.pe-internal-broker.pem', > password => 'puppet', > } > > You'll notice the first being an arbitrary title and the second > utilizing a ":" as a delimiter and omitting the name and target parameters. > > Another code example can be found in the package type. > > https://github.com/puppetlabs/puppet/blob/master/lib/puppet/type/package.rb#L268-L291. >
Hi Cody, Thank you for the example! That's going to help as the expected returned array from #self.title_pattern is effectively not intuitive! Cheers, Gilles > > > __________________________________________________________________________ > OpenStack Development Mailing List (not for usage questions) > Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe > http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev > __________________________________________________________________________ OpenStack Development Mailing List (not for usage questions) Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev