Commit Graph

14 Commits (9c09dc3ef81d4f40e25c3546c2945b4d2ad92532)

Author SHA1 Message Date
Abhijit Menon-Sen 065bb52109 Be systematic about parsing and validating hostnames and addresses
This adds a parse_address(pattern) utility function that returns
(host,port), and uses it wherever where we accept IPv4 and IPv6
addresses and hostnames (or host patterns): the inventory parser
the the add_host action plugin.

It also introduces a more extensive set of unit tests that supersedes
the old add_host unit tests (which didn't actually test add_host, but
only the parsing function).
2015-09-11 21:47:18 +05:30
Abhijit Menon-Sen 7d9689c1c5 Slice ascii_letters directly instead of using 'for x in range()' 2015-08-02 23:47:18 +05:30
Abhijit Menon-Sen bfe708a189 Make host range parsing errors issue better messages
Now we always say "host range must …specific thing…"
2015-08-02 23:47:18 +05:30
Abhijit Menon-Sen 1413496292 Implement step for alphabetic ranges: [a:e:2] => a,c,e 2015-08-02 23:47:18 +05:30
James Cammarata ce3ef7f4c1 Making the switch to v2 2015-05-03 21:47:26 -05:00
Christian Berendt 6676720ce5 fixed typos found by RETF rules in PY files
rules are avaialble at https://en.wikipedia.org/wiki/Wikipedia:AutoWikiBrowser/Typos
2014-05-03 18:40:05 +02:00
Cristian Ciupitu a7da5d8702 Micro-optimization of inventory.expand_hosts.detect_range 2014-03-16 13:10:28 -04:00
Martynas Mickevicius 44279ce34f Allow leading ranges in the inventory host entries. 2013-10-17 13:16:35 +03:00
Simon J Mudd 25822330a2 Add support for multiple ranges in a host
e.g.  db[01:10:3]node-[01:10]

- to do this we split off at the first [...] set, getting the list
  of hosts and then repeat until none left.
- also add an optional third parameter which contains the step. (Default: 1)
  so range can be [01:10:2] -> 01 03 05 07 09
2013-06-06 22:27:30 +02:00
Norman J. Harman Jr 6603737e4d Alphabetic inventory hostname patterns.
- Code, docs, tests.
  - Also added test of large range 000-142 to verify alpha range did not
    break this.
2012-12-10 20:48:38 -06:00
Michael DeHaan faed4b5a33 whitespace + remove deprecated YAML parser (migration script lives in examples/scripts and warning was added
in 0.6 release)
2012-08-06 20:07:02 -04:00
Michael DeHaan 82cca242e3 use AnsibleError so that if there is an error it does not print a traceback 2012-07-24 20:16:35 -04:00
Michael DeHaan 8fa4dc3920 Small change to previous patch, make ranges of hosts inclusive. 2012-07-24 20:10:05 -04:00
Chin Fang 5315dd146d Added lib/ansible/inventory/expand_hosts.py 2012-07-24 12:43:35 -07:00