diff --git a/changelogs/fragments/checkmode.yml b/changelogs/fragments/checkmode.yml new file mode 100644 index 000000000..ce8b9255c --- /dev/null +++ b/changelogs/fragments/checkmode.yml @@ -0,0 +1,5 @@ +--- +minor_changes: + - added mandatory check to workflow launch name option + - added improvements to checkmod where it will run faster with the async tasks. In addition added an additional fail check at end of dispatch that will likely fail if dependencies are missing, as expected. +... \ No newline at end of file diff --git a/changelogs/fragments/constructed.yml b/changelogs/fragments/constructed.yml new file mode 100644 index 000000000..d444c2af7 --- /dev/null +++ b/changelogs/fragments/constructed.yml @@ -0,0 +1,4 @@ +--- +bugfixes: + - The role 'inventory_sources' will now skip when the source parameter is `constructed`. These sources are auto created and not meant to be edited. However they can still be synced with the inventory_source_update. +... diff --git a/roles/inventory_sources/README.md b/roles/inventory_sources/README.md index 0a9ba43d8..f225a517a 100644 --- a/roles/inventory_sources/README.md +++ b/roles/inventory_sources/README.md @@ -99,7 +99,7 @@ The role will strip the double space between the curly bracket in order to provi |`description`|`False`|no|The description to use for the inventory source.| |`inventory`|""|yes|Inventory the group should be made a member of.| |`organization`|""|no|Organization the inventory belongs to.| -|`source`|""|no|The source to use for this group.| +|`source`|""|no|The source to use for this group. If set to `constructed` this role will be skipped as they are not meant to be edited.| |`source_path`|""|no|For an SCM based inventory source, the source path points to the file within the repo to use as an inventory.| |`source_vars`|""|no|The variables or environment fields to apply to this source type.| |`enabled_var`|""|no|The variable to use to determine enabled state e.g., "status.power_state".| diff --git a/roles/inventory_sources/tasks/main.yml b/roles/inventory_sources/tasks/main.yml index 652e1053c..878beec5f 100644 --- a/roles/inventory_sources/tasks/main.yml +++ b/roles/inventory_sources/tasks/main.yml @@ -46,6 +46,7 @@ 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 }}' diff --git a/tests/configs/inventories.yml b/tests/configs/inventories.yml index e520b0c73..896103673 100644 --- a/tests/configs/inventories.yml +++ b/tests/configs/inventories.yml @@ -22,4 +22,9 @@ controller_inventories: description: created by Ansible Playbook kind: smart host_filter: "name__icontains=localhost" + - name: test_constructed + organization: Default + kind: constructed + input_inventories: + - localhost ... diff --git a/tests/configs/inventory_sources.yml b/tests/configs/inventory_sources.yml index 42a684172..cf0dbf448 100644 --- a/tests/configs/inventory_sources.yml +++ b/tests/configs/inventory_sources.yml @@ -40,5 +40,7 @@ controller_inventory_sources: organization: Satellite source: scm state: absent - # more options can be provided but for scm source we are using, we need only this much. + - name: "Auto-created source for: test_constructed" + inventory: test_constructed + source: constructed ...