Skip to main content

Module inventory

Module inventory 

Source
Expand description

The one Ansible inventory, rendered from a planned Environment for every target that runs playbooks: the controller’s /etc/isoloom/inventory.ini on Vagrant, Proxmox and the clouds, and .isoloom/external/inventory.ini on the external target.

What is the same everywhere lives here: which machines are hosts (hosts), the linux and windows groups, each host’s ansible_host and its host_vars, ansible_become on Linux, and the inventory groups (provision[].groups, then the spec’s groups:, members limited to the hosts). What differs per target is how a host is reached (users, keys, passwords, WinRM or SSH on Windows), which the target says with an Access. The presets (Access::vagrant, Access::proxmox, Access::cloud, Access::external) are the targets’ own.

[linux]
<host> ansible_host=<address> <Access::host vars> <host_vars>

[windows]
<host> ansible_host=<address> <Access::host vars> <host_vars>

[linux:vars]
<Access::linux>
ansible_become=true

[windows:vars]          when a Windows host exists and the access sets Windows variables
<Access::windows>

[<group>]               each inventory group: its members that are hosts here
<host>

A backend calls inventory::render(env, &Access::vagrant()) and writes the text where its controller (or the user) runs Ansible; a header, if the file has one, is the caller’s.

Structs§

Access
How a target reaches its hosts.
Host
One host of the inventory: a machine Ansible reaches on this target.

Enums§

WinrmAuth
How WinRM authenticates over plain HTTP: Basic where the image allows it, NTLM where it doesn’t (Azure’s Windows images).

Constants§

CONTROLLER_KEY
The controller’s own private key, which every Linux VM it provisions trusts.

Functions§

host_value
A value on a host line: Ansible splits the line like a shell, so a value with a space, a quote or a comment character is single-quoted; a plain one is written as is.
host_vars_suffix
The host_vars of one machine as key='value' pairs, the way its inventory line ends.
hosts
The machines Ansible reaches on the environment’s target, in spec order: on external, the existing hosts (at their external address); elsewhere, the VMs (at their first address).
python_literal
A value as a Python literal, which is how Ansible reads a host line’s values: a string quoted (so "10" stays a string), True, False and None, lists and dicts as Python spells them.
render
The inventory of env, its hosts reached as access says.
winrm_vars
The WinRM port, scheme and transport of a Windows machine that answers winrm that way.

Type Aliases§

Vars
Variables, in the order they are written.