【发布时间】:2019-10-24 21:52:39
【问题描述】:
我正在尝试使用 ansible 在 aws 中创建一个 ec2 实例。
我事先使用 aws configure 提供了访问密钥 ID 和访问密钥秘密
我从我在 rosttahub 的帐户中获取了这些密钥
这是代码
---
- name: Launch EC2 Instance
hosts: local
connection: local
tasks:
- name: Launching_Instance
ec2:
key_name: UbuntuKey
region: eu-west-1
instance_type: t2.micro
image: ami-08d658f84a6d84a80
group: default
vpc_subnet_id: subnet-904a51c8
assign_public_ip: yes
count: 1
aws_access_key: ''
aws_secret_key: ''
wait: yes
这是我的主机文件中包含的内容
[local]
localhost ansible_connection=local ansible_python_interpreter=python
当我运行剧本时
ansible-playbook ec2.yml
PLAY [Launch EC2 Instance] **********************************************************************************************
TASK [Gathering Facts] **************************************************************************************************
ok: [localhost]
TASK [Launching_Instance] ***********************************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "boto required for this module"}
PLAY RECAP **************************************************************************************************************
localhost : ok=1 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
【问题讨论】:
标签: amazon-web-services ansible boto aws-cli botocore