Macos Puppet-OSX NFS装载刷新和触发重新装载
我已经为此奋斗了一段时间,我已经把它缩小到一个测试傀儡清单,它说明了这个问题 基本上,我将定义文件资源,然后定义一个Mount resources以在该目录中装载NFS共享。但是,查看调试输出,目录检查似乎触发了一个“刷新”事件,这反过来又导致Puppet卸载和重新装载共享。此过程中的某些内容会导致删除目录,从而导致重新装载失败 在装载刷新运行之前,我已经检查了/Volumes目录的运行中期,它确实创建了目录,因此我只能假设是Macos Puppet-OSX NFS装载刷新和触发重新装载,macos,puppet,osx-yosemite,mount,nfs,Macos,Puppet,Osx Yosemite,Mount,Nfs,我已经为此奋斗了一段时间,我已经把它缩小到一个测试傀儡清单,它说明了这个问题 基本上,我将定义文件资源,然后定义一个Mount resources以在该目录中装载NFS共享。但是,查看调试输出,目录检查似乎触发了一个“刷新”事件,这反过来又导致Puppet卸载和重新装载共享。此过程中的某些内容会导致删除目录,从而导致重新装载失败 在装载刷新运行之前,我已经检查了/Volumes目录的运行中期,它确实创建了目录,因此我只能假设是umount命令将其删除 我在使用before对文件资源(如下所示)的
umount
命令将其删除
我在使用before
对文件资源(如下所示)的依赖关系以及require
对Mount资源的依赖关系时尝试了它,得到了相同的结果
木偶清单示例:
file { "/Volumes/share":
ensure => directory,
before => Mount["/Volumes/share"]
}
mount {"/Volumes/share":
ensure => "mounted",
device => "xxxx@yyyy.net:/share",
name => "/Volumes/share",
atboot => true,
fstype => "nfs",
options => "",
}
下面是--debug
输出:
Debug: Loaded state in 0.02 seconds
Debug: /Stage[main]/Main/File[/Volumes/share]/before: requires Mount[/Volumes/share]
Info: Applying configuration version '1429802875'
Notice: /Stage[main]/Main/File[/Volumes/share]/ensure: created
Debug: /Stage[main]/Main/File[/Volumes/share]: The container Class[Main] will propagate my refresh event
Debug: Prefetching parsed resources for mount
Debug: Executing '/sbin/mount'
Debug: Flushing mount provider target /etc/fstab
Info: Computing checksum on file /etc/fstab
Notice: /Stage[main]/Main/Mount[/Volumes/share]/ensure: ensure changed 'unmounted' to 'mounted'
Debug: Executing '/sbin/mount -o /Volumes/share'
Debug: /Stage[main]/Main/Mount[/Volumes/share]: The container Class[Main] will propagate my refresh event
Info: /Stage[main]/Main/Mount[/Volumes/share]: Scheduling refresh of Mount[/Volumes/share]
Info: Mount[/Volumes/share](provider=parsed): Remounting
Debug: Executing '/sbin/umount /Volumes/share'
Debug: Executing '/sbin/mount -o /Volumes/share'
Error: /Stage[main]/Main/Mount[/Volumes/share]: Failed to call refresh: Execution of '/sbin/mount -o /Volumes/share' returned 1: mount: realpath /Volumes/share: No such file or directory
Error: /Stage[main]/Main/Mount[/Volumes/share]: Execution of '/sbin/mount -o /Volumes/share' returned 1: mount: realpath /Volumes/share: No such file or directory
Debug: Class[Main]: The container Stage[main] will propagate my refresh event
Debug: Finishing transaction 70139321047620
Debug: Storing state
Debug: Stored state in 0.11 seconds
Notice: Finished catalog run in 0.70 seconds
Debug: Using settings: adding file resource 'rrddir': 'File[/var/lib/puppet/rrd]{:path=>"/var/lib/puppet/rrd", :mode=>"750", :owner=>"root", :ensure=>:directory, :loglevel=>:debug, :links=>:follow, :backup=>false}'
Debug: Finishing transaction 70139327177180
Debug: Received report to process from zzzz.yyyy.net
Debug: Processing report from zzzz.yyyy.net with processor Puppet::Reports::Store
编辑:
我发现其中一个失败的主机刚刚开始工作,就像变魔术一样。我收集了它开始工作的报告:
//aaaa.yyyy.net//Stage[main]/Osx-common/Mount[/Volumes/share] Failed to call refresh: Execution of '/sbin/mount -o /Volumes/share' returned 1: mount: realpath /Volumes/share: No such file or directory
//aaaa.yyyy.net//Stage[main]/Osx-common/Mount[/Volumes/share] Execution of '/sbin/mount -o /Volumes/share' returned 1: mount: realpath /Volumes/share: No such file or directory
然后(稍后):
还有一次失败,稍后再次失败:
//aaaa.yyyy.net/Puppet Failed to set owner to '501': No such file or directory - /Volumes/share
//aaaa.yyyy.net//Stage[main]/Osx-common/File[/Volumes/share]/owner change from root to administrator failed: Failed to set owner to '501': No such file or directory - /Volumes/share
//aaaa.yyyy.net/Puppet Failed to set group to '21': No such file or directory - /Volumes/share
//aaaa.yyyy.net//Stage[main]/Osx-common/File[/Volumes/share]/group change from wheel to administrator failed: Failed to set group to '21': No such file or directory - /Volumes/share
//aaaa.yyyy.net/Puppet failed to set mode 555 on /Volumes/share: No such file or directory - /Volumes/share
//aaaa.yyyy.net//Stage[main]/Osx-common/File[/Volumes/share]/mode change from 0555 to 0777 failed: failed to set mode 555 on /Volumes/share: No such file or directory - /Volumes/share
//aaaa.yyyy.net//Stage[main]/Osx-common/Mount[/Volumes/share] Dependency File[/Volumes/share] has failures: true
//aaaa.yyyy.net//Stage[main]/Osx-common/Mount[/Volumes/share] Skipping because of failed dependencies
最后:
//aaaa.yyyy.net//Stage[main]/Osx-common/File[/Volumes/share]/owner owner changed 'root' to 'administrator'
//aaaa.yyyy.net//Stage[main]/Osx-common/File[/Volumes/share]/group group changed 'wheel' to 'administrator'
//aaaa.yyyy.net//Stage[main]/Osx-common/File[/Volumes/share]/mode mode changed '0555' to '0777'
//aaaa.yyyy.net//Stage[main]/Osx-common/Mount[/Volumes/share]/options options changed '0' to ''
//aaaa.yyyy.net//Stage[main]/Osx-common/Mount[/Volumes/share]/pass defined 'pass' as '0'
//aaaa.yyyy.net//Stage[main]/Osx-common/Mount[/Volumes/share] Triggered 'refresh' from 2 events
这就是它的工作原理。我不知道为什么这个主机现在工作正常,但是第一个主机出现了如上所述的故障 您可以尝试使用木偶排序箭头
file { "/Volumes/share":
ensure => directory,
}
mount {"/Volumes/share":
ensure => "mounted",
device => "xxxx@yyyy.net:/share",
name => "/Volumes/share",
atboot => true,
fstype => "nfs",
options => "",
}
File["/Volumes/share"] -> Mount["/Volumes/share"]
这很有趣。它现在正在我应用这个类的两台机器中的一台上工作。我将回顾报告并查看更改内容和更改时间。我已使用工作主机的报告编辑了问题。请尝试在装载资源或资源排序中使用后。我已尝试使用
require
而不是之前的,不幸的是,情况完全相同!但是在mount资源中,您是否尝试过使用“after”选项,直到我不得不重新启动机器,这一操作才开始正常工作(请参见问题)。然后它开始失败。我猜是什么让它开始在那台机器上工作,最初是让它在原来有问题的机器上工作。我将尝试其他订购示例,看看会发生什么。
file { "/Volumes/share":
ensure => directory,
}
mount {"/Volumes/share":
ensure => "mounted",
device => "xxxx@yyyy.net:/share",
name => "/Volumes/share",
atboot => true,
fstype => "nfs",
options => "",
}
File["/Volumes/share"] -> Mount["/Volumes/share"]