> Two mounts defined as virtual resources with same name but different 
>> fstype. One is is ensuring present, other absent. Puppet doesn't like it,
>> Looking at a bug report earlier ( 
>> http://projects.puppetlabs.com/issues/7491 ), I followed the suggestion, 
>> but it doesn't help. puppet throws this error :
>>
>
>
> You cannot declare multiple configurations of the same resource for the 
> same target node.  This constraint covers all resource declarations 
> equally, including those of virtual and exported resources.  Where it knows 
> how to do so, Puppet intentionally recognizes and blocks attempts to 
> disguise multiple declarations by use of different resource titles 
> (contrary to some of the comments on issue 7491, but imho correctly).
>
>  
I agree with your opinion here because the comments on issue 7941 doesn't 
work. My case is a bit strange though. As you could see, I want to make the 
same mount "absent" only if the fstype is different from what was defined 
originally for "present". And both these operation should happen in the 
same node.

I had tried declaring a single virtual resource and then change the fstype 
and ensure parameter. It doesn't work as I want. It removes the mount point 
"/data/01" that was initially present and simply ignores the change in the 
fstype. See e.g.,

class cl::mount {
 @mount {
      "mnt_sdisk_3" :
        device => "/dev/sdb1",
        name => "/data/01",
        fstype => "auto",
        options => "defaults",
        dump => "0",
        pass => "0",
        ensure => present;
   }
}

class cl::test_mount inherits cl::mount {
    realize(Mount["mnt_sdisk_3"])
    Mount["mnt_sdisk_3"] {
      fstype => "ext3",
      ensure => absent,
    }
}

Notice: /Stage[main]/Cl::Mount/Mount[mnt_sdisk_3]/ensure: current_value 
mounted, should be absent (noop)


Note that I am testing this on a machine where the change shouldn't happen 
because there is no "ext3" fstype with name "/data/01" in /etc/fstab.

I guess this is a very special case and probably I have to deal with this 
by editing fstab using Exec.


Cheers

>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/qnFIsP5uO4AJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to