From 6b80d167b2c390c716c16f5f944a9bb1b5d492f8 Mon Sep 17 00:00:00 2001 From: Steve Smith Date: Tue, 23 Apr 2019 12:07:54 +1000 Subject: [PATCH] DCD-224: Fix order of fetching/using metadata. --- roles/aws_common/tasks/main.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/roles/aws_common/tasks/main.yml b/roles/aws_common/tasks/main.yml index c6cb279..fa0b19b 100644 --- a/roles/aws_common/tasks/main.yml +++ b/roles/aws_common/tasks/main.yml @@ -3,11 +3,12 @@ - name: Install distro-specific prerequisites include_tasks: "{{ ansible_distribution|lower }}.yml" -- name: Use EC2 instance ID for cluster node ID - set_fact: - atl_cluster_node_id: "{{ ansible_ec2_instance_id }}" - - name: Fetch local EC2 metadata ec2_metadata_facts: # Guard is mostly for testing when: ansible_system_vendor == "Amazon EC2" + +- name: Use EC2 instance ID for cluster node ID + set_fact: + atl_cluster_node_id: "{{ ansible_ec2_instance_id }}" +