ansible

package
v1.22.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 3, 2026 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Overview

Package ansible provides utilities for creating and managing Ansible inventories.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateAnsibleHostInventory

func CreateAnsibleHostInventory(inventoryDirPath, certFilePath, cloudService string, publicIPMap map[string]string, cloudConfigMap models.CloudConfig) error

CreateAnsibleHostInventory creates inventory file for ansible specifies the ip address of the cloud server and the corresponding ssh cert path for the cloud server

func GetAnsibleHostsFromInventory

func GetAnsibleHostsFromInventory(inventoryDirPath string) ([]string, error)

GetAnsibleHostsFromInventory gets alias of all hosts in an inventory file

func GetHostByNodeID

func GetHostByNodeID(nodeID string, inventoryDirPath string) (*models.Host, error)

GetHostByNodeID finds a host by its node ID from the inventory.

func GetHostMapfromAnsibleInventory

func GetHostMapfromAnsibleInventory(inventoryDirPath string) (map[string]*models.Host, error)

GetHostMapfromAnsibleInventory returns a map from node ID to host.

func GetInventoryFromAnsibleInventoryFile

func GetInventoryFromAnsibleInventoryFile(inventoryDirPath string) ([]*models.Host, error)

GetInventoryFromAnsibleInventoryFile reads hosts from an Ansible inventory file.

func UpdateInventoryHostPublicIP

func UpdateInventoryHostPublicIP(inventoryDirPath string, nodesWithDynamicIP map[string]string) error

UpdateInventoryHostPublicIP first maps existing ansible inventory host file content then it deletes the inventory file and regenerates a new ansible inventory file where it will fetch public IP of nodes without elastic IP and update its value in the new ansible inventory file

func WriteNodeConfigsToAnsibleInventory

func WriteNodeConfigsToAnsibleInventory(inventoryDirPath string, nc []models.NodeConfig) error

WriteNodeConfigsToAnsibleInventory writes node configs to ansible inventory file

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL