Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
8bc1b69c
Commit
8bc1b69c
authored
Dec 02, 2012
by
Gregory Duchatelet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a unit test to subset limiting via a regex, and some doc in man
page.
parent
dde01dab
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
0 deletions
+13
-0
docs/man/man1/ansible.1
+5
-0
test/TestInventory.py
+8
-0
No files found.
docs/man/man1/ansible.1
View file @
8bc1b69c
...
...
@@ -156,6 +156,11 @@ is mostly useful for crontab or kickstarts\&.
.RS 4
Further limits the selected host/group patterns\&.
.RE
.PP
\fB\-l\fR \fI~REGEX\fR, \fB\-\-limit=\fR\fI~REGEX\fR
.RS 4
Further limits hosts with a regex pattern\&.
.RE
.SH "INVENTORY"
.sp
Ansible stores the hosts it can potentially operate on in an inventory file\&. The syntax is one host per line\&. Groups headers are allowed and are included on their own line, enclosed in square brackets that start the line\&.
...
...
test/TestInventory.py
View file @
8bc1b69c
...
...
@@ -158,6 +158,14 @@ class TestInventory(unittest.TestCase):
print
"EXPECTED=
%
s"
%
sorted
(
expected_hosts
)
assert
sorted
(
hosts
)
==
sorted
(
expected_hosts
)
def
test_regex_exclude
(
self
):
inventory
=
self
.
complex_inventory
()
hosts
=
inventory
.
list_hosts
(
"~rtp_[ac]"
)
expected_hosts
=
[
'rtp_a'
,
'rtp_c'
]
print
"HOSTS=
%
s"
%
sorted
(
hosts
)
print
"EXPECTED=
%
s"
%
sorted
(
expected_hosts
)
assert
sorted
(
hosts
)
==
sorted
(
expected_hosts
)
def
test_complex_enumeration
(
self
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment