There is currently no integration of the servicenow inventory plugin into the AWX GUI or API. We are going to implement it as a Source from Project. Open a new project or use an existing suitable project.
Add collection servicenow.itsm, which will be needed for this project. To do this, add the following file to your project with the content:
--- # collections/requirements.yml collections: - servicenow.itsmCreate an inventory source file. It should be called now.yml and here is an example of its contents:
--- # inventories/now.yml plugin: servicenow.itsm.now columns: - os - name - ip_address - fqdn
Commit changes to the project and update it or set up a new project in AWX.
Create a new Credential Types, name it ServiceNow and fill the following details:
Input configuration ------------------- fields: - id: hosturl type: string label: hosturl - id: user type: string label: user - id: password type: string label: password secret: true required: - hosturl - user - password
Injector configuration ---------------------- env: SN_HOST: '{{ hosturl }}' SN_PASSWORD: '{{ password }}' SN_USERNAME: '{{ user }}'
Then, define a new credentials for your servicenow host.
The last step is to configure an inventory Source. Make it "Sourced from a Project", select Project and put inventories/now.yml as an "Inventory file". Use previously defined credential for this source.