Skip to content

Satellite 6 inventory_source host_filters incorrectly quoted #1841

@snehald12

Description

@snehald12
SUMMARY

Using ansible.controller.inventory_source against Satellite 6 the resulting host_filter is incorrectly quoted.

When using ansible.controller.inventory_source against Satellite 6 the resulting host_filter is incorrectly quoted.

For example:

    ansible.controller.inventory_source:
      credential: "My Satellite"
      overwrite: True
      update_on_launch: True
      organization: "{{ org }}"
      source: satellite6
      source_vars:
        group_prefix: satellite6_
        host_filters: >-
          organization="My Org" and
          (hostgroup_title="hg-683/rhel8/remote" or
          hostgroup_title="hg-683/rhel8/local" or
          hostgroup_title="hg-683/rhel9/remote" or
          hostgroup_title="hg-683/rhel9/local")

Results in

{
  "group_prefix": "satellite6_",
  "host_filters": "organization=\"My Org\" and (hostgroup_title=\"hg-683/rhel8/remote\" or hostgroup_title=\"hg-683/rhel8/local\" or hostgroup_title=\"hg-683/rhel9/remote\" or hostgroup_title=\"hg-683/rhel9/local\")",
}

But should be

{
  "group_prefix": "satellite6_",
  "host_filters": organization="My Org" and (hostgroup_title="hg-683/rhel8/remote" or hostgroup_title="hg-683/rhel8/local" or hostgroup_title="hg-683/rhel9/remote" or hostgroup_title="hg-683/rhel9/local"),
}
ISSUE TYPE
  • Bug Report
ANSIBLE VERSION

AAP 2.4
Ansible Core 2.14


##### COLLECTION VERSION
ansible.controller              4.5.15 


STEPS TO REPRODUCE
  ansible.controller.inventory_source:
      credential: "My Satellite"
      overwrite: True
      update_on_launch: True
      organization: "{{ org }}"
      source: satellite6
      source_vars:
        group_prefix: satellite6_
        host_filters: >-
          organization="My Org" and
          (hostgroup_title="hg-683/rhel8/remote" or
          hostgroup_title="hg-683/rhel8/local" or
          hostgroup_title="hg-683/rhel9/remote" or
          hostgroup_title="hg-683/rhel9/local")

##### EXPECTED RESULTS:
~~~
{
  "group_prefix": "satellite6_",
  "host_filters": organization="My Org" and (hostgroup_title="hg-683/rhel8/remote" or hostgroup_title="hg-683/rhel8/local" or hostgroup_title="hg-683/rhel9/remote" or hostgroup_title="hg-683/rhel9/local"),
}
~~~

##### ACTUAL RESULTS:

~~~
{
  "group_prefix": "satellite6_",
  "host_filters": "organization=\"My Org\" and (hostgroup_title=\"hg-683/rhel8/remote\" or hostgroup_title=\"hg-683/rhel8/local\" or hostgroup_title=\"hg-683/rhel9/remote\" or hostgroup_title=\"hg-683/rhel9/local\")",
}
~~~

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions