Skip to content

/mnt/[directory] re-export problem using derdanne puppet module #128

@roscokhan

Description

@roscokhan

Hi,

I thought I'd share a solution I found to a duplicate declaration error I experienced when re-exporting some filesystems using derdanne-nfs.

I have an NFS server that I'm using as an aggregation point to mount NFS filesystems from various locations and re-export them to client devices as a single, consolidated mount. This is due to client restrictions (some clients don't handle a mix of ro and rw mounts correctly).

This combination of client and server configurations results in the error (anonymised to protect the innocent):

nfs::client::mount { '/mnt/media/Resources/Presentations':

  server => '192.168.220.65',
  share => '/Users/bob/Resources/Presentations',
  ensure => 'mounted',
  options_nfs => 'ro',

}

nfs::server::export { '/mnt/media/Resources/Presentations':

  bind  => 'rbind',
  clients => '192.168.230.0/24(ro,all_squash,insecure,crossmnt,fsid=100,no_subtree_check)',

}

The error I see:

Error: Could not retrieve catalog from remote server:
Error 500 on SERVER:
Server Error:
Evaluation Error:
Error while evaluating a Resource Statement
Evaluation Error:
Error while evaluating a Resource Statement, Duplicate declaration:

              Nfs::Client::Mount[/mnt/media/Resources/Presentations] is already declared at (file: /etc/puppetlabs/code/environments/production/manifests/node_192-168-230-192_media.bob.com.pp, line: 183);

              cannot redeclare (file: /etc/puppetlabs/code/environments/production/modules/nfs/manifests/server/export.pp, line: 164)

              (file: /etc/puppetlabs/code/environments/production/modules/nfs/manifests/server/export.pp, line: 164, column: 7)

              (file: /etc/puppetlabs/code/environments/production/manifests/node_192-168-230-192_media.bob.com.pp, line: 239) on node media.bob.com

This combination of configurations works as expected:

nfs::client::mount { 'MOUNT_/mnt/media/Resources/Presentations':

  server => '192.168.220.65',
  share => '/Users/bob/Resources/Presentations',
  mount => '/mnt/media/Resources/Presentations',
  ensure => 'mounted',
  options_nfs => 'ro',

}

nfs::server::export { '/mnt/media/Resources/Presentations':

  bind  => 'rbind',
  clients => '192.168.230.0/24(ro,all_squash,insecure,crossmnt,fsid=100,no_subtree_check)',

}

I used the string 'MOUNT_' to avoid the naming clash, although I think this could be almost anything, as long as the mount option is specified.

Regards,

Ross

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions