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

Smart Inventory Filter Key That Contains a Dot #6203

Closed
jmarci opened this issue Mar 6, 2020 · 4 comments
Closed

Smart Inventory Filter Key That Contains a Dot #6203

jmarci opened this issue Mar 6, 2020 · 4 comments

Comments

@jmarci
Copy link

jmarci commented Mar 6, 2020

ISSUE TYPE

Smart Inventory Filter

SUMMARY

Issues building a Smart Inventory with a key that contains a dot(.).

ENVIRONMENT
  • AWX version: 8.0.0
  • AWX docker
  • Ansible version: 2.8.8
  • Operating System: CentOS
  • Web Browser: Chrome
STEPS TO REPRODUCE

Gathering services with service_facts module

  • name: populate service facts
    service_facts:
    },
    "docker.service": {
    "name": "docker.service",
    "state": "running",
    "source": "systemd",
    "status": "enabled"
    },

  • debug:
    var: ansible_facts.services['docker.service'].state

TASK [debug] *****************************************************************************************************************************************************************************************************
ok: [awx] => {
"ansible_facts.services['docker.service'].state": "running"
}

Attempting to build Smart Inventory filter with following on service(s) key that contains a dot(.).
ansible_facts.services['docker.service'].state:running

EXPECTED RESULTS

Functioning filter.

ACTUAL RESULTS

Filter not functioning.

@jmarci jmarci changed the title Smart Inventory Key That Contains a Dot Smart Inventory Filter Key That Contains a Dot Mar 6, 2020
@ryanpetrello
Copy link
Contributor

@chrismeyersfsu is there some workaround syntax for this? I thought I remembered there being one, but I can't find any docs that call it out.

@kedark3
Copy link

kedark3 commented Mar 31, 2020

@blomquisg KK here, we'd like to know if there's a fix/workaround too :)

@joppino
Copy link

joppino commented Nov 3, 2021

You can specify dots by using the urlencode syntax, so:

ansible_facts.services.docker%2Eservice.state.running

will work and create a filter that will be shown with the dot in the name.

@TheRealHaoLiu
Copy link
Member

Smart inventories is deprecated in favor of constructed inventory

Check it out #13303

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants