configuration_item_batch – Manage ServiceNow configuration items in batch mode

Create, update ServiceNow configuration items in batch mode.

For more information, refer to the ServiceNow configuration management documentation at https://docs.servicenow.com/bundle/paris-servicenow-platform/page/product/configuration-management/reference/cmdb-table-property-descriptions.html.

New in version 1.2.0.

Examples

- name: Update CMDB with some data
  servicenow.itsm.configuration_item_batch:
    sys_class_name: cmdb_ci_ec2_instance
    id_column_set: vm_inst_id
    dataset:
      - instance_id: 12345
        public_ip_address: 1.2.3.4
        tags:
          Name: my_name
      - instance_id: 54321
        public_ip_address: 4.3.2.1
        tags:
          Name: other_name
    map:
      vm_inst_id: instance_id
      ip_address: public_ip_address
      name: tags.Name

- name: Identify CMDB item using combination of two columns
  servicenow.itsm.configuration_item_batch:
    sys_class_name: cmdb_ci_server
    id_column_set:
      - name
      - ip_address
    dataset: "{{ input_data }}"
    map:
      name: tags.Name
      ip_address: private_ip_address

See Also

See also

  • modules/servicenow.itsm.configuration_item_module

  • modules/servicenow.itsm.configuration_item_info_module

Parameters

dataset (required)

List of dictionaries that will be used as a data source.

Each item in a list represents one CMDB item.

type: list
id_column_set (required)

Columns that should be used to identify an existing record that we need to update.

type: list
instance (optional)

ServiceNow instance information.

type: dict
client_id (optional)

ID of the client application used for OAuth authentication.

If not set, the value of the SN_CLIENT_ID environment variable will be used.

If provided, it requires client_secret.

type: str
client_secret (optional)

Secret associated with client_id. Used for OAuth authentication.

If not set, the value of the SN_CLIENT_SECRET environment variable will be used.

If provided, it requires client_id.

type: str
grant_type (optional)

Grant type used for OAuth authentication.

If not set, the value of the SN_GRANT_TYPE environment variable will be used.

type: str
default: password
choices: password, refresh_token
host (required)

The ServiceNow host name.

If not set, the value of the SN_HOST environment variable will be used.

type: str
password (optional)

Password used for authentication.

If not set, the value of the SN_PASSWORD environment variable will be used.

Required when using basic authentication or when grant_type=password.

type: str
refresh_token (optional)

Refresh token used for OAuth authentication.

If not set, the value of the SN_REFRESH_TOKEN environment variable will be used.

Required when grant_type=refresh_token.

type: str
timeout (optional)

Timeout in seconds for the connection with the ServiceNow instance.

If not set, the value of the SN_TIMEOUT environment variable will be used.

type: float
username (optional)

Username used for authentication.

If not set, the value of the SN_USERNAME environment variable will be used.

Required when using basic authentication or when grant_type=password.

type: str
map (required)

Transformation instructions on how to convert input data to CMDB items.

Keys represent the CMDB item column names and the values are Jinja expressions that extract the value from the source data.

Data is returned as string because ServiceNow API expect this

type: dict
sys_class_name (required)

Table name (configuration item type) that we would like to manipulate.

type: str