Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot create snapshot before deleting RDS instance #1

Open
ingenieroariel opened this issue Jun 5, 2015 · 4 comments
Open

Cannot create snapshot before deleting RDS instance #1

ingenieroariel opened this issue Jun 5, 2015 · 4 comments

Comments

@ingenieroariel
Copy link
Member

ok: [localhost]
 ___________________________________________________________
/ TASK: Delete postgres rds instance, but create a snapshot \
\ before doing so                                           /
 -----------------------------------------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||


failed: [localhost] => {"failed": true, "parsed": false}
Traceback (most recent call last):
  File "/home/x/.ansible/tmp/ansible-tmp-1433546375.34-147069845747561/rds", line 2816, in <module>
    main()
  File "/home/x/.ansible/tmp/ansible-tmp-1433546375.34-147069845747561/rds", line 1012, in main
    invocations[module.params.get('command')](module, conn)
  File "/home/x/.ansible/tmp/ansible-tmp-1433546375.34-147069845747561/rds", line 714, in delete_db_instance_or_snapshot
    result = conn.delete_db_instance(instance_name, **params)
  File "/home/x/.ansible/tmp/ansible-tmp-1433546375.34-147069845747561/rds", line 443, in delete_db_instance
    result = self.connection.delete_db_instance(instance_name, **params)['DeleteDBInstanceResponse']['DeleteDBInstanceResult']['DBInstance']
TypeError: delete_db_instance() got an unexpected keyword argument 'final_snapshot_id'


FATAL: all hosts have already failed -- aborting
@flyte
Copy link

flyte commented Jun 26, 2015

I've just hit this problem too.

@flyte
Copy link

flyte commented Jul 2, 2015

I've done a PR on ansible-modules-core which fixes this bug. The solution will be to update Ansible once it's rolled into a release.

@ingenieroariel
Copy link
Member Author

Thanks a lot @flyte. I fixed it locally by patching both boto and ansible and was able to keep going. It would be great to see a fix upstream.

@flyte
Copy link

flyte commented Jul 2, 2015

You could also have separated out the snapshot and deletion into two actions. That's what I've had to do for now - making sure to tell the snapshot command to wait for completion!

    - name: Take snapshot of RDS instance
      rds:
        aws_access_key: "{{ aws_access_key }}"
        aws_secret_key: "{{ aws_secret_key }}"
        command: snapshot
        instance_name: "{{ rds_db.instance.id }}"
        region: eu-west-1
        snapshot: "mysnapshot-{{ ansible_date_time.epoch }}"
        wait: yes
      register: rds_snapshot

    - name: Remove RDS instance
      rds:
        aws_access_key: "{{ aws_access_key }}"
        aws_secret_key: "{{ aws_secret_key }}"
        command: delete
        instance_name: "{{ rds_db.instance.id }}"
        region: eu-west-1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants