diff options
author | René Moser <mail@renemoser.net> | 2016-10-21 08:46:59 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-21 08:46:59 +0200 |
commit | 2cb41ce880f26df7eafe691c8c492df9c27b9e80 (patch) | |
tree | 8187f7943fa759146412efab69d422769505f602 | |
parent | 7cfe6df92e8c73877b127f30ddff29b86ef74b8f (diff) | |
download | ansible-modules-core-2cb41ce880f26df7eafe691c8c492df9c27b9e80.tar.gz |
doc: add_host: add example without deprecated vars (#5323)
ansible_ssh_* are deprecated since 2.0
-rw-r--r-- | inventory/add_host.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/inventory/add_host.py b/inventory/add_host.py index ef01ed10..d2873e28 100644 --- a/inventory/add_host.py +++ b/inventory/add_host.py @@ -37,7 +37,7 @@ options: notes: - This module bypasses the play host loop and only runs once for all the hosts in the play, if you need it to iterate use a with\_ directive. -author: +author: - "Ansible Core Team" - "Seth Vidal" ''' @@ -49,8 +49,13 @@ EXAMPLES = ''' # add a host with a non-standard port local to your machines - add_host: name={{ new_ip }}:{{ new_port }} -# add a host alias that we reach through a tunnel +# add a host alias that we reach through a tunnel (Ansible <= 1.9) - add_host: hostname={{ new_ip }} ansible_ssh_host={{ inventory_hostname }} ansible_ssh_port={{ new_port }} + +# add a host alias that we reach through a tunnel (Ansible >= 2.0) +- add_host: hostname={{ new_ip }} + ansible_host={{ inventory_hostname }} + ansible_port={{ new_port }} ''' |