Ask Your Question

How to reference resources/types provided by puppetlabs/lvm in custom classes?

asked 2013-08-23 09:24:05 -0500

sfxandy gravatar image

updated 2013-08-23 09:51:26 -0500

I am able to reference the various resource types (filesystem, logical_volume etc.) perfectly well from within my nodes.pp.

However when I try and do the same from within one of my custom classes I get this error:

Error: Failed to apply catalog: Could not find dependency Filesystem[/dev/mapper/root_vg-WebSphere] for File[...

Am guessing either my custom class does not have these resources/types within its scope, or the puppetlabs/lvm resources/types somehow need to be parsed before my custom classes are included.

Any assistance would be appreciated!


edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2013-08-27 10:24:01 -0500

GregLarkin gravatar image

The lvm module only defines a new set of types for you to use, but you still have to declare everything in your resource tree, including the filesystem resource that your file resource requires.

edit flag offensive delete link more

answered 2013-08-27 06:07:01 -0500

sfxandy gravatar image


In response to the poster here are the relevant Puppet manifest extracts where I am encountering this problem.

Firstly I have declared a class called 'websphere' which resides in /etc/puppet/modules/websphere and my class code is in the init.pp file located at /etc/puppet/modules/websphere/manifests. The code for this is as follows:


class websphere::deploy {

  include lvm::filesystem

  file { "/opt/wasadmin/backup/build_NdmBase.tar":
    source  => "puppet:///files/build/websphere/build_NdmBase.tar",
    mode    => 0640,
    owner   => "wasadmin",
    group   => "wasgrp",
    require => Filesystem[ "/dev/mapper/root_vg-WebSphere" ],

The second component is my ... (more)

edit flag offensive delete link more


Do you have a resource "filesystem { '/dev/mapper/root_vg-WebSphere': }" declared somewhere in your code? If so, please post the that contents of that file as well.

GregLarkin gravatar imageGregLarkin ( 2013-08-27 09:56:39 -0500 )edit

Hi Greg, No, I am attempting to refer to the resource-type "filesystem" as provided by the puppetlabs/lvm module. Essentially using the puppet labs/lvm module to check for the ...(more)

sfxandy gravatar imagesfxandy ( 2013-08-27 10:07:47 -0500 )edit

That worked fine. Not sure what i was thinking when I didn't bother defining my various resources before I tried using them as part of a "require". Thanks Greg!

sfxandy gravatar imagesfxandy ( 2013-08-28 02:00:33 -0500 )edit

I'm glad that worked for you, and I converted my comment to an answer, if you wouldn't mind accepting it as correct. Cheers!

GregLarkin gravatar imageGregLarkin ( 2013-08-28 03:40:08 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2013-08-23 09:24:05 -0500

Seen: 532 times

Last updated: Aug 27 '13