是否可以在 lvm puppet 模組內建立 tmpfs?

是否可以在 lvm puppet 模組內建立 tmpfs?

我們有 Linux 機器的自動設定(使用 trusty 和 xenial),而且我們正在使用 puppet。我們使用LVM木偶實驗室/lvm並在 hiera 中指定它。例子:

lvm::volume_groups:
  group1:
    physical_volumes:
      - /dev/sdc
    logical_volumes:
      test:
        mountpath: /var/lib/test
        mountpath_require: true
  group2:
    physical_volumes:
      - /dev/sdb
    logical_volumes:
      data:
        mountpath: /mnt/data
        mountpath_require: true

hiera 中的此配置有效。現在,我想將 group1 更改為不掛載實體設備,而是使用 tmpfs。我試過

  group1:
    physical_volumes:
      - none
    logical_volumes:
      test:
        mountpath: /var/lib/test
        mountpath_require: true
        fs_type: tmpfs
        options: size=1024M

但沒有出現錯誤訊息:

Parameter name failed on Physical_volume[none]: Physical Volume names must be fully qualified at /etc/puppet/modules/lvm/manifests/volume_group.pp:17

任何建議表示讚賞!謝謝

答案1

簡短回答:不。

更長的答案:我對 puppet 知之甚少,但對 LVM 了解很多,而且我確實知道 tmpfs 旨在由 RAM 支持,而不是物理塊設備(如磁碟或邏輯卷(LV))。因此,您要么需要 LV 上的「真實」檔案系統(如 ext4),或者使用不同的模組來建立 tmpfs。

相關內容