Skip to content

Commit a2ac6cb

Browse files
committed
Initial set of inventory file testing examples
1 parent 93b021d commit a2ac6cb

File tree

7 files changed

+55
-0
lines changed

7 files changed

+55
-0
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,10 @@
11
# Ansible-inventory-file-examples
22
Examples and counter-examples of Ansible inventory files
3+
4+
# Sources
5+
6+
Some of the examples in this repo are taken verbatim from documentation.
7+
Starting with the obvious place, Ansible documentation:
8+
9+
http://docs.ansible.com/ansible/intro_inventory.html
10+

not_valid/ini_errors.ini

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
mail.example.com
2+
3+
[unbalanced_bracket
4+
foo.example.com
5+
bar.example.com
6+
7+
[dbservers]
8+
one.example.com
9+
two.example.com
10+
three.example.com

not_valid/just_hello_world

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
hello_world

not_valid/just_hello_world.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
hello_world

valid/group_vars.ini

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[atlanta]
2+
host1
3+
host2
4+
5+
[raleigh]
6+
host2
7+
host3
8+
9+
[southeast:children]
10+
atlanta
11+
raleigh
12+
13+
[southeast:vars]
14+
some_server=foo.southeast.example.com
15+
halon_system_timeout=30
16+
self_destruct_countdown=60
17+
escape_pods=2
18+
19+
[usa:children]
20+
southeast
21+
northeast
22+
southwest
23+
northwest

valid/host_range_pattern.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[webservers]
2+
www[01:50].example.com

valid/no_ini_ext

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
mail.example.com
2+
3+
[webservers]
4+
foo.example.com
5+
bar.example.com
6+
7+
[dbservers]
8+
one.example.com
9+
two.example.com
10+
three.example.com

0 commit comments

Comments
 (0)