Skip to main content

Modules modules

Creates, Updates or Deletes a node of a given Kind in Infrahub through Infrahub SDK

Parameters

ParameterTypeRequiredDefaultDescription
api_endpointstrYesEndpoint of the Infrahub API, optional env=INFRAHUB_ADDRESS
tokenstrYesThe API token created through Infrahub, optional env=INFRAHUB_API_TOKEN
timeoutintNo10Timeout for Infrahub requests in seconds
kindstrYesKind of node to create
datarawYesDictionary of node attributes
branchstrNomainBranch in which the request is made
validate_certsboolNoTrueWhether or not to validate SSL of the Infrahub instance
statestrNopresentUse C(present) or C(absent) for adding or removing.

Examples

---
- name: Infrahub playbook for opsmill.infrahub.node
gather_facts: false
hosts: localhost

tasks:
- name: Create tag1
opsmill.infrahub.node:
kind: "BuiltinTag"
data:
name: "tag1"
state: present

- name: Delete tag1
opsmill.infrahub.node:
kind: "BuiltinTag"
data:
name: "tag1"
state: absent

Return values

KeyTypeDescription
objectdictSerialized object as created or already existent within Infrahub
msgstrMessage indicating failure or info about what has been achieved