Skip to content

Commit

Permalink
Follow up to #720 references #601
Browse files Browse the repository at this point in the history
  • Loading branch information
Klaas- authored Dec 5, 2023
1 parent af03e78 commit b601cf6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 1 addition & 2 deletions roles/inventory_sources/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
description: "{{ __controller_source_item.description | default(('' if controller_configuration_inventory_sources_enforce_defaults else omit), true) }}"
inventory: "{{ __controller_source_item.inventory.name | default(__controller_source_item.inventory) | mandatory }}"
organization: "{{ __controller_source_item.inventory.organization.name | default(__controller_source_item.organization | default(('' if controller_configuration_inventory_sources_enforce_defaults else omit), true)) }}"
source: "{{ __controller_source_item.source | default(('scm' if controller_configuration_inventory_sources_enforce_defaults else omit), true) }}"
source: "{{ omit if __controller_source_item.source is defined and __controller_source_item.source == 'constructed' else __controller_source_item.source | default(('scm' if controller_configuration_inventory_sources_enforce_defaults else omit), true) }}"
source_path: "{{ __controller_source_item.source_path | default(('' if controller_configuration_inventory_sources_enforce_defaults else omit), true) }}"
source_vars: "{{ __controller_source_item.source_vars | default(({} if controller_configuration_inventory_sources_enforce_defaults else omit), true) | regex_replace('[ ]{2,}', '') }}"
enabled_var: "{{ __controller_source_item.enabled_var | default(('' if controller_configuration_inventory_sources_enforce_defaults else omit), true) }}"
Expand Down Expand Up @@ -46,7 +46,6 @@
poll: 0
register: __inventory_source_job_async
changed_when: not __inventory_source_job_async.changed
when: __controller_source_item.source != "constructed"
vars:
__operation: "{{ operation_translate[__controller_source_item.state | default(controller_state) | default('present')] }}"
ansible_async_dir: '{{ controller_configuration_async_dir }}'
Expand Down
7 changes: 7 additions & 0 deletions tests/configs/inventory_sources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,11 @@ controller_inventory_sources:
- name: "Auto-created source for: test_constructed"
inventory: test_constructed
source: constructed
limit: localhost
source_vars:
plugin: constructed
use_vars_plugins: true # https://github.com/ansible/ansible/issues/75365
keyed_groups:
- key: some_var
separator: ""
...

0 comments on commit b601cf6

Please sign in to comment.