rootchord
rootchord

Reputation: 1

Import ansible facts into servicenow cmdb

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?

Upvotes: 0

Views: 1285

Answers (1)

seanx820
seanx820

Reputation: 84

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

Upvotes: 1

Related Questions