Advertisement
gassanpavel

ansible parted loop

Aug 13th, 2020
967
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 1.49 KB | None | 0 0
  1. DEFAULT
  2. mdadm_arrays:
  3.    # Define disk devices to assign to array
  4.     devices:
  5.      - '/dev/sdb'
  6.       - '/dev/sdc'
  7.       - '/dev/sdd'
  8.  
  9.  
  10. TASK
  11. - name: arrays | Create partition on disk(s)
  12.   parted:
  13.     device: "{{ item.devices }}"
  14.     number: 1
  15.     label: gpt
  16.     name: pri
  17.     state: present
  18.   loop: '{{ mdadm_arrays }}'
  19.  
  20. RESULT
  21. TASK [mdadm : arrays | Create partition on disk(s)] *******************************************************************************************************************************************************************
  22. [WARNING]: The value ['/dev/sdb', '/dev/sdc', '/dev/sdd'] (type list) in a string field was converted to u"['/dev/sdb', '/dev/sdc', '/dev/sdd']" (type string). If this does not look like what you expect, quote the
  23. entire value to ensure it does not change.
  24.  
  25. failed: [sw-sed-ansibleVM_(PGassan)] (item={u'state': u'present', u'name': u'md0', u'level': u'1', u'opts': u'noatime', u'mountpoint': u'/mnt/md0', u'filesystem': u'ext4', u'devices': [u'/dev/sdb', u'/dev/sdc', u'/dev/sdd']}) => {"ansible_loop_var": "item", "changed": false, "err": "Error: Could not stat device [/dev/sdb, - No such file or directory.\n", "item": {"devices": ["/dev/sdb", "/dev/sdc", "/dev/sdd"], "filesystem": "ext4", "level": "1", "mountpoint": "/mnt/md0", "name": "md0", "opts": "noatime", "state": "present"}, "msg": "Error while getting device information with parted script: '/sbin/parted -s -m ['/dev/sdb', '/dev/sdc', '/dev/sdd'] -- unit 'KiB' print'", "out": "", "rc": 1}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement