I’m unable to get a list of an s3 bucket, Ansible says OK but no data is retrieved.
╰─➤ dpkg -l | grep boto
ii python-boto 2.40.0-1ubuntu1 all Python interface to Amazon’s Web Services - Python 2.x
ii python-boto3 1.4.2-1 all Python interface to Amazon’s Web Services - Python 2.x
ii python-botocore 1.5.7-1 all Low-level, data-driven core of boto 3 (Python 2)
╰─➤ ansible --version
ansible 2.3.1.0
config file = /etc/ansible/ansible.cfg
configured module search path = Default w/o overrides
python version = 2.7.12 (default, Nov 19 2016, 06:48:10) [GCC 5.4.0 20160609]
-
name: AWS Bucket get last SQL dunp
hosts: localhost
gather_facts: no
connection: local
vars:
bucket: myuniquebucketname
tasks: -
name: AWS get bucket list
s3:
bucket: “{{ bucket }}”
mode: list
register: mysqldump_list
tags: aws, bucket -
debug: var=“{{ mysqldump_list }}”
╰─➤ ansible-playbook -i /etc/ansible/ec2.py aws_bucket_mysqltest_getlast.yml
PLAY [AWS Bucket get last SQL dunp] ***********************************************************************************************************************************************************************************************************
TASK [AWS get bucket list] ********************************************************************************************************************************************************************************************************************
ok: [localhost]
TASK [debug] **********************************************************************************************************************************************************************************************************************************
ok: [localhost] => {
“<type ‘dict’>”: “VARIABLE IS NOT DEFINED!”
}
PLAY RECAP ************************************************************************************************************************************************************************************************************************************
localhost : ok=2 changed=0 unreachable=0 failed=0