Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Satellite 6 inventory_source host_filters incorrectly quoted #15551

Open
5 of 11 tasks
coec opened this issue Sep 26, 2024 · 0 comments
Open
5 of 11 tasks

Satellite 6 inventory_source host_filters incorrectly quoted #15551

coec opened this issue Sep 26, 2024 · 0 comments
Labels
community component:awx_collection issues related to the collection for controlling AWX needs_triage type:bug

Comments

@coec
Copy link

coec commented Sep 26, 2024

Please confirm the following

  • I agree to follow this project's code of conduct.
  • I have checked the current issues for duplicates.
  • I understand that AWX is open source software provided for free and that I might not receive a timely response.
  • I am NOT reporting a (potential) security vulnerability. (These should be emailed to [email protected] instead.)

Bug Summary

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"),
}

AWX version

AAP v2.4

Select the relevant components

  • UI
  • UI (tech preview)
  • API
  • Docs
  • Collection
  • CLI
  • Other

Installation method

N/A

Modifications

no

Ansible version

Ansible Core 2.14

Operating system

RHEL9

Web browser

No response

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\")",
}

Additional information

No response

@github-actions github-actions bot added component:awx_collection issues related to the collection for controlling AWX needs_triage type:bug community labels Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community component:awx_collection issues related to the collection for controlling AWX needs_triage type:bug
Projects
None yet
Development

No branches or pull requests

1 participant