Import ansible facts into servicenow cmdb

1.1k Views Asked by At

I'm trying to determine if it's possible to populate our servicenow CMDB with Ansible facts gathered from our Ansible Tower instance. I can find a lot of documentation on pulling inventory FROM CMDB, or for using Ansible to create incidents, but nothing on updating CI objects based on gathered facts. Is this possible?

1

There are 1 best solutions below

0
On

check out this repo, https://github.com/michaelford85/ansible-servicenow-exercises

especially the Ansible Playbook-> snow-table-fields.yml

  - name: Retrieve fields for a table {{ snow_table }}
    snow_record:
      state: present
      table: "{{ snow_table }}"
      data:
        name: delete_this_record
      username: "{{ SN_USERNAME }}"
      password: "{{ SN_PASSWORD }}"
      instance: "{{ SN_INSTANCE }}"
    register: table_output

where {{snow_table}} can be something like cmdb_ci_linux_server