I have the use case where I want to create a snapshot, make a new volume 
from that snapshot, but larger, and then attach the new volume to an 
instance. 

So far, I have the snapshot creation working, but the ec2_vol module is now 
telling me that I cannot specify a volume size with the snapshot id. Why 
not? This is something I can do in the web GUI. 

- name: snapshot current backup volume
  ec2_snapshot:
    aws_access_key: "{{aws_key}}"
    aws_secret_key: "{{aws_secret}}"
    region: "{{aws_region}}"
    state: present
    wait: yes
    wait_timeout: 0 #0 means Never timeout(sec)
    description: "snapshot of xvdj from backup server taken 
{{ansible_date_time.iso8601}}"
    instance_id: "i-a34c2967"
    device_name: "/dev/xvdj"
    snapshot_tags:
      frequency: random
      client: jdelaporte
      Name: "backups_{{ansible_date_time.iso8601}}"
  register: new_snapshot

- name: get instance id for current nfsmaster
  ec2_remote_facts:
    aws_access_key: "{{aws_key}}"
    aws_secret_key: "{{aws_secret}}"
    region: "{{aws_region}}"
    filters:
      ip-address: 52.34.225.188
  register: nfsmaster_info

- name: create new volume from new backup data snapshot
  ec2_vol:
    aws_access_key: "{{aws_key}}"
    aws_secret_key: "{{aws_secret}}"
    region: "{{aws_region}}"
    state: present
    device_name: /dev/xvdz
    volume_size: 700
    snapshot: "{{new_snapshot.snapshot_id}}"
    instance: "{{item.id}}"
    volume_type: standard
  with_items: "{{nfsmaster_info.instances}}"


failed: [localhost] ...
"msg": "Cannot specify volume_size together with id or snapshot"



-- 
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/99eb549e-50b3-4e83-9e51-32581178cbc6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to