Lemano and Ansible
If you manage your servers with Ansible, Lemano works from what you already have: your inventory, your playbooks and your roles. This page says what the integration is and which command fits which task; each guide it links to has the details.
What the integration is
lemano ansible ..., a program of its own,lemano-ansible, installed in the same folder aslemanoand released with it.lemanoitself knows nothing of Ansible. Your inventory is read by Ansible’s ownansible-inventory, so dynamic inventories, plugins, group and host variables and vault work as they do for your playbooks; Lemano has no inventory parser of its own.The
lemano.lemanocollection, with one callback plugin,record. Enabled inansible.cfg, it records everyansible-playbookrun, and prints a comparison after the recap of a run in check mode. Recording,lemano ansible checkandlemano ansible codifyneed it; the other commands do not. The Install page says how to build and install it and which ansible-core versions it asks for. Then enable it inansible.cfg:[defaults] callbacks_enabled = lemano.lemano.record
Your playbooks and roles stay as they are: nothing is added to them. The plugin is not a stdout callback, so Ansible’s output does not change.
Which command for which task
In the order you are likely to meet them:
| You want to | Command | Guide |
|---|---|---|
| Turn the hosts of an inventory into targets | lemano ansible import | Importing an Ansible inventory |
| Record what each playbook run changed | the record callback | Recording Ansible runs |
| Read the inventory’s hosts between runs, from a timer | lemano ansible discover | Scheduling |
| See what a playbook would change, and what no role manages | lemano ansible check | Checking servers against your roles |
| Make your roles describe a fix made by hand | lemano ansible codify | Keeping your roles true to your servers |
| Write a server as a new Ansible project | lemano ansible export | Bringing servers under Ansible |
| Undo a change on a host of the inventory | lemano ansible revert, lemano ansible end-trial | Undoing a run |
discover, revert and end-trial reach a host through the inventory’s
own settings, with no target file to keep, and are otherwise exactly
lemano discover, lemano revert and lemano target end-trial.
If the inventory has vaulted values, give --vault-password-file FILE,
--vault-id or -J (ask once): every Ansible process below the command
uses it, including the one that reads a login or sudo password kept in
the vault. A later plain lemano discover, or a timer, uses the vault
password of ansible.cfg (vault_password_file) or
ANSIBLE_VAULT_PASSWORD_FILE, as your playbooks do. A relative path in
vault_identity_list is read from the folder Ansible runs in, so give
full paths there for a timer.
What Lemano never does
- It never fails a playbook: an error while recording becomes a warning, and the end of the run names each host that was not recorded and why.
- A check stops before running a task that would change a host in check
mode (
check_mode: false) or that it cannot inspect, unless you allow it with--allow-unsafe-tasks. codifynever edits your roles without your approval: it prints the edits, writes them as a patch, or edits in place after you typeyes. It never edits a role installed from Galaxy or a collection, and never runs a version control command.exportnever writes a file that may hold a secret in plain text, and never exports account passwords.- A password the inventory sets is asked of Ansible when Lemano connects, and never stored.