From b0acfee5df80cf3921dcf93192292209d9400332 Mon Sep 17 00:00:00 2001 From: Helen Bailey Date: Fri, 13 Dec 2024 15:02:30 -0500 Subject: [PATCH] Small updates to ec2 pattern --- .../configure_ec2/playbooks/create_ec2_instance.yml | 8 ++++---- .../tasks/ec2_instance_create_operations.yml | 1 - 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/extensions/patterns/configure_ec2/playbooks/create_ec2_instance.yml b/extensions/patterns/configure_ec2/playbooks/create_ec2_instance.yml index 3b0af4a4..032c9866 100644 --- a/extensions/patterns/configure_ec2/playbooks/create_ec2_instance.yml +++ b/extensions/patterns/configure_ec2/playbooks/create_ec2_instance.yml @@ -21,12 +21,12 @@ amazon.aws.ec2_key_info: names: - "{{ key_name }}" - register: key_info_result + register: pattern_key_info_result - name: Set manage_ec2_instance_key_name role var ansible.builtin.set_fact: manage_ec2_instance_key_name: "{{ key_name }}" - when: key_info_result.keypairs | length > 0 + when: pattern_key_info_result.keypairs | length > 0 - name: Get RHEL 9 AMI ID if needed when: ami_id | default("", true) == "" @@ -73,5 +73,5 @@ - name: Warn if key does not exist ansible.builtin.debug: - msg: "Warning: The key '{{ key_name }}' does not exist!" - when: key_name is defined and key_info_result.keypairs | length == 0 + msg: "Warning: The provided key '{{ key_name }}' does not exist!" + when: key_name is defined and pattern_key_info_result.keypairs | length == 0 diff --git a/roles/manage_ec2_instance/tasks/ec2_instance_create_operations.yml b/roles/manage_ec2_instance/tasks/ec2_instance_create_operations.yml index aef5a0b0..7fef6a45 100644 --- a/roles/manage_ec2_instance/tasks/ec2_instance_create_operations.yml +++ b/roles/manage_ec2_instance/tasks/ec2_instance_create_operations.yml @@ -21,7 +21,6 @@ names: - "{{ manage_ec2_instance_key_name }}" register: key_info_result - no_log: true - name: Create new key pair amazon.aws.ec2_key: