我尝试在新的AMI创建后使用ansible在AWS上创建新的启动配置,这是我的脚本剧本:
- hosts: localhost
tasks:
- name: create AMI
ec2_ami:
region: "ap-southeast-x"
instance_id: "i-xxxxxx"
name: "My AMI {{ ansible_date_time.date }} {{ ansible_date_time.hour }}-{{ ansible_date_time.minute }}"
wait: yes
state: present
register: ami
- name: create LC
ec2_lc:
name: "My LC {{ ansible_date_time.date }} {{ ansible_date_time.hour }}-{{ ansible_date_time.minute }}"
image_id: "{{ ami.image_id }}"
key_name: "my_key"
security_groups: "sg-xxxx"
instance_type: t2.medium
register: lcnew
但是当我尝试跑步时,我收到了这条消息:
ERROR: ec2_lc is not a legal parameter in an Ansible task or handler