Skip to main content

Modules modules

Creates, Updates or Deletes a branch (InrahubBranch) 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
namestrYesName of the branch to create
sync_with_gitboolNoFalseWhether to sync the branch with git
descriptionstrNoDescription of the branch
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.branch
gather_facts: false
hosts: localhost

tasks:
- name: Create a Branch 'test'
opsmill.infrahub.branch:
name: "test"
sync_with_git: false
description: "This is a test branch"
state: present

- name: Delete a Branch 'test'
opsmill.infrahub.branch:
name: "test"
state: absent

Return values

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