Hi all,

I have a bunch of scripts I inherited that do a variety of things, 
primarily for setting up new environments in AWS.

Using v2.4, everything worked just fine.  As of v2.5, modules are applied 
to the currently running host instead of the target instance.  Needless to 
say this caused a really big confusing mess until we figured out what 
happened and forced everything to stay at v2.4.

For example, we have a playbook of:

- hosts: localhost
gather_facts: no
roles:
- { role: create_web_tier, tags: 'web' }


The role includes a 'create_ec2_instance' task which does the following:

- name: "create_ec2_instance | AWS EC2 | Create server"
local_action:
module: ec2
region: "{{ aws_region }}"
key_name: "{{ ec2_key_name }}"
image: "{{ ec2_image }}"
instance_type: "{{ ec2_instance_type }}"
vpc_subnet_id: "{{ ec2_vpc_subnet_id }}"
assign_public_ip: "{{ ec2_assign_public_ip }}"
group_id: "{{ ec2_group_id }}"
count: "{{ ec2_count }}"
instance_tags: "{{ ec2_instance_tags}}"
wait: yes
register: ec2

- debug: var=ec2 verbosity=4

- name: create_ec2_instance | Ansible | Add instance to host group
add_host:
hostname: "ec2_instance_host"
ansible_ssh_host: "{{ item.private_ip }}"
# ansible_ssh_user: "{{ global_ansible_ssh_user }}"
# ansible_ssh_private_key_file: "{{ global_ansible_ssh_private_key_file }}"
with_items: "{{ ec2.instances }}"


This should theoretically add the instance to inventory so that when we 
perform the following task later:
# Perform server default tasks
- include_tasks: set_server_defaults.yml
delegate_to: "ec2_instance_host"
become: true


The task applies a number of changes such as yum updates, etc.

But as soon as ansible is updated to 2.5+, this behaviour breaks and 
instead applies all those server settings to the local host running the 
playbook.

So far our only solution has been to block updates and to keep Ansible at 
2.4, which is far from ideal.

Does anyone have any insight as to why Ansible's behaviour would change so 
fundamentally?  This is a catastrophic disruption that has seriously shaken 
our confidence in Ansible.









-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/6fd8f723-a889-4416-99ed-bbc33565cbc7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to