我知道在同一個清單中,資源類型具有唯一的名稱。如何安裝並卸載puppet中的文件系統?
對於「安裝」資源,名稱是設備將被安裝的路徑。
我想要做木偶如下:
- 掛載NFS分區
- 從該執行腳本安裝點
- 卸載這個分區
所以我宣佈:
mount {'/mnt/tina': device => 'tina-iuem:/distrib', fstype => 'nfs', options => "defaults", remounts => false, atboot => false, ensure => mounted, } exec {'install': command => '/mnt/tina/mycommand.sh' }
那麼,如何卸載'/ mnt/tina'資源呢?
值得注意的是,puppet中的裝載資源的名稱確實是資源裝載的路徑,但它只默認爲資源的標題(http://docs.puppetlabs.com/references/latest/type.html#mount-attribute-name)。 您可以任意指定資源名稱,然後在資源內部將資源名稱(安裝點)定義到需要指向的位置,避免重複資源。 – 2014-04-04 13:14:31