将所有ext3 / 4文件系统的最大安装数设置为X

时间:2019-03-19 13:12:03

标签: ansible

如何使用Ansible将所有ext3 / 4文件系统的最大挂载数设置为const reducer = (state = initialState, action) =>{ switch (action.type) { case 'SIGN_UP': return { ...action.payload }; case 'LOG_IN': return JSON.stringify(action.payload); default: return state; } }

我之前不知道设备的名称。这应该只对所有ext3 / ext4文件系统执行此操作。

1 个答案:

答案 0 :(得分:1)

我猜您想运行tune2fs进行设置吗? (source

例如,您可以从ansible_mounts遍历坐骑

- name: do stuff
  shell: tune2fs blah
  when: item.fstype in ['ext3', 'ext4'] 
  loop: '{{ ansible_mounts }}'

示例ansible_mounts条目(您可以通过ansible all -i localhost, -c local -m setup获得此条目)

        "ansible_mounts": [
        {
            "device": "/dev/xvda1",
            "fstype": "ext4",
            "mount": "/",
            "options": "rw,relatime,discard,data=ordered",
            "size_available": 7028932608,
            "size_total": 8259014656,
            "uuid": "3b6570e3-e97a-4908-9dfe-0092c272ffdc"
        },
        {
            "device": "/dev/loop0",
            "fstype": "squashfs",
            "mount": "/snap/core/6531",
            "options": "ro,nodev,relatime",
            "size_available": 0,
            "size_total": 95551488,
            "uuid": ""
        },