ansible-inventory

gendall/ansible-inventory/local

Terraform Module HCL LOCAL

Terraform module to create an Ansible Inventory file from a list of server IPs

Install
module "ansible-inventory" {
source = "gendall/ansible-inventory/local"
version = "0.3.0"
}
plain text: /constructs/tfmod-gendall-ansible-inventory-local/install.txt
⭐ Source on GitHub 📦 Registry page
README

Local Ansible Inventory A Terraform module that will render groups of server IP addresses into an Ansible inventory file and output it to the local filesystem at a specified location. The module will also take arbitrary secrets (certificates, tokens, keys, etc.) and write them to files in a subdirectory of the output path. Usage ``hcl provider "local" { version = "~> 1.3" } module "inventory_production" { source = "gendall/ansible-inventory/local" servers = { manager = ["1.2.3.4"] worker = ["11.22.33.44", "55.66.77.88"] } secrets = { tls_key = "-----BEGIN RSA PRIVATE KEY----- MIIEow..." tls_cert = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD..." } output = "inventory/production" } `` Deployment This role will be automatically built and deployed to Terraform Registry when a Semver tag is pushed

Inputs (4)
NameTypeDescriptionDefault
outputstringThe path to use when saving the rendered inventory file. required
serversmapA map of inventory group names to IP addresses.{}
secretsmapA map of secret key value pairs to be injected as Docker secrets.{}
hostnamestringA fully qualified domain name that will be passed to the Docker Swarm as the env""
Resources (1)
local_file
Topics & Tags
terraform
Details
FrameworkTerraform Module
LanguageHCL
Version0.3.0
Cloud LOCAL
★ Stars0
Forks3
Total downloads2.2k
Inputs4
Resources1
Namespacegendall
Updated