【发布时间】:2015-08-20 06:36:53
【问题描述】:
我尝试使用 ansible-playbook 创建 AMI,我已经导出 aws 密钥和访问路径,ansible 版本是 2.0.0。
- hosts: localhost
tasks:
- name: create ami
ec2_ami:
region: "ap-southeast-1"
instance_id: "i-c2xxxx"
name: "jmicro"
wait: yes
register: ami
但是当我运行命令:ansible-playbook create_ami.yml,我得到这个错误:
ERROR: Syntax Error while loading YAML script, create_ami.yml
Note: The error may actually appear before this position: line 5, column 1
ec2_ami:
region: "ap-southeast-1"
我的 yaml 脚本有问题吗?但是当我运行时:
# ansible localhost -m ec2_ami -a "instance_id=i-c2xxxx region=ap-southeast-1 wait=yes name=jmicro"
成功了!!
【问题讨论】:
标签: amazon-web-services ansible