No description
Find a file
Will West b8865314ec improve ansible start up time for very large inventory
first off, we add an oddly slow basic test of 10k item inventory

Before:
```
Ran 229 tests in 13.214s

OK

real    0m13.403s
user    0m12.106s
sys 0m1.155s
```

After:
```
Ran 230 tests in 21.328s

OK

real    0m21.516s
user    0m20.099s
sys 0m1.275s
```

since that seems like a bit long for the test to add to runtime, lets profile

`python -m cProfile -s time ./bin/ansible all -i test/units/inventory_test_data/huge_range --list-hosts`

Before:
```
         1272607 function calls (1259689 primitive calls) in 8.497 seconds

   Ordered by: internal time

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
    10000    4.393    0.000    4.396    0.000 __init__.py:395(_get_host)
    20000    2.695    0.000    2.697    0.000 __init__.py:341(__append_host_to_results)
    40369    0.113    0.000    0.113    0.000 {posix.lstat}
    50006    0.102    0.000    0.153    0.000 __init__.py:1490(combine_vars)
    40008    0.089    0.000    0.202    0.000 __init__.py:1546(_load_vars_from_path)
    20195    0.088    0.000    0.088    0.000 {posix.stat}
    10011    0.087    0.000    0.087    0.000 {posix.getcwd}
```

The top two lines are promising optimization targets

- populate Inventory's host cache more in _get_host, as we are looping
  over all the groups anyways.

- eliminate duplicate check of whether we've already included a host
  in the construction around __append_host_to_results we can infer
  presence of a host in the results list implies the presence of its
  name in the hostnames set, allowing us to only to the less expensive
  of the two checks

After:
```
         1252610 function calls (1239692 primitive calls) in 1.320 seconds

   Ordered by: internal time

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
    40369    0.105    0.000    0.105    0.000 {posix.lstat}
    50006    0.094    0.000    0.141    0.000 __init__.py:1490(combine_vars)
    40008    0.081    0.000    0.184    0.000 __init__.py:1546(_load_vars_from_path)
    10011    0.080    0.000    0.080    0.000 {posix.getcwd}
    20195    0.074    0.000    0.074    0.000 {posix.stat}
    10002    0.069    0.000    0.261    0.000 __init__.py:1517(load_vars)
```
2015-08-19 09:45:02 +05:30
bin Revert "Allow exceptions to pass through the program" 2015-08-06 10:02:58 -04:00
contrib Merge pull request #11446 from cchurch/windows_azure_from_tower 2015-08-18 15:35:51 -04:00
docs/man Add become support for OpenBSD doas 2015-08-17 21:31:18 -04:00
docsite Merge pull request #11975 from mutemule/become_doas 2015-08-17 21:36:03 -04:00
examples some fixes to become/sudo 2015-08-15 12:17:40 -04:00
hacking Fix rm call in hacking/env-setup. Since it is sourced from a user shell, 2015-08-15 00:43:45 +02:00
lib/ansible improve ansible start up time for very large inventory 2015-08-19 09:45:02 +05:30
packaging Add six as a dependency for packaging 2015-06-02 11:43:35 -07:00
samples Moving ConnectionInformation -> PlayContext 2015-07-21 12:13:50 -04:00
test fixed test to new parser options 2015-08-18 03:34:38 -04:00
ticket_stubs for ansibot compensation 2015-07-08 10:12:08 -04:00
v1 Update README.md 2015-08-13 15:50:33 +01:00
.coveragerc Add tox and travis-ci support 2015-03-13 08:20:24 -04:00
.gitattributes
.gitignore Add tox and travis-ci support 2015-03-13 08:20:24 -04:00
.gitmodules Re-adding submodules after moving things around 2015-05-03 22:30:51 -05:00
.travis.yml Push python2.4 check into travis 2015-07-31 23:45:10 -07:00
CHANGELOG.md removed dupe typoed line 2015-08-18 12:33:07 -04:00
CODING_GUIDELINES.md
CONTRIBUTING.md
COPYING
ISSUE_TEMPLATE.md Merge pull request #9853 from axos88/patch-1 2015-07-21 10:56:43 -04:00
Makefile added egg to cleanup 2015-08-16 09:33:20 -04:00
MANIFEST.in Fix removal of .git from modules directories 2015-07-13 15:46:09 -04:00
README.md Merge pull request #11869 from charleswhchan/devel 2015-08-06 07:22:13 -04:00
RELEASES.txt Backporting release info/changelog stuff to devel 2015-05-05 10:28:43 -05:00
setup.py add distutils package classifiers 2015-07-27 19:33:54 +00:00
test-requirements.txt Mock 1.1.0 lost python2.6 compatibility 2015-07-10 09:11:03 -07:00
tox.ini Push python2.4 check into travis 2015-07-31 23:45:10 -07:00
VERSION Fixing the VERSION file to match the expected "version release" format 2015-04-07 08:22:56 -05:00

PyPI version PyPI downloads Build Status

Ansible

Ansible is a radically simple IT automation system. It handles configuration-management, application deployment, cloud provisioning, ad-hoc task-execution, and multinode orchestration - including trivializing things like zero downtime rolling updates with load balancers.

Read the documentation and more at http://ansible.com/

Many users run straight from the development branch (it's generally fine to do so), but you might also wish to consume a release.

You can find instructions here for a variety of platforms. If you decide to go with the development branch, be sure to run git submodule update --init --recursive after doing a checkout.

If you want to download a tarball of a release, go to releases.ansible.com, though most users use yum (using the EPEL instructions linked above), apt (using the PPA instructions linked above), or pip install ansible.

Design Principles

  • Have a dead simple setup process and a minimal learning curve
  • Manage machines very quickly and in parallel
  • Avoid custom-agents and additional open ports, be agentless by leveraging the existing SSH daemon
  • Describe infrastructure in a language that is both machine and human friendly
  • Focus on security and easy auditability/review/rewriting of content
  • Manage new remote machines instantly, without bootstrapping any software
  • Allow module development in any dynamic language, not just Python
  • Be usable as non-root
  • Be the easiest IT automation system to use, ever.

Get Involved

  • Read Community Information for all kinds of ways to contribute to and interact with the project, including mailing list information and how to submit bug reports and code to Ansible.
  • All code submissions are done through pull requests. Take care to make sure no merge commits are in the submission, and use git rebase vs git merge for this reason. If submitting a large code change (other than modules), it's probably a good idea to join ansible-devel and talk about what you would like to do or add first and to avoid duplicate efforts. This not only helps everyone know what's going on, it also helps save time and effort if we decide some changes are needed.
  • Users list: ansible-project
  • Development list: ansible-devel
  • Announcement list: ansible-announce - read only
  • irc.freenode.net: #ansible

Branch Info

  • Releases are named after Van Halen songs.
  • The devel branch corresponds to the release actively under development.
  • As of 1.8, modules are kept in different repos, you'll want to follow core and extras
  • Various release-X.Y branches exist for previous releases.
  • We'd love to have your contributions, read Community Information for notes on how to get started.

Authors

Ansible was created by Michael DeHaan (michael.dehaan/gmail/com) and has contributions from over 1000 users (and growing). Thanks everyone!

Ansible is sponsored by Ansible, Inc