{{ summaryAnnouncement }}
{{ summaryHeading }}
{{ summaryValue }}
{{ summaryLine }}
{{ formatLabel }} {{ summaryBadge }} {{ values.group_count }} groups
Ansible inventory source and output controls
One host per line: alias,ansible_host,group_a|group_b,key=value key=value. Blank lines and # comments are ignored.
{{ sourceStatus || 'Drop one CSV or TXT file onto the textarea.' }}
Both built-in formats use the same host ledger; choose the artifact your repository already maintains.
Use the group name that playbooks and ad hoc commands will target.
Use a non-secret login name. Passwords, tokens, and vault material do not belong in this generator.
YAML output quotes values as strings. INI :vars entries are also treated as strings by Ansible.
Inventory inputs are valid.
INI uses [parent:children]; YAML nests the generated groups beneath children.
Sorting changes artifact order only; source line numbers remain stable in the Host Ledger.
Adds a generated-file note and the matching ansible-inventory --list command.
{{ include_header ? 'Enabled' : 'Disabled' }}
Leave off unless the inventory needs a visible placeholder for future primary-group variables.
{{ emit_empty_vars ? 'Enabled' : 'Disabled' }}
{{ sourceExportStatus }}
{{ values.inventory_text }}
{{ ledgerExportStatus }}
Aliasansible_hostGroupsHost variablesSource lineCopy
{{ row.alias }}{{ row.address }}{{ row.groups }}{{ row.variables || '—' }}{{ row.line }}
{{ chartExportStatus }}
{{ reviewExportStatus }}
LevelCheckDetailRecommendationCopy
{{ row.level }}{{ row.check }}{{ row.detail }}{{ row.recommendation }}

Introduction

Before a playbook can target managed machines, Ansible needs an inventory. The inventory gives each host a stable name, places related hosts into groups, and can attach connection or policy variables that playbooks use at runtime. A useful inventory describes how automation should reach and select systems without turning the file into a secret store.

The host alias is Ansible’s identity for a managed node. It may be the real hostname, but it can also be a short inventory name paired with ansible_host for the actual address. Groups then express useful slices such as role, location, environment, or platform. One host may belong to several groups, and a parent group may collect child groups for broader targeting.

ChoiceGood fitImportant tradeoff
INI inventorySmall, flat inventories that people edit directly.Inline host variables and :vars values do not share identical type interpretation.
YAML inventoryNested groups and structures that benefit from explicit hierarchy.Indentation is meaningful and must remain valid YAML.
Separate host_vars and group_varsLarger inventories or policy that changes independently of membership.More files, but clearer ownership and safer handling of vaulted values.

Inventory membership is not merely documentation. A typo can exclude a host from maintenance, include it in the wrong rollout, or apply variables at an unexpected scope. Meaningful group names and stable aliases make playbook targets easier to review before execution.

Connection usernames, ports, and platform selectors may belong in inventory. Passwords, tokens, and private keys generally do not. Sensitive values should move to Ansible Vault or another controlled secret source, and the finished inventory should always be parsed with ansible-inventory --list before use.

How to Use This Tool:

Prepare one host per line, then choose the artifact format already used by the target repository.

  1. Enter each host as alias,ansible_host,group_a|group_b,key=value key=value. Omit optional groups or variables when they are not needed; blank lines and comment lines are ignored.
  2. Choose INI or YAML, name the primary group, and add a non-secret default login user only when the hosts share one.
  3. Add primary-group variables and an optional parent group. Keep passwords, tokens, vault material, and private keys out of these fields.
  4. Read Validation review, correct every warning that affects typing, duplicated variables, or sensitive names, then run the displayed ansible-inventory -i … --list command on the saved artifact.

Interpreting Results:

Inventory source is the generated static inventory. The Host ledger is the clearest place to confirm each alias, address, group membership, variable set, and original row number. Group counts show membership breadth, not whether the groups are operationally correct.

A warning does not always make the artifact invalid. An empty group-variable set may be intentional. By contrast, an INI typing warning, a repeated variable key, or a sensitive-looking variable name deserves deliberate review. The parser keeps the last repeated key in its local scope, which can hide an earlier mistake.

A clean review still cannot contact hosts, resolve DNS, test credentials, load collections, or predict variable precedence across other inventory sources. The authoritative check is how Ansible parses the complete repository inventory.

Technical Details:

A static inventory maps unique aliases to addresses, variables, and one or more groups. Generation first builds a canonical host ledger, then emits either bracketed INI sections or nested YAML groups from that same ledger.

Transformation Core:

StageTransformationOutput effect
Read rowsParse up to four CSV fields, honoring doubled quotes and quoted commas; skip a recognized header, blank lines, and # comments.A maximum of 500 unique host rows.
Resolve identityUse the first field as alias and the second as address; an empty address falls back to the alias.ansible_host is emitted only when address and alias differ.
Build membershipAdd every host to the primary group and to each distinct extra group from the third field.Optional parent membership is emitted as :children in INI or nested children in YAML.
Attach variablesParse space-separated host key=value tokens and line-separated group variables; add ansible_user from the default user only when it is not already defined.Repeated keys keep the last value and produce a review warning.
SerializeQuote unsafe INI host values or serialize YAML values as quoted strings.The selected format is produced without changing the canonical ledger.

Rule Core:

  • Group and variable names must start with a letter or underscore and then contain only letters, numbers, and underscores.
  • Host aliases must be nonempty and cannot contain whitespace, brackets, #, or a colon. Duplicate aliases are rejected.
  • The parent group must differ from the primary group and cannot also appear among the generated child groups.
  • An unclosed CSV or variable quote, more than four CSV fields, an invalid variable token, or an address containing whitespace stops generation with a row-specific correction.

INI typing deserves special care. Ansible interprets inline host values with Python literal rules, while values in an INI :vars section are strings. This generator also quotes YAML values as strings. Apply explicit filters in playbooks when a value must become a number or Boolean, and verify the parsed value rather than trusting its visual spelling.

Security and Privacy Notes:

Host rows and generated inventory are processed in the browser. They can still reveal infrastructure names, network addresses, groups, usernames, and connection details when copied or downloaded, so treat the artifact according to the environment’s inventory policy.

Variable names ending in terms such as password, secret, token, or private key trigger a warning, but that scan is not exhaustive. Do not rely on it to find every credential. Store sensitive values in Ansible Vault or an approved secret manager and keep cleartext secrets out of generated inventory.

Worked Example:

Three Linux hosts can share the primary group prod while the third field also assigns them to web or db. A row ending in ansible_port=2222 role=postgres gives only that host the nonstandard port and role. After YAML generation, inspect the ledger for group membership, then run ansible-inventory -i inventory.yaml --list to confirm that Ansible sees the expected host variables and hierarchy.

References: