Skip to content

Commit

Permalink
Fix ocp-workloads failing because of locate_env_authorized_key role (#…
Browse files Browse the repository at this point in the history
…4616)

* Add missing condition to cloud infra ec2

Make sure the locate_env_authorized_key role is executed only when needed.

* Add a default to avoid undefined variable error
  • Loading branch information
fridim authored Apr 11, 2022
1 parent 0504670 commit 5cdcb55
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions ansible/cloud_providers/ec2_infrastructure_deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
- name: Locate environment SSH key
include_role:
name: locate_env_authorized_key
when: instances | default([]) | length > 0

- name: Create keypair in ec2
include_role:
Expand Down
2 changes: 1 addition & 1 deletion ansible/roles/locate_env_authorized_key/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{%- elif hostvars.localhost.infra_ssh_key is defined -%}
{{ hostvars.localhost.infra_ssh_key }}
{%- else -%}
{{ output_dir }}/{{ env_authorized_key }}
{{ output_dir }}/{{ env_authorized_key | default(guid ~ 'key') }}
{%- endif -%}
- name: Set env_authorized_key_path_pub
Expand Down

0 comments on commit 5cdcb55

Please sign in to comment.