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
1c9b43df
Commit
1c9b43df
authored
Aug 06, 2012
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more whitespace
parent
faed4b5a
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
34 additions
and
34 deletions
+34
-34
CHANGELOG.md
+3
-3
README.md
+4
-4
setup.py
+1
-1
test/TestInventory.py
+12
-12
test/TestPlayBook.py
+10
-10
test/playbook1.yml
+4
-4
No files found.
CHANGELOG.md
View file @
1c9b43df
...
...
@@ -9,7 +9,7 @@ Ansible Changes By Release
playbooks:
*
support to tag tasks and includes and use --tags in playbook CLI
*
support to tag tasks and includes and use --tags in playbook CLI
*
playbooks can now include other playbooks (example/playbooks/nested_playbooks.yml)
*
vars_files now usable with with_items, provided file paths don't contain host specific facts
*
error reporting if with_items value is unbound
...
...
@@ -50,7 +50,7 @@ modules:
*
setup module fixes if no ipv6 support
*
internals: template in common module boilerplate, also causes less SSH operations when used
*
git module fixes
*
setup module overhaul, more modular
*
setup module overhaul, more modular
*
minor caching logic added to inventory to reduce hammering of inventory scripts.
*
MySQL and PostgreSQL modules for user and db management
*
vars_prompt now supports private password entry (see examples/playbooks/prompts.yml)
...
...
@@ -177,7 +177,7 @@ in kickstarts
*
better module debugging with -D
*
fetch module for pulling in files from remote hosts
*
command task supports creates=foo for idempotent semantics, won't
run if file foo already exists
run if file foo already exists
0.
0.2 and 0.0.1
...
...
README.md
View file @
1c9b43df
Ansible
=======
Ansible is a radically simple configuration-management, deployment, task-execution, and
multinode orchestration framework.
Ansible is a radically simple configuration-management, deployment, task-execution, and
multinode orchestration framework.
Read the documentation at http://ansible.github.com
...
...
@@ -30,7 +30,7 @@ Branch Info
*
Releases are named after Van Halen songs.
*
The master branch corresponds to release 0.5 "Amsterdam".
*
The devel branch corresponds to release 0.6 "Cabo".
*
All feature work happens on the development branch.
*
All feature work happens on the development branch.
*
Major bug fixes will be made to the master branch, but not minor ones.
*
See CHANGELOG.md for release notes to track each release.
...
...
@@ -48,7 +48,7 @@ Contributions to the core and modules are greatly welcome.
*
Fixing bugs instead of sending bug reports.
*
Using squash merges
*
Updating the "rst/
*
" files in the docs project and "docs/" manpage content
*
Adding more unit tests
*
Adding more unit tests
*
Avoid:
*
Sending patches to the mailing list directly.
*
Sending feature pull requests to the 'master' branch instead of the devel branch
...
...
setup.py
View file @
1c9b43df
#!/usr/bin/env python
# NOTE: setup.py does NOT install the contents of the library dir
# for you, you should go through "make install" or "make RPMs"
# for you, you should go through "make install" or "make RPMs"
# for that, or manually copy modules over.
import
os
...
...
test/TestInventory.py
View file @
1c9b43df
...
...
@@ -44,11 +44,11 @@ class TestInventory(unittest.TestCase):
inventory
=
self
.
simple_inventory
()
hosts
=
inventory
.
list_hosts
()
expected_hosts
=
[
'jupiter'
,
'saturn'
,
'zeus'
,
'hera'
,
expected_hosts
=
[
'jupiter'
,
'saturn'
,
'zeus'
,
'hera'
,
'cerberus001'
,
'cerberus002'
,
'cerberus003'
,
'cottus99'
,
'cottus100'
,
'poseidon'
,
'thor'
,
'odin'
,
'loki'
,
'thrudgelmir0'
,
'thrudgelmir1'
,
'thrudgelmir2'
,
'thrudgelmir0'
,
'thrudgelmir1'
,
'thrudgelmir2'
,
'thrudgelmir3'
,
'thrudgelmir4'
,
'thrudgelmir5'
]
assert
sorted
(
hosts
)
==
sorted
(
expected_hosts
)
...
...
@@ -56,11 +56,11 @@ class TestInventory(unittest.TestCase):
inventory
=
self
.
simple_inventory
()
hosts
=
inventory
.
list_hosts
(
'all'
)
expected_hosts
=
[
'jupiter'
,
'saturn'
,
'zeus'
,
'hera'
,
expected_hosts
=
[
'jupiter'
,
'saturn'
,
'zeus'
,
'hera'
,
'cerberus001'
,
'cerberus002'
,
'cerberus003'
,
'cottus99'
,
'cottus100'
,
'poseidon'
,
'thor'
,
'odin'
,
'loki'
,
'thrudgelmir0'
,
'thrudgelmir1'
,
'thrudgelmir2'
,
'thrudgelmir0'
,
'thrudgelmir1'
,
'thrudgelmir2'
,
'thrudgelmir3'
,
'thrudgelmir4'
,
'thrudgelmir5'
]
assert
sorted
(
hosts
)
==
sorted
(
expected_hosts
)
...
...
@@ -75,8 +75,8 @@ class TestInventory(unittest.TestCase):
inventory
=
self
.
simple_inventory
()
hosts
=
inventory
.
list_hosts
(
"ungrouped"
)
expected_hosts
=
[
'jupiter'
,
'saturn'
,
'thrudgelmir0'
,
'thrudgelmir1'
,
'thrudgelmir2'
,
expected_hosts
=
[
'jupiter'
,
'saturn'
,
'thrudgelmir0'
,
'thrudgelmir1'
,
'thrudgelmir2'
,
'thrudgelmir3'
,
'thrudgelmir4'
,
'thrudgelmir5'
]
assert
sorted
(
hosts
)
==
sorted
(
expected_hosts
)
...
...
@@ -84,7 +84,7 @@ class TestInventory(unittest.TestCase):
inventory
=
self
.
simple_inventory
()
hosts
=
inventory
.
list_hosts
(
"norse:greek"
)
expected_hosts
=
[
'zeus'
,
'hera'
,
'poseidon'
,
expected_hosts
=
[
'zeus'
,
'hera'
,
'poseidon'
,
'cerberus001'
,
'cerberus002'
,
'cerberus003'
,
'cottus99'
,
'cottus100'
,
'thor'
,
'odin'
,
'loki'
]
...
...
@@ -94,7 +94,7 @@ class TestInventory(unittest.TestCase):
inventory
=
self
.
simple_inventory
()
restricted_hosts
=
[
'hera'
,
'poseidon'
,
'thor'
]
expected_hosts
=
[
'zeus'
,
'hera'
,
'poseidon'
,
expected_hosts
=
[
'zeus'
,
'hera'
,
'poseidon'
,
'cerberus001'
,
'cerberus002'
,
'cerberus003'
,
'cottus99'
,
'cottus100'
,
'thor'
,
'odin'
,
'loki'
]
...
...
@@ -118,13 +118,13 @@ class TestInventory(unittest.TestCase):
hosts
=
inventory
.
list_hosts
(
"all:!greek"
)
expected_hosts
=
[
'jupiter'
,
'saturn'
,
'thor'
,
'odin'
,
'loki'
,
'thrudgelmir0'
,
'thrudgelmir1'
,
'thrudgelmir2'
,
'thrudgelmir0'
,
'thrudgelmir1'
,
'thrudgelmir2'
,
'thrudgelmir3'
,
'thrudgelmir4'
,
'thrudgelmir5'
]
assert
sorted
(
hosts
)
==
sorted
(
expected_hosts
)
hosts
=
inventory
.
list_hosts
(
"all:!norse:!greek"
)
expected_hosts
=
[
'jupiter'
,
'saturn'
,
'thrudgelmir0'
,
'thrudgelmir1'
,
'thrudgelmir2'
,
'thrudgelmir0'
,
'thrudgelmir1'
,
'thrudgelmir2'
,
'thrudgelmir3'
,
'thrudgelmir4'
,
'thrudgelmir5'
]
assert
sorted
(
hosts
)
==
sorted
(
expected_hosts
)
...
...
@@ -159,8 +159,8 @@ class TestInventory(unittest.TestCase):
print
vars
expected
=
dict
(
a
=
'1'
,
b
=
'2'
,
c
=
'3'
,
d
=
'100002'
,
rga
=
'1'
,
rgb
=
'2'
,
rgc
=
'3'
,
inventory_hostname
=
'rtp_a'
,
inventory_hostname_short
=
'rtp_a'
,
a
=
'1'
,
b
=
'2'
,
c
=
'3'
,
d
=
'100002'
,
rga
=
'1'
,
rgb
=
'2'
,
rgc
=
'3'
,
inventory_hostname
=
'rtp_a'
,
inventory_hostname_short
=
'rtp_a'
,
group_names
=
[
'eastcoast'
,
'nc'
,
'redundantgroup'
,
'redundantgroup2'
,
'redundantgroup3'
,
'rtp'
,
'us'
]
)
print
vars
...
...
test/TestPlayBook.py
View file @
1c9b43df
...
...
@@ -32,7 +32,7 @@ class TestCallbacks(object):
def
on_setup
(
self
):
EVENTS
.
append
([
'primary_setup'
])
def
on_skipped
(
self
,
host
,
item
=
None
):
EVENTS
.
append
([
'skipped'
,
[
host
]])
...
...
@@ -65,7 +65,7 @@ class TestCallbacks(object):
del
host_result
[
k
]
for
k
in
host_result
.
keys
():
if
k
.
startswith
(
'facter_'
)
or
k
.
startswith
(
'ohai_'
):
del
host_result
[
k
]
del
host_result
[
k
]
EVENTS
.
append
([
'ok'
,
[
host
,
host_result
]])
def
on_play_start
(
self
,
pattern
):
...
...
@@ -85,7 +85,7 @@ class TestCallbacks(object):
def
on_setup
(
self
):
pass
def
on_no_hosts
(
self
):
pass
...
...
@@ -116,7 +116,7 @@ class TestPlaybook(unittest.TestCase):
filename
=
os
.
path
.
join
(
self
.
test_dir
,
filename
)
assert
os
.
path
.
exists
(
filename
)
return
filename
def
_get_stage_file
(
self
,
filename
):
# get a file inside the test output directory
filename
=
os
.
path
.
join
(
self
.
stage_dir
,
filename
)
...
...
@@ -144,15 +144,15 @@ class TestPlaybook(unittest.TestCase):
pb
=
os
.
path
.
join
(
self
.
test_dir
,
'playbook1.yml'
)
actual
=
self
.
_run
(
pb
)
# if different, this will output to screen
# if different, this will output to screen
print
"**ACTUAL**"
print
utils
.
jsonify
(
actual
,
format
=
True
)
expected
=
{
expected
=
{
"127.0.0.2"
:
{
"changed"
:
9
,
"failures"
:
0
,
"ok"
:
11
,
"skipped"
:
1
,
"changed"
:
9
,
"failures"
:
0
,
"ok"
:
11
,
"skipped"
:
1
,
"unreachable"
:
0
}
}
...
...
test/playbook1.yml
View file @
1c9b43df
...
...
@@ -2,7 +2,7 @@
---
-
hosts
:
all
# the 'weasels' string should show up in the output
# the 'weasels' string should show up in the output
vars
:
answer
:
"
Wuh,
I
think
so,
Brain,
but
if
we
didn't
have
ears,
we'd
look
like
weasels."
...
...
@@ -14,7 +14,7 @@
vars_files
:
-
common_vars.yml
-
[
'
$facter_operatingsystem.yml'
,
'
default_os.yml'
]
tasks
:
-
name
:
test basic success command
...
...
@@ -34,7 +34,7 @@
-
name
:
test copy
action
:
copy src=sample.j2 dest=/tmp/ansible_test_data_copy.out
notify
:
notify
:
-
on change 1
# this should trigger two change handlers, but the 2nd should
...
...
@@ -42,7 +42,7 @@
-
name
:
test template
action
:
template src=sample.j2 dest=/tmp/ansible_test_data_template.out
notify
:
notify
:
-
on change 1
-
on change 2
...
...
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