From 6dc2a6ce8b8ac47f1527047d797fec2a789f73e0 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Tue, 23 May 2017 22:52:48 -0400 Subject: [PATCH] fixed docs for host list examples --- .../plugins/inventory/advanced_host_list.py | 10 +++++----- lib/ansible/plugins/inventory/host_list.py | 14 +++++++------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/ansible/plugins/inventory/advanced_host_list.py b/lib/ansible/plugins/inventory/advanced_host_list.py index 55fd0f44d0a..b1a2f437f6c 100644 --- a/lib/ansible/plugins/inventory/advanced_host_list.py +++ b/lib/ansible/plugins/inventory/advanced_host_list.py @@ -23,12 +23,12 @@ DOCUMENTATION: description: - Parses a host list string as a comma separated values of hosts and supports host ranges. - This plugin only applies to inventory sources that are not paths and contain at least one comma. -EXAMPLES: -# simple range -ansible -i 'host[1:10],' -m ping +EXAMPLES: | + # simple range + ansible -i 'host[1:10],' -m ping -# still supports w/o ranges also -ansible-playbook -i 'localhost,' play.yml + # still supports w/o ranges also + ansible-playbook -i 'localhost,' play.yml ''' from __future__ import (absolute_import, division, print_function) diff --git a/lib/ansible/plugins/inventory/host_list.py b/lib/ansible/plugins/inventory/host_list.py index 9ea11f003cb..a690149ce94 100644 --- a/lib/ansible/plugins/inventory/host_list.py +++ b/lib/ansible/plugins/inventory/host_list.py @@ -14,7 +14,7 @@ # # You should have received a copy of the GNU General Public License # along with Ansible. If not, see . -''' +r''' DOCUMENTATION: inventory: host_list version_added: "2.4" @@ -23,14 +23,14 @@ DOCUMENTATION: - Parses a host list string as a comma separated values of hosts - This plugin only applies to inventory strings that are not paths and contain a comma. EXAMPLES: | -# define 2 hosts in command line -ansible -i '10.10.2.6, 10.10.2.4' -m ping all + # define 2 hosts in command line + ansible -i '10.10.2.6, 10.10.2.4' -m ping all -# DNS resolvable names -ansible -i 'host1.example.com, host2' -m user -a 'name=me state=abset' all + # DNS resolvable names + ansible -i 'host1.example.com, host2' -m user -a 'name=me state=abset' all -# just use localhost -ansible-playbook -i 'localhost,' play.yml -c local + # just use localhost + ansible-playbook -i 'localhost,' play.yml -c local ''' from __future__ import (absolute_import, division, print_function)