我有一本实战手册,它试图使用AWS RDS模块来获取有关RDS实例的事实。这本剧本只有一种效果。在针对localhost运行时,如下所示,它工作得很好:
- hosts: localhost
connection: local
gather_facts: False
tasks:
- name: look up info for {{ env }} - {{ store }}
rds:
command=facts
instance_name="postgres-{{ env }}-{{ store }}"
region={{ region }}
register: rds
until: rds.instance.status == "available"
retries: 30
delay: 60
- name: debug it
debug: msg="{{ rds.instance.status }}"显示状态为"available“。但是,如果我在另一台机器(我的一个EC2实例)上运行它,它就会显示该数据库不存在。所以,这是行不通的:
- hosts: tag_app_utility:&tag_store_ops:&tag_env_{{ env }}
tasks:
- name: look up info for {{ env }} - {{ store }}
rds:
command=facts
instance_name="postgres-{{ env }}-{{ store }}"
region={{ region }}
register: rds
until: rds.instance.status == "available"
retries: 30
delay: 60
- name: debug it
debug: msg="{{ rds.instance.status }}"对于为什么它只能在本地主机上工作有什么想法吗?
发布于 2015-08-25 22:37:34
正如Bruce P提到的,它是凭据。永远不要忘记检查您的IAM凭证。
https://stackoverflow.com/questions/32192271
复制相似问题