使用ansible挂盘

  • hosts: new
    gather_facts: False
    tasks:

    • filesystem:
      fstype: ext4
      dev: /dev/vdb
    • mount:
      name: /data
      src: /dev/vdb
      fstype: ext4
      state: mounted

    • command: mount -a

ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook -i mount_host.ini -u root -k mount_host.playbook

坚持原创技术分享,您的支持将鼓励我继续创作!