title: Ansible, vmware_guest and mounting a disk
body: <p>I'm using ansible and the <code>vmware_guest</code> module to spin up VMs. </p>
  
  <p>Specifically, I'm creating VMs from a template, like so:</p>
  
  <pre><code>- name: Deploy VM from template
    vmware_guest:
      annotation: "{{ lookup('template', './templates/annotations.j2') }}"
      hostname: '{{ deploy_vsphere_host }}'
      username: '{{ deploy_vsphere_user }}'
      password: '{{ deploy_vsphere_password }}'
      validate_certs: no
      datacenter: '{{ deploy_vsphere_datacenter }}'
      esxi_hostname: '{{ deploy_vsphere_cluster }}'
      folder: '{{ deploy_vsphere_folder }}'
      name: '{{ inventory_hostname }}'
      guest_id: '{{ guest_id }}'
      disk:
      - size_gb: '{{ disk_size }}'
        type: thin
        datastore: '{{ deploy_vsphere_datastore }}'
      networks:
      - name: '{{ guest_network }}'
        start_connected: true
        allow_guest_control: true
        ip: "{{ ansible_host }}"
        netmask: '{{ guest_netmask }}'
        gateway: '{{ guest_gateway }}'
        dns_servers:
        - '{{ guest_dns_server }}'
      hardware:
        memory_mb: '{{ guest_memory }}'
        num_cpus: '{{ guest_vcpu }}'
      customization:
        dns_servers:
        - '{{ guest_dns_server }}'
        domain : '{{ guest_domain_name }}'
        hostname: '{{ inventory_hostname }}'
      template: '{{ guest_template }}'
      wait_for_ip_address: yes
      wait_for_customization: yes
      state: "{{ state }}"
    delegate_to: localhost
  </code></pre>
  
  <p>However, the disk is not automatically mounted.</p>
  
  <p>For example, I'm adding a 1000GB disk, using the <code>{{ disk_size }}</code>. When I ssh to the VM, I get the following details:</p>
  
  <h1>lsblk</h1>
  
  <pre><code>NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
  fd0               2:0    1    4K  0 disk 
  sda               8:0    0 1000G  0 disk 
  ├─sda1            8:1    0    1G  0 part /boot
  └─sda2            8:2    0   15G  0 part 
    ├─centos-root 253:0    0 13.4G  0 lvm  /
    └─centos-swap 253:1    0  1.6G  0 lvm  
  sr0              11:0    1 1024M  0 rom  
  </code></pre>
  
  <h1>df -h</h1>
  
  <pre><code>Filesystem               Size  Used Avail Use% Mounted on
  /dev/mapper/centos-root   14G   12G  2.3G  84% /
  devtmpfs                  12G     0   12G   0% /dev
  tmpfs                     12G     0   12G   0% /dev/shm
  tmpfs                     12G  2.3M   12G   1% /run
  tmpfs                     12G     0   12G   0% /sys/fs/cgroup
  /dev/sda1               1014M  189M  826M  19% /boot
  tmpfs                    2.4G     0  2.4G   0% /run/user/1000
  </code></pre>
  
  <h1>fdisk</h1>
  
  <pre><code>Disk /dev/sda: 1073.7 GB, 1073741824000 bytes, 2097152000 sectors
  Units = sectors of 1 * 512 = 512 bytes
  Sector size (logical/physical): 512 bytes / 512 bytes
  I/O size (minimum/optimal): 512 bytes / 512 bytes
  Disk label type: dos
  Disk identifier: 0x000a708c
  
     Device Boot      Start         End      Blocks   Id  System
  /dev/sda1   *        2048     2099199     1048576   83  Linux
  /dev/sda2         2099200    33554431    15727616   8e  Linux LVM
  
  Disk /dev/mapper/centos-root: 14.4 GB, 14382268416 bytes, 28090368 sectors
  Units = sectors of 1 * 512 = 512 bytes
  Sector size (logical/physical): 512 bytes / 512 bytes
  I/O size (minimum/optimal): 512 bytes / 512 bytes
  
  
  Disk /dev/mapper/centos-swap: 1719 MB, 1719664640 bytes, 3358720 sectors
  Units = sectors of 1 * 512 = 512 bytes
  Sector size (logical/physical): 512 bytes / 512 bytes
  I/O size (minimum/optimal): 512 bytes / 512 bytes
  </code></pre>
  
  <h1>blkid</h1>
  
  <pre><code>
  /dev/mapper/centos-root: UUID="1f352c63-6b7d-4005-89ce-a0dbc149d2e0" TYPE="xfs" 
  /dev/sda2: UUID="KvUYqI-biVh-jl4C-yi2F-ZPtK-Fokq-1CHzwH" TYPE="LVM2_member" 
  /dev/sda1: UUID="cdaaa519-be25-4ada-badb-28edbfae5750" TYPE="xfs" 
  /dev/mapper/centos-swap: UUID="c614ac9a-665f-4a0c-bd13-31c377db3c43" TYPE="swap" 
  </code></pre>
  
  <h1>Question</h1>
  
  <p>What is the best way, using Ansible, to mount and use the 1000gb disk?</p>