Skip to content

Commit

Permalink
Update current_inventory_sources.j2 to fix the empty credential scena…
Browse files Browse the repository at this point in the history
…rio (#812)

* Update current_inventory_sources.j2 to fix the empty credential scenario

* Create empty-inventory-source-credential.yaml

* Update current_inventory_sources.j2

---------

Co-authored-by: Tom Page <[email protected]>
  • Loading branch information
iamgini and Tompage1994 authored Apr 16, 2024
1 parent b0d76d3 commit 0be9740
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions changelogs/fragments/empty-inventory-source-credential.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
bugfixes:
- Fixed the empty credential scenario where the playbook looks for credential names and fails with undefied value.
...
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ controller_inventory_sources:
inventory: "{{ inventory_source.summary_fields.inventory.name }}"
update_on_launch: "{{ inventory_source.update_on_launch }}"
overwrite: "{{ inventory_source.overwrite }}"
{% if inventory_source.credential is defined %}
{% if inventory_source.summary_fields.credential is defined %}
credential: "{{ inventory_source.summary_fields.credential.name }}"
{% endif %}
{% set query_notification_error = query(controller_api_plugin, inventory_source.related.notification_templates_error,
Expand Down

0 comments on commit 0be9740

Please sign in to comment.