ansible模块中可以有多个参数值吗?

时间:2018-08-07 12:08:41

标签: ansible

是否可以在state=presentmounted中使用多个参数值?


  - name: create partition
    parted: device=/dev/sdc number=1 state=present
  - name: Create a ext4 filesystem on /dev/sdc1 and check disk blocks
    filesystem: fstype=ext4 dev=/dev/sdc1
  - name: mount the directory
    mount: path=/data src=/dev/sdc1 fstype=ext4 state=present

1 个答案:

答案 0 :(得分:0)

是,但是参数必须支持它。例如,yum模块接受软件包名称列表。但仅适用于state的单个值。因此,您应该做的是阅读模块参数的文档,并检查其是否支持多个值(列表)。

相关问题