| |
Hi all,
I'm pretty certain someone has figured this out so any hints will be appreciated
I've attached an azure managed disk to a linux vm but noticed it doesn't have any disk label i.e.
Consequently, the ansible parted module returns the below error when attempting to create a partition
TASK [role_azure_disk : Partition Azure Disk] ***********************************************************************************************************************************************************************************************task path: /etc/ansible/roles/role_azure_disk/tasks/main.yml:7fatal: [labserver]: FAILED! => {"changed": false, "err": "Error: Could not stat device /dev/sdc - No such file or directory.\n", "msg": "Error while getting device information with parted script: '/sbin/parted -s -m /dev/sdc -- unit 'KiB' print'", "out": "", "rc": 1}
To achieve idempotence when re-running playbooks , I'm trying to avoid using fdisk passed to the shell module i.e. (echo n; echo p; echo 1; echo ; echo ; echo w) | sudo fdisk /dev/sdc
Will appreciate any ideas on how to get around this
Thanks
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/49c9a80b-1302-4463-a6ee-0e1a2e049e8b%40googlegroups.com.
- name: Partition Disk
parted:
device: /dev/sdc
number: 1
state: present
label: msdosTASK [role_azure_disk : Partition Azure Disk] ***********************************************************************************************************************************************************************************************
task path: /etc/ansible/roles/role_azure_disk/tasks/main.yml:19
fatal: [dbbox8]: FAILED! => {"changed": false, "err": "Error: Could not stat device /dev/sdc - No such file or directory.\n", "msg": "Error while getting device information with parted script: '/sbin/parted -s -m /dev/sdc -- unit 'KiB' print'", "out": "", "rc": 1}To unsubscribe from this group and stop receiving emails from it, send an email to ansible...@googlegroups.com.
| |
I got to the bottom of this eventually :)
The task was running on the controller which didn't have a /dev/sdc device :)
Whoa! careful there! :)
Hugo G.