我在同一台服务器上有几个NFS挂载点,但有不同的目录。 例如:
xxxx:/stats /data/stats xxxx:/scratch /data/scratch xxxx:/ops /data/ops
但是,当我尝试运行木偶,它添加以下到我的fstab。 (错误的安装分配)
xxxx:/scratch /data/stats nfs defaults,nodev,nosharecache 0 0 xxxx:/scratch /data/ops nfs defaults,nodev,nosharecache 0 0 xxxx:/scratch /data/scratch nfs defaults,nodev,nosharecache 0 0
它使用所有安装分区上的最后一个安装选项。 所以我做了一些研究,发现了以下的错误。
https://tickets.puppetlabs.com/browse/DOCUMENT-242
然后添加nosharecache选项,但仍然没有运气。 这是我的木偶代码
class profile::mounts::stats { # Hiera lookups $location = hiera('profile::mounts::stats::location') $location2 = hiera('profile::mounts::stats::location2') tag 'new_mount' file { '/data/stats': ensure => directory, owner => 'root', group => 'root', mode => '0755', require => File['/data'], tag => 'new_mount', } mount { '/data/stats': ensure => mounted, fstype => 'nfs', device => $location, options => 'defaults,nodev,nosharecache', require => File['/data/stats'], tag => 'new_mount' } file { '/data/ops': ensure => directory, owner => 'root', group => 'mail', mode => '0775', require => File['/data'], tag => 'new_mount', } mount { '/data/ops': ensure => mounted, fstype => 'nfs', device => $location, options => 'defaults,nodev,nosharecache', require => File['/data/ops'], tag => 'new_mount', } file { '/data/scratch': ensure => directory, owner => 'root', group => 'mail', mode => '0775', require => File['/data'], tag => 'new_mount', } mount { '/data/scratch': ensure => mounted, fstype => 'nfs', device => $location2, options => 'defaults,nodev,nosharecache', require => File['/data/scratch'], tag => 'new_mount', } } }
我的hieara查找如下
profile::mounts::stats::location: xxxx:/stats profile::mounts::stats::location2: xxxx:/scratch
为什么它会导致一些意外的行为?