add_host
Collection: builtin
Full Name: add_host
Controller module — runs on the local controller, not on remote hosts.
Synopsis
Add a host to the in-memory inventory during a play
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| name | string | yes | The hostname/IP of the host to add to the inventory | |
| groups | list | The groups to add the hostname to | ||
| group | string | Alias for groups (for backward compatibility) |
Example
- name: Register the newly provisioned host
add_host:
name: "{{ new_instance_ip }}"
groups: webservers