Ansible错误 - 未找到身份验证处理程序:

时间:2017-08-10 19:50:16

标签: amazon-web-services amazon-s3 ansible

我正在尝试从s3存储桶下载文件,我做了配置并导出了我的访问密钥和密钥,但我仍然得到相同的错误。请建议我

代码:

- name: Download xx tarball
  s3:
      bucket: xxx
      object: folder/xx-commandline-4.0.3.tar.gz
      dest: '/tmp/{{ xx_tarball }}'
      mode: get
  when: 'st.stat.exists == false'

错误:

fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "msg": "No Authentication Handler found: No handler was ready to authenticate. 1 handlers were checked. ['HmacAuthV1Handler'] Check your credentials "}


ansible --version
ansible 2.0.0.2



uname -a
Linux ip-xx-xxx-xx-x 4.4.0-1026-aws #35-Ubuntu SMP Thu Jul 20 21:59:09 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

1 个答案:

答案 0 :(得分:0)

你需要检查几件事情:

I- boto安装在目标主机上,您需要从s3下载文件:

sudo -H pip install boto

II-如果这是远程主机,则使用以下格式:

- name: Download xx tarball
  s3:
    aws_access_key: "{{ AWS_S3_ACCESS_KEY }}"
    aws_secret_key: "{{ AWS_S3_SECRET_KEY }}"
    bucket: xxx
    object: folder/xx-commandline-4.0.3.tar.gz
    dest: '/tmp/{{ xx_tarball }}'
    mode: get
  when: st.stat.exists == false

注意:导出AWS凭据时,它可以在本地运行,但不能用于远程主机,因此您需要将凭据传递给模块,以便它可以用于远程主机。

希望它可以帮到你