2
這是編寫用於從S3存儲桶「artefact-test」下載文件的完整代碼。用於下載文件的S3模塊不能正常工作
- name: Download customization artifacts from S3
s3:
bucket: "artefact-test"
object: "cust/gitbranching.txt"
dest: "/home/ubuntu/"
mode: get
region: "{{ s3_region }}"
profile: "{{ s3_profile }}"
我也設置了boto配置文件和aws配置文件。我得到的,我不認爲不同的錯誤是有效的像 -
failed: [127.0.0.1] => {"failed": true, "parsed": false}
Traceback (most recent call last):
File "/home/dmittal/.ansible/tmp/ansible-tmp-1462436903.77-107775915578620/s3", line 2320, in <module>
main()
File "/home/dmittal/.ansible/tmp/ansible-tmp-1462436903.77-107775915578620/s3", line 304, in main
ec2_url, aws_access_key, aws_secret_key, region = get_ec2_creds(module)
File "/home/dmittal/.ansible/tmp/ansible-tmp-1462436903.77-107775915578620/s3", line 2273, in get_ec2_creds
region, ec2_url, boto_params = get_aws_connection_info(module)
File "/home/dmittal/.ansible/tmp/ansible-tmp-1462436903.77-107775915578620/s3", line 2260, in get_aws_connection_info
if not boto_supports_profile_name():
File "/home/dmittal/.ansible/tmp/ansible-tmp-1462436903.77-107775915578620/s3", line 2191, in boto_supports_profile_name
return hasattr(boto.ec2.EC2Connection, 'profile_name')
AttributeError: 'module' object has no attribute 'ec2'
failed: [127.0.0.1] => {"failed": true}
msg: Target bucket cannot be found
failed: [127.0.0.1] => {"failed": true}
msg: Target key cannot be found
鑑於桶和鍵指定了存在於AWS.The同樣的事情工作,如果我使用AWS-CLI命令做同樣的。
你在哪裏存儲存取權限和密鑰? – PumpkinSeed
您的存儲桶名稱應該是「工件測試」而不是「工件測試」嗎? –
什麼版本的Ansible和你安裝了什麼版本的Boto? – tedder42