Corey Osman
2012-Oct-29 18:11 UTC
[Puppet Users] help with creating self.instances for puppetlabs-lvm providers
Hi, I have been adding support for the puppetlabs-lvm module so that I can use puppet resource <lvm_type>. I have most of the coding done but can''t seem to get certain parameters in the output. https://github.com/logicminds/puppetlabs-lvm/commit/deb258231f5a4dc6da7c0d65a7153846b8766b3e example: def self.instances filesystems.map { | fs | new(:name => fs[0], :fs_type => fs[1], :options => fs[2], :ensure => :present ) } end [root@puppet2 logical_volume]# puppet resource filesystem filesystem { ''/dev/mapper/vg_puppet2-lv_root'': ensure => ''present'', } filesystem { ''/dev/sda1'': ensure => ''present'', } The output should detail the fstype and options but I don''t know why it doesn''t output these details. I have similar issues with other types so I must be missing something in my code. Should look like this: filesystem { ''/dev/sda1'': ensure => ''present'', options => "-b 4096", fs_type => "ext4", } One other thing I found is that its necessary to reference @property_hash in order for puppet resource logical_volume to work since the default @resource is missing certain keys. rname ||= @resource[:name] || @property_hash[:name] Not sure why I need to reference @property_hash? Also, How do I add tests for puppet resource? Any examples? BTW, I am adding this code so that I can validate that puppet did what it was supposed to do without writing custom parsers and formatters (Thats what puppet is for". Thanks, Corey Osman corey@logicminds.biz Green IT and Data Center Automation Specialist -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Reasonably Related Threads
- configsync requires 2nd puppet run for plugin loading to work
- puppetrun fails: "Certificates were not trusted"
- Custom types in environments working .... yes/no/maybe ?
- Resources not exported from puppet agent run on the Puppet Master nodes with PuppetDB
- I moved my modules and manifest directory in puppet master.