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

How to pass variables to servicenow.yml? #74

Open
nsandhu-godaddy opened this issue Aug 4, 2022 · 1 comment
Open

How to pass variables to servicenow.yml? #74

nsandhu-godaddy opened this issue Aug 4, 2022 · 1 comment

Comments

@nsandhu-godaddy
Copy link

Hi,

I was able to get this to work following the instructions here.

However, I was wondering if there was a way to pass variables into serivcenow.yml file. I would like to set the filter_results field to a variable, something like this:

lugin: servicenow.servicenow.now
table: cmdb_ci_linux_server
selection_order: name
fields: [ip_address,fqdn,name,location.name,u_cmdb_ci_service.name]
filter_results: "{{ servicenow_filter_results | default('install_status=1^nameCONTAINSstuff') }}"
keyed_groups:
  - key: location.name | lower
    prefix: ''
    separator: ''
  - key: u_cmdb_ci_service.name | lower
    prefix: ''
    separator: ''

In AWX, I configured the Inventory Source to have a Source variable servicenow_filter_results set to a different filter criteria.

@nsandhu-godaddy
Copy link
Author

nsandhu-godaddy commented Aug 4, 2022

And while I have your attention, how can I lowercase one of the fields, like name?
These didn't work, atleast over curl:

fields: [ip_address,fqdn,name|lower,location.name,u_cmdb_ci_service.name]
fields: [ip_address,fqdn,LCASE(name),location.name,u_cmdb_ci_service.name]

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

No branches or pull requests

1 participant