aws_s3 module problem Ansible 2.4

I have simple task to download file from s3 bucket which works fine with Ansible 2.3, when I have upgraded the ansible from 2.3 to 2.4, it complain that I need to use the aws_s3 module instead of s3 which I did and getting the following error:

`
─➤ansible-playbook -i localhost, playbook.yml 4 ↵

PLAY [all] *******************************************************************************************************************

TASK [Download the latest version of from S3 bucket] *************************************************************************
fatal: [localhost]: FAILED! => {“changed”: false, “failed”: true, “msg”: “Key /node/qa/1.0.483/node.tar.gz with version id None does not exist.”}

PLAY RECAP *******************************************************************************************************************
localhost : ok=0 changed=0 unreachable=0 failed=1
`

Here is my task:
`

  • name: Download the latest version of from S3 bucket
    aws_s3:
    aws_access_key: “xxxxxxxxxxx”
    aws_secret_key: “yyyyyyyyyyyyyyyyyyyyyyy”
    bucket: “artifacts-bucket”
    object: “/node/qa/1.0.483/node.tar.gz”
    mode: get
    dest: “node.tar.gz”
    `

Few notes:

  • versioning is not enabled on my s3 bucket
  • installed the boto3 that is the requirement for aws_s3 module
  • the exact same tasks work fine with ansible 2.3 and did give this error
    `
    “Key /node/qa/1.0.483/node.tar.gz with version id None does not exist.”

`

Any help appreciated

Looks like this was a bug introduced with the move from boto to boto3.

A fix is in progress:

https://github.com/ansible/ansible/pull/30580

Note that until this is fixed, removing the leading ‘/’ from your object will work.