Rename tests to test, use old directory name.

This commit is contained in:
Michael DeHaan 2014-02-20 19:11:15 -05:00
commit 2177b773c8
132 changed files with 0 additions and 0 deletions

View file

@ -0,0 +1,2 @@
[somegroup]
localhost

View file

@ -0,0 +1,4 @@
---
duck: quack
cow: moo
extguard: " '$favcolor' == 'blue' "

View file

@ -0,0 +1,95 @@
# order of groups, children, and vars is not signficant
# so this example mixes them up for maximum testing
[nc:children]
rtp
triangle
[eastcoast:children]
nc
florida
[us:children]
eastcoast
[redundantgroup]
rtp_a
[redundantgroup2]
rtp_a
[redundantgroup3:children]
rtp
[redundantgroup:vars]
rga=1
[redundantgroup2:vars]
rgb=2
[redundantgroup3:vars]
rgc=3
[nc:vars]
b=10000
c=10001
d=10002
e = 10003
f = 10004 != 10005
g = " g "
h = ' h '
i = ' i "
j = " j
[rtp]
rtp_a
rtp_b
rtp_c
[rtp:vars]
a=1
b=2
c=3
[triangle]
tri_a
tri_b
tri_c
[triangle:vars]
a=11
b=12
c=13
[florida]
orlando
miami
[florida:vars]
a=100
b=101
c=102
[eastcoast:vars]
b=100000
c=100001
d=100002
[us:vars]
c=1000000
[role1]
host[1:2]
[role2]
host[2:3]
[role3]
host[1:3:2]
[role4]
blade-[a:c]-[1:16]
blade-[d:z]-[01:16].example.com
blade-[1:10]-[1:16]
host-e-[10:16].example.net:1234

View file

@ -0,0 +1,6 @@
# Test that playbooks support YAML lists of hosts.
---
- hosts: [host1, host2, host3]
connection: local
tasks:
- action: command true

View file

@ -0,0 +1,2 @@
[test]
host[Z:T]

View file

@ -0,0 +1,2 @@
[test]
host[1:2][A:B]

View file

@ -0,0 +1,2 @@
[test]
host[001:10]

View file

@ -0,0 +1,2 @@
[test]
host[1:2:3:4]

View file

@ -0,0 +1,6 @@
[test]
[1:2].host
[A:B].host
[test2] # comment
[1:3].host

View file

@ -0,0 +1,2 @@
[test]
host[1:]

View file

@ -0,0 +1,41 @@
#!/usr/bin/env python
import json
import sys
from optparse import OptionParser
parser = OptionParser()
parser.add_option('-l', '--list', default=False, dest="list_hosts", action="store_true")
parser.add_option('-H', '--host', default=None, dest="host")
parser.add_option('-e', '--extra-vars', default=None, dest="extra")
options, args = parser.parse_args()
systems = {
"ungrouped": [ "jupiter", "saturn" ],
"greek": [ "zeus", "hera", "poseidon" ],
"norse": [ "thor", "odin", "loki" ],
"major-god": [ "zeus", "odin" ],
}
variables = {
"thor": {
"hammer": True
},
"zeus": {},
}
if options.list_hosts == True:
print json.dumps(systems)
sys.exit(0)
if options.host is not None:
if options.extra:
k,v = options.extra.split("=")
variables[options.host][k] = v
print json.dumps(variables[options.host])
sys.exit(0)
parser.print_help()
sys.exit(1)

View file

@ -0,0 +1,3 @@
zeus var_a=2
morpheus
thor

View file

@ -0,0 +1,6 @@
[greek]
zeus
morpheus
[norse]
thor

View file

@ -0,0 +1,6 @@
[major-god]
zeus var_a=1
thor
[minor-god]
morpheus

View file

@ -0,0 +1,8 @@
[major-god] # group with inline comments
zeus var_a="1#2" # host with inline comments and "#" in the var string
# A comment
thor
[minor-god] # group with inline comment and unbalanced quotes: ' "
morpheus # host with inline comments and unbalanced quotes: ' "
# A comment with unbalanced quotes: ' "

View file

@ -0,0 +1 @@
bob[000:142]

View file

@ -0,0 +1,2 @@
odin
thor

View file

@ -0,0 +1,22 @@
jupiter
saturn
thrudgelmir[:5]
[greek]
zeus
hera:3000
poseidon
cerberus[001:003]
cottus[99:100]
[norse]
thor
odin
loki
[egyptian]
Hotep-[a:c]
Bast[C:D]
[auth]
neptun auth="YWRtaW46YWRtaW4="