Hi Vincent,

Did you ever find a solution? I have very much the same requirement, adding 
disks to cloud instances. In my case it would be more of a case of 
incrementing the device name eg /dev/sda , /dev/sdb , /dev/sdc , etc.

Thanks
Dan

On Tuesday, February 28, 2017 at 4:48:07 AM UTC+11, Vincent Burgun wrote:
>
> Hi,
> We use ansible 2.1.0.0 for create VM on vmware vSphere 6.0.
>
> Sometimes we need to add a disk
> We use a role "srv_disk"
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> *- name: "Configure extra disk"  delegate_to: localhost  ignore_errors: 
> yes  vsphere_guest:    vcenter_hostname: "{{ vcenter_hostname }}"    
> username: "{{ vcenter_username }}"    password: "{{ vcenter_password }}"    
> guest: "{{ inventory_hostname }}"    vm_disk:      disk1:      
> disk2:        size_gb: "{{ disk_size_gb }}"        type: thick        
> datastore: "{{ datastore.stdout }}"     state: reconfigured*
>
> The problem is that we are forced to add a disk number. This is 
> problematic when we have to recall the role to create a third disk.
>
> Is it possible to use a variable to indicate the number of the disk?
> The ideal solution would be to be able to detect the number of discs on 
> the VM and to automatically increment the number of the disc to be added.
>
> exemple :
>
>
>
>
>
>
>
>
>
>
>
> *guest: "{{ inventory_hostname }}"    vm_disk:      disk1:      disk{{ 
> disk_number }}:        size_gb: "{{ disk_size_gb }}"        type: 
> thick        datastore: "{{ datastore.stdout }}"Thank for your help*
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/27a56e3c-d948-4619-a2a0-317c9145ea6e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to