【发布时间】:2020-06-03 17:34:49
【问题描述】:
嗨,我无法解决这些问题,我得到了这些,我的 ansible 代码无法找到凭据
可靠的代码
---
- name: main yaml file
remote_user: ec2-user
become: yes
hosts: localhost
roles:
- s3
角色:
- name: basic upload
s3_sync:
bucket: s3uploadlocust
file_root: /home/ec2-user
include: "*.csv"
exclude: "*.txt,.*"
permission: public-read
file_change_strategy: force
region: us-east-1
这里是我的环境工具版本:
Name: boto3
Version: 1.12.2
Summary: The AWS SDK for Python
Home-page: https://github.com/boto/boto3
Author: Amazon Web Services
Author-email: UNKNOWN
License: Apache License 2.0
Location: /usr/local/lib/python2.7/site-packages
Requires: s3transfer, jmespath, botocore
Name: ansible
Version: 2.9.5
Summary: Radically simple IT automation
Home-page: https://ansible.com/
Author: Ansible, Inc.
Author-email: info@ansible.com
License: GPLv3+
Location: /usr/local/lib/python2.7/site-packages
Requires: jinja2, PyYAML, cryptography
Python 2.7.16
【问题讨论】:
-
你能提供你得到的错误吗?
-
您如何尝试获取凭据?通过环境变量通过配置文件?也请参考docs.ansible.com/ansible/latest/modules/s3_sync_module.html中的注释部分