я получаю следующее сообщение об ошибке во время игры: Terminate instances
запускается:Ошибка при истекающий EC2 например: анзибль
fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "msg": "Either region or ec2_url must be specified"}
Это мой сборник пьес:
- hosts: localhost
connection: local
remote_user: test
gather_facts: no
vars_files:
- files/aws_creds.yml
- files/info.yml
tasks:
- name: Basic provisioning of EC2 instance
ec2:
assign_public_ip: no
aws_access_key: "{{ aws_id }}"
aws_secret_key: "{{ aws_key }}"
region: "{{ aws_region }}"
image: "{{ standard_ami }}"
instance_type: "{{ free_instance }}"
key_name: "{{ ssh_keyname }}"
count: 3
state: present
group_id: "{{ secgroup_id }}"
wait: no
#delete_on_termination: yes
instance_tags:
Name: Dawny33Template
register: ec2
- name: Add new instance to host group
add_host:
hostname: "{{ item.public_ip }}"
groupname: launched
with_items: "{{ ec2.instances }}"
## Here lies the SSH code
- name: Wait for SSH to come up
wait_for:
host: "{{ item.public_ip }}"
port: 22
delay: 60
timeout: 320
state: started
with_items: "{{ ec2.instances }}"
- name: Configure instance(s)
hosts: launched
become: True
gather_facts: True
#roles:
# - my_awesome_role
# - my_awesome_test
tasks:
- name: install git
yum: name=git state=present
- name: check out a git repository
git: repo={{ repo_url }} dest=/Dest/To/Repo/ accept_hostkey=yes
vars:
repo_url: https://github.com/lorin/mezzanine-example.git
- name: Terminate instances
hosts: localhost
connection: local
tasks:
- name: Terminate instances that were previously launched
ec2:
state: 'absent'
instance_ids: '{{ ec2.instance_ids }}'
Что ошибка на самом деле означает? И как мне его решить?
Вы должны указать область в прекращении ec2 задачи –
@BenWhaley I добавили: 'region: 'us-west-2'' под линией instance_ids. Он выдает эту ошибку: 'fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "msg": "Никакой обработчик не был готов к аутентификации. Были проверены 1 обработчик. ['HmacAuthV4Handler'] Проверьте ваши учетные данные"} ':/ – Dawny33