Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.4k views
in Technique[技术] by (71.8m points)

ansible在一台服务器如何做到任务并行

场景介绍
一台服务器有36块盘,我用ansible来格式化磁盘,但这个任务是串行的。36块盘格式化耗时较长。

如果我将36块盘分成两组,也是第一组格式化完才能格式化第二组,还是串行。

- name: format disks all disks when xfs
  filesystem:
    dev: "/dev/{{ item[0] }}"
    fstype: xfs
    force: true
    opts: "-L xxx{{ item[1] }}"
  with_together:
    - [sda,sdb,sdc, ...]
    - [1, 2, 3, ...]

有什么办法让这36块盘一起格式化吗?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...