Re: [ansible-project] parted - azure managed disks - unrecognized disk label

2020-02-13 Thread 'deewon' via Ansible Project
I know right :) 

It was an isolated lab environment so no harm done. 

appreciated!

On Wednesday, February 12, 2020 at 5:09:57 PM UTC, Hugo Gonzalez wrote:
>
>
>
> On 2/11/20 6:23 AM, 'deewon' via Ansible Project wrote:
>
> 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. 
>

-- 
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-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/967b444e-df43-4546-9674-85d5654610d1%40googlegroups.com.


Re: [ansible-project] parted - azure managed disks - unrecognized disk label

2020-02-12 Thread Hugo Gonzalez



On 2/11/20 6:23 AM, 'deewon' via Ansible Project wrote:

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.

--
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-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/ab9769be-4b62-cc0b-992d-f9826980a082%40redhat.com.


Re: [ansible-project] parted - azure managed disks - unrecognized disk label

2020-02-11 Thread 'deewon' via Ansible Project
I got to the bottom of this eventually :)

The task was running on the controller which didn't have a /dev/sdc device 
:)

Simply delegating the task to the remote node fixed the problem

Thanks!


On Tuesday, February 11, 2020 at 10:41:44 AM UTC, deewon wrote:
>
> Thanks Hugo!
>
> I gave this a go with the label explicitly specified and it returned the 
> same error i.e.
>
> - name: Partition Disk
>   parted:
> device: /dev/sdc
> number: 1
> state: present
> label: msdos
>
>   
>
> TASK [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}
>
>
> I suppose the issue is more related to the disk profile as opposed to the 
> parted module in itself?  The disk itself was created as recommended by 
> azure (
> https://docs.microsoft.com/en-us/azure/virtual-machines/linux/add-disk) 
>
> Regards
>
> On Monday, February 10, 2020 at 7:01:17 PM UTC, Hugo Gonzalez wrote:
>>
>>
>> On 2/10/20 3:49 AM, 'deewon' via Ansible Project wrote:
>>
>> 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.
>>
>>
>> The disk label is the partition table, and will not be recognized for an 
>> unpartitioned disk. There is a parameter in the module called "label" with 
>> a default of "msdos" as the table format.
>>
>>
>> https://docs.ansible.com/ansible/latest/modules/parted_module.html#parameter-label
>>
>> So I guess you can pass it along your partition definitions. Just make 
>> sure it works idempotently, I haven't tested it.
>>
>> Hugo G.
>>
>>
>>
>>
>>
>> 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:7
>> fatal: [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...@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
>>  
>> 
>> .
>>
>>

-- 
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-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/8b052201-0145-48cd-b48c-feb6a893300c%40googlegroups.com.


Re: [ansible-project] parted - azure managed disks - unrecognized disk label

2020-02-11 Thread 'deewon' via Ansible Project
Thanks Hugo!

I gave this a go with the label explicitly specified and it returned the 
same error i.e.

- name: Partition Disk
  parted:
device: /dev/sdc
number: 1
state: present
label: msdos

  

TASK [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}


I suppose the issue is more related to the disk profile as opposed to the 
parted module in itself?  The disk itself was created as recommended by 
azure (
https://docs.microsoft.com/en-us/azure/virtual-machines/linux/add-disk) 

Regards

On Monday, February 10, 2020 at 7:01:17 PM UTC, Hugo Gonzalez wrote:
>
>
> On 2/10/20 3:49 AM, 'deewon' via Ansible Project wrote:
>
> 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.
>
>
> The disk label is the partition table, and will not be recognized for an 
> unpartitioned disk. There is a parameter in the module called "label" with 
> a default of "msdos" as the table format.
>
>
> https://docs.ansible.com/ansible/latest/modules/parted_module.html#parameter-label
>
> So I guess you can pass it along your partition definitions. Just make 
> sure it works idempotently, I haven't tested it.
>
> Hugo G.
>
>
>
>
>
> 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:7
> fatal: [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...@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
>  
> 
> .
>
>

-- 
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-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/8f3c285c-3eb7-4737-b279-e8a166144ee7%40googlegroups.com.


Re: [ansible-project] parted - azure managed disks - unrecognized disk label

2020-02-10 Thread Hugo Gonzalez


On 2/10/20 3:49 AM, 'deewon' via Ansible Project wrote:

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.



The disk label is the partition table, and will not be recognized for an 
unpartitioned disk. There is a parameter in the module called "label" 
with a default of "msdos" as the table format.


https://docs.ansible.com/ansible/latest/modules/parted_module.html#parameter-label

So I guess you can pass it along your partition definitions. Just make 
sure it works idempotently, I haven't tested it.


Hugo G.






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:7
fatal: [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-project+unsubscr...@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 
.


--
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-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/fddc5b5c-becc-cb23-74e1-dd70ca0dc0a9%40redhat.com.


[ansible-project] parted - azure managed disks - unrecognized disk label

2020-02-10 Thread 'deewon' via Ansible Project
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.


Error: /dev/sdc: unrecognised disk label
Model: Msft Virtual Disk (scsi)
Disk /dev/sdc: 18.3GB
Sector size (logical/physical): 512B/4096B
Partition Table: unknown
Disk Flags:


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:7
fatal: [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-project+unsubscr...@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.