Modules modules
Creates, Updates or Deletes a node of a given Kind in Infrahub through Infrahub SDK
Parameters
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
api_endpoint | str | Yes | Endpoint of the Infrahub API, optional env=INFRAHUB_ADDRESS | |
token | str | Yes | The API token created through Infrahub, optional env=INFRAHUB_API_TOKEN | |
timeout | int | No | 10 | Timeout for Infrahub requests in seconds |
kind | str | Yes | Kind of node to create | |
data | raw | Yes | Dictionary of node attributes | |
branch | str | No | main | Branch in which the request is made |
validate_certs | bool | No | True | Whether or not to validate SSL of the Infrahub instance |
state | str | No | present | Use 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
Key | Type | Description |
---|---|---|
object | dict | Serialized object as created or already existent within Infrahub |
msg | str | Message indicating failure or info about what has been achieved |