mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-24 13:50:22 -07:00
add_hosts.py: Fix add_host does not recognise 'host' alias (#27418)
* add_hosts.py: Fix add_host does not recognise 'host' alias * add_hosts.py: add note in documentation that 'hosts' alias of name parameter is only available on >=2.4
This commit is contained in:
parent
e241e15899
commit
7cfd02097c
2 changed files with 2 additions and 1 deletions
|
@ -44,6 +44,7 @@ notes:
|
||||||
- This module bypasses the play host loop and only runs once for all the hosts in the play, if you need it
|
- 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.
|
to iterate use a with\_ directive.
|
||||||
- This module is also supported for Windows targets.
|
- This module is also supported for Windows targets.
|
||||||
|
- The alias 'host' of the parameter 'name' is only available on >=2.4
|
||||||
author:
|
author:
|
||||||
- "Ansible Core Team"
|
- "Ansible Core Team"
|
||||||
- "Seth Vidal"
|
- "Seth Vidal"
|
||||||
|
|
|
@ -46,7 +46,7 @@ class ActionModule(ActionBase):
|
||||||
result = super(ActionModule, self).run(tmp, task_vars)
|
result = super(ActionModule, self).run(tmp, task_vars)
|
||||||
|
|
||||||
# Parse out any hostname:port patterns
|
# Parse out any hostname:port patterns
|
||||||
new_name = self._task.args.get('name', self._task.args.get('hostname', None))
|
new_name = self._task.args.get('name', self._task.args.get('hostname', self._task.args.get('host', None)))
|
||||||
display.vv("creating host via 'add_host': hostname=%s" % new_name)
|
display.vv("creating host via 'add_host': hostname=%s" % new_name)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue